RS485 Parity question

AdrianEL

Member
Join Date
Nov 2013
Location
Edinburgh
Posts
33
Hi all,

We have several devices on an RS485 loop running a ModBus protocol. There are three EM21 electricity meters from Carlos Gavazzi, one Aduenis radio, one Phoenix relay and one Ziehl TR440 temperature relay.

All the devices other than the TR440 allow us to set 9600 baud, 8 Bits, No Parity, 1 stop bit. In fact the EM21's only have this setting. But the TR440 insists that when there is no parity there must be 2 stop bits. Ziehl tell me this is part of the RS485 specification and is correct.

The Modbus Master is a RedLion G310 HMI.

If I put the TR440 into the loop with 9600,8,N,1 settings I can see all the devices other than the temperature relay and if I use 9600,8,N,2 I can see the temperature relay and nothing else.

Any ideas what to do?

Ta.
 
Ziehl is right, but for the wrong reason. EIA-485 doesn't say anything about serial framing or protocol.

The Modbus RTU serial specification uses an 11-bit data frame. The Start bit and the 8 data bits make up the first 9 of those 11 bits.

If Parity is used, then 1 stop bit is used.
If Parity is not used, then 2 stop bits must be used.

It's right there in good old PI-MBUS 300, and is most clearly expressed on Page 13.

So why do so many Modbus devices use "8/N/1" and still call themselves "Modbus RTU" ? Because there are very few consequences to violating the Modbus specification and this is one of the most common violations.

It's so common it's become a standard default setting !
 
If this were my system, I would use another channel of the G310 and connect only to the Ziehl device.

I've used an RS-232 "baud rate converter" from B&B Electronics to solve a similar problem with an RS-232 device in the past, but I'm unaware of any RS-485 devices that would do the same.

Google turned up a few, including this Polish-built unit.
 
Thanks Ken

That was the conclusion we came to and have ordered an expansion card for the G310 so we can have another RS485 port. But I thought there might be a work round that someone had come up with.
 
Ken's right, the Modbus spec says no parity must be 2 stop bits. But that has been largely ignored for well over almost two decades now.

I'm convinced that those few devices that adhere to that part of the Modbus spec represent those 'modbus' software development projects that are outsourced. Those writing the code are cube dwellers, unfamiliar with the wide-spread adoption of 8-N-1 as the default serial setting on the VAST majority of serial devices. So the development adheres to the now-out-of-date and out-of-touch spec. The buyer gets code written to the spec, but limited in its usefulness.

The sad thing is what does it take to provide a setting for one or two stop bits? Probably not all that much.

The resolution is either an adapter like Ken mentioned or 2nd serial port with its own distinct word settings. No work-around I know of for a single serial port on the master.
 
Dan you are correct about cube dwellers when it comes to writing code. I habe been hired by a few companies to create Ethernet IP bridges. Some of my jobs are checking the EIP data that someone else wrote.. Several of the programmers have said their data packets have passed the EIP scan tools. I agree with them that the packet may pass they didn't test the data for integrity. Everyone of the system I have checked lately have data wrong. The specs don't reflect real world anymore.

I like program from the view of the next guy that works on the system. I try to structure data so anyone can see the data and understand it.
 

Similar Topics

I'm trying to control a device via MODBUS RTU and the ModbusRtuMasterV2_PcCOM in Twincat 3. I've configured a device with the right com port and...
Replies
7
Views
233
Hi, Seeking consultation on an implementation matter, and have a question about Modicon Compact 984 communication through RS485: Three Modicon...
Replies
4
Views
241
i have an device which can support serial (RS485,RS232),CAN protocol . i want to connect it to an existing MIB 1553B bus ,what device will I need...
Replies
0
Views
104
Hi all, I am trying to do Modbus communications via the CB1241 RS485 Communication Board on a Siemens S71200 PLC. I am using a 1215C CPU. After...
Replies
6
Views
269
I'm trying to use a Red Lion Cub counter (Cub5B00) as a counter and give the cub's counts to a Graphite G12 PLC/HMI to display. After about an...
Replies
1
Views
116
Back
Top Bottom