Modbus CRC/Data Errors

F

Thread Starter

FInlay Killoh

Hello

I am currently having issues with a modbus interface that I am testing for a project.

I am trying to read and write data to and from a modbus slave using a GE Fanuc 90-70 PLC using the RTM-700 horner module using 1 SCB and two MCB's configured for functions 03 read holding registers and 16 Preset Multiple Holding Registers.

The configuration of the blocks is limited to the following:
slave address is 1
the command is either 03 or 16
the reference offset is 0 or 500
the length is 233 and 13
and the PLC references and byte type %R

The issue I am having is when it has completed its initialization and is transmitting to the slave simulator I have set up using modbus, it does not seem to transmit any of the configured data. and instead writes a garbage message to the slave of "RX FA F2 FF FF FF 2D AF 37" or "RX FD FE FF FF 2D AF 37" from the PLC and receives a bad CRC error B. this is all that the modbus shows for crc b or g.

So far I have found that this could be caused by either a mismatched Baud rate which I have checked at both ends and is 9600 even RTU 1 stop bit.

A mistake in the wiring which I have checked and found no issues such as tx+ to tx- etc. it is a 4-wire rs485 connection with rx->tx- and rx+>tx+ and ground.

It also seems that pull up/down resistors and shielding might help. but the cable length is only 1m with no sources of interference like motor drives etc to affect the signa.l so I'm not sure if this would have any effect.

If anyone has any suggestions on how to get this working? it would be appreciated as I seem to have run out of ideas.
 
L

Lynn August Linse

Any time you see stray 0xFF bytes, tends to be an RS-485 cable biasing issue.

What happens is the slave normally has its RS-485 wires floating to 'receive', and the master only forces voltages during 'transmit' else expects to receive & let's them float. If both sides have the RS-485 floating, then it can easily pick up noise (false start-bits), which causes the 0xFF bytes to show up in the UART.

You need to pull 1 wire up and 1 wire down. Some devices do NOT mention how this is done, but MIGHT do it if you enable termination - so no termination, no bias; else if termination, then also have bias. Anyway, check your device documentation. Adding external bias can be tricky to get the grounding/voltage levels right.
 
Top