C
Are the coils/registers a part of the slave/master devices? If I'm using two PC's as master slave, where are the coils/registers? How can they be accessed?
Chris
Chris
Hi,It might be helpful to see a working Modbus Master and Slave in action. Minimally, it would be helpful to have a known working slave when developing the master and vice versa.
You can download Automated Solutions' Modbus Master and Slave ActiveX Control trial editions, which are fully functioning for 30 days.
Modbus RTU & ASCII Master
http://automatedsolutions.com/products/modbusrtu.asp
Modbus/TCP Master
http://automatedsolutions.com/products/modbustcp.asp
Modbus RTU, ASCII, and TCP Slave
http://automatedsolutions.com/products/modbusslave.asp
Each comes with a ready to run example application called MiniHMI. So you don't need to write any code. The products allow you to read/write the complete range of Modbus registers and discretes.
Ultimately, you might want to save time and effort and use the ActiveX Controls in your c++ application. They are mature products that are field tested and implement a very broad range of Modbus functions including the ability to intentionally force bad packet to test slave response.
Dear GriffinCoils and registers are just names for memory addresses. The other way to look at it is that they are just pre-defined variable names. A coil is a boolean (bit) variable, and a register is an integer (word) variable.
There are discrete inputs (read-only boolean), coils (read-write boolean), input registers (read-only integer), and holding registers (read-write integer).
The Modbus protocol defines arrays of boolean and integer addresses. The memory addresses are in the "slave" or "server" (both words mean the same thing). The number of coils or registers actually present depends on what the device designer felt was necessary.
The software in the "master" or "client" uses the Modbus protocol to issue a "request" (command) for the values in the specified addresses. The slave (server) replies with a "response" which contains the data. If the master doesn't issue a request, the slave remains silent.
The Modbus protocol commands are called "functions". The functions are numbered 1, 2, 3, 4, etc. Each function does one thing - read or write one or more coils or registers. So, if you want to read the state of a limit switch, you would call the appropriate software function to read the discrete input which corresponds to it. If you wanted to turn on a valve, you would call he appropriate software function to write to the coil.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
Modbus connection to Trane Fan&Coil Unit | Modbus | 3 | ||
A | Linux Modbus Command line utility to set a coil on/off | Modbus | 3 | |
I | (Modbus) How to assign coil address as ports in PIC? | Modbus | 9 | |
X | FlowBoss S600 flow computer modbus coil writing problem | Modbus | 3 | |
D | Modbus-Writing into Holding Registers and Coil | Modbus | 1 |