What are common uses of Modbus?

D

Thread Starter

David

Hi,

I need to implement Modbus on a programmable smart device and I was wondering how it is typically used.

What I need to know is whether it a device usually publishes values in registers in a continuous fashion where a PLC can read them at will, or is it common practice to have a device wait for a request (read or write) from a master in order to execute some command.

I really appreciate your feedback.

David
 
Your first explanation is typical: most slaves update their registers on their own internal schedule. If the slave were to wait for a read instruction from the PLC, the turn-around time necessary to process the request would result in a time out on the master.
 
Thank you.

Also, would you be able to tell me if it is frequent (or possible) for a device to have more than one slave address?
 
M
It's possible, since addressing is strictly a software issue. In practice, the only device I've seen with more than one address was the Rotork PacScan valve network interface. The valve network allowed up to 240 devices, but the Modbus port has four sequential Modbus slave addresses, with 60 valves assigned to each address.

Mike
 
I was wondering, when a device needs to store a string in its registers, since Modbus doesn't seem to have standards for this, what encoding is typically used?
 
The Modbus spec, available from http://www.modbus.org/specs.php does have standards for data encoding, depending on the function code used to read a given register. A binary read will have a different format than a holding register read.

There are several data formats, integer, signed integer, floating point.

There are 4 variations of the byte arrangement of floating point, beg or little endian and byte swap or not, but the data is still floating point.

Carl
 
J

Jerry Miille

"Typically" the string is stored two ASCII encoded characters at a time in a 16-bit "register" with the first character in the string in the high byte and the next character in the low byte. BUT, as you point out, there is no standard for this so you should be ready to modify your methods accordingly. I have seen it encoded as a single ASCII character in the low byte of a single 16-bit register and once, with the bytes reversed in the registers. Just remember there is no standard for this so anything goes!

Jerry Miille
 
E

EricR_ICPDAS

Some devices allow Modbus TCP to RTU pass through. In other words the Ethernet version of Modbus being transformed to the binary serial form of Modbus by a converter device. These devices may have multiple serial ports, and multiple slave devices on each port. In this case The TCP pass through device will respond to many IDs, each one representing one of the attached serial slave devices.

Eric Ratliff
http://www.icpdas-usa.com
 
Top