Академический Документы
Профессиональный Документы
Культура Документы
Recommendations?
1. Use API Mode whenever possible.
2. Make sure receiving devices have a configurable idle-gap or end-of-message
timeout which can set to at least 500 milliseconds.
3. Default master requests to at least 5 seconds timeout.
4. Avoid sending read requests with different offsets, yet the same register count to the
same remote. If required, read a few extra registers and have your master confirm
the BYTE count matches the expected size, based on the requested register count.
5. To overcome the longer timeout, design your master to 'probe' the incoming
response to detect end-of-message. For example, a response with a read-multipleholding-registers will always have the byte count as the third byte. So this simple
paradigm can be considered:
o Wait for at least 3 bytes to be seen
o Take 3rd byte (byte-count) and add 5 to it (the slave address, function code,
byte count, and 2 bytes CRC), this is the estimated response length
o Wait for the estimated byte count. When seen, immediately test CRC16 and
exit, or handle a response timeout if required
Future Improvements?
Although I have not done any work on this yet, I have held some discussion with others
about creating a new Modbus 'dialect' to overcome the largest risks. For example, adding a
LENGTH field and SEQUENCE NUMBER would overcome most of the risks listed
above.
A secondary expansion would be to enable what I could call a sticky poll. So imagine I
wish to read 7 Modbus registers every 5 seconds. If I send a poll every 5 seconds, and I
receive 1 response, I have consumed 2-units of radio bandwidth. What if I could send the
poll once in a special format, then have the remote node refresh the response automatically
every 5 seconds until some future event (or time period) stops it. Where is the value?
Imagine I have 200 Modbus devices to poll - being able to immediately cut the traffic in
half means I can poll the data either twice as fast, or double the number of remotes.
Resources:
1. SunSpec ( http://www.sunspec.org/ ) creating standard Modbus and XML upload
specs for renewable energy.
2. Modbus Organization ( http://www.modbus.org/ )
3. Lynn's Modbus Protocol Information ( http://iatips.com/modbus.html )