IR 809 - how to use RS-485 serial port?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-29-2016 03:32 PM - edited 03-01-2019 03:12 AM
Hi guys,
I'm looking for some tips regarding how to properly use RS-485 serial port on IR 809
to connect to the MODBUS RTU sensor.
I followed the guides I've found, but the configs focused on RS-232. I've changed the media-type
to rs485 for the async 0 interface and set it to half-duplex.
I was not sure about the pinout for RS485. I followed this guide. According to the Table 8
PIN 1 should be RX/TX+ and PIN 2 should be RX/TX-.
With this configuration my python app based on minimalmodbus module shows random garbage whenever
I try to read anything from /dev/ttyS1. Funny thing is that it reads random garbage from /dev/ttyS1 even when
there's no connection at all.
I verified the modbus sensor in my previous project based on 819, thus I'm sure that sensor works good.
<code>
import minimalmodbus
import serial
import time
instrument = minimalmodbus.Instrument('/dev/ttyS1', 1)
instrument.serial.baudrate = 9600
instrument.serial.bytesize = 8
instrument.serial.parity = serial.PARITY_NONE
instrument.serial.stopbits = 2
instrument.serial.timeout = 1
instrument.mode = minimalmodbus.MODE_RTU
temperature = instrument.read_register(5,2,4)
</code>
<error>
ValueError: Checksum error in rtu mode: '\x04\x00' instead of 'e\xc1' . The response is: '\x00\x00\x04\x00\x00\x04\x00' (plain response: '\x00\x00\x04\x00\x00\x04\x00')
</error>
- Labels:
-
IOx on IR829