How to identify start of modbus request?

A

Thread Starter

Ariel Ze'evi

I am writing RTU Modbus on rs485 slave. But I have problems to identify start of message request. Is the way to identify a start of message is only with the 3.5 char time delay between requests, or is there another way. Also, can I use the CRC check in order to identify if the packet is full, or I catch it in the middle of a packet? The biggest problem is with the device id of 0 - broadcast. thanks in advane.
 
From the "Been There, Done That" department:

Per the RTU spec. the (minimum) 3.5 character length space is DEFINED as the start/end of a message. (Yeah, it's tough to do on general purpose equipment! You just about have to be handling the input character-by-character while resetting a timer by using "C" or assembly routines.)

The CRC check will tell you if you have a valid message, including whether you missed the beginning, to a certainty of 1 in 65,536 (if memory serves). That of course means that if you are getting a LOT of mangled messages, a bad one will check "OK" every so often.

The good news is that the vast majority of Modbus masters don't send out a flood of messages stacked end-to-end, but poll with plenty of space between messages. You can usually do OK with examining the header to see where the CRC and end of message should be, extracting the CRC and checking validity of the message.

Good luck!

Harvey
 
SLAVE configuration:- MASTER configuration:
Baud rate: 9600 Baud rate: 9600
Parity: odd Parity: odd
Stop bit:1 stop bit: 1
device:remote digital i/o word length:8
port used : RS 485 Controller: HC900 C50(Honeywell controller)
Input register address: 40010 (holding register) port used: RS 485
output register address: 43500(holding register) Input register:40011(holding register-bit packed)
output register: 43501(single preset register)

Driver: stand. modbus RTU

We have done the above configuration and the result is data link error, and showing bad communication.
All the cable RS485 also cheked and found ok.
Is there any standard format for modbus address for configuring master slave device?
Also we have checked the above devices with wintech software (modscan+modsim).
please give me the detail guideline for the above problem.

Thanks and regards,
For Megi control system Pvt. Ltd. Thane
Aafin Ansari
Engineer-Projects
 
It isn't clear from your post whether you intend the HC900 controller to be a Modbus slave or Modbus Master. Which is it?

1) The RS-485 2 pin connector on the controller module has to be configured in HCD as the Modbus port, otherwise it defaults to the proprietary operator interace protocol port, and will never communicate Modbus protocol if left in that state.

The port is configured on the utilities tab of HCD, "Set controller serial ports"

2) The same dialog box (above) that establishes the mode and protocol of the port allows for data format configuration. I recall that the default data format is 8 data bits, 1 start bit, no parity.

Obviously, the data formats have to match on both master and all slaves.

3) There are a couple blinking LEDs to the right of the connectors on the controller itself. One LED is transmit, the other is receive. Both should blink green when the comm link is established.

4) Which function block did you use for addressing the registers?

Bud
 
Top