I am trying to implement a control software (client) that communicates with a number of distributed devices (servers) over Modbus. I have been reading device documents to find out where the data I want to collect is stored in registers, but I never felt like I understood the location decisions that were being made to create the Modbus servers.

What kinds of data is typically stored in each of the addressing zones? What is a Coil?

Taken from http://www.simplymodbus.ca/FAQ.htm:

up vote 5 down vote accepted

While Bence is correct, you have also asked

I have been reading device documents to find out where the data I want to collect is stored in registers, but I never felt like I understood the location decisions that were being made to create the Modbus servers

The only way to find where the data is located in the registers is through the documentation provided with the device.

Now talking about the decision, about where to place which data, consider the following example,

You have a temperature controller which provides you with the following data, 1. On/Off status 2. Temp Set Point 3. Actual Temp (typically called process value)

Then,

On/Off Status: If you want to allow external device/software to turn the device on/off then you would place it inside coils else if you just want to inform the users about the on/off status then you would place it in contacts making it read only thus restricting external control.

Set Point Typically you would want an operator to change the set point and this value would need more than a bit so this would be placed in a holding register so you can read and write into it.

Actual Temp this is something which is always read-only as you are reporting the actual sensed temperature and so should be placed in an input register.

If you want to integrate MODBUS communication into your software try NMODBUS which is a free MODBUS library and has worked great for me.

https://github.com/NModbus/NModbus

Hope that helps.

From the article you have linked:

Two tables store on/off discrete values (coils) and two store numerical values (registers). (...) Each coil or contact is 1 bit (...) Each register is 1 word = 16 bits = 2 bytes

So to answer your questions.

  1. What kinds of data is typically stored in each of the addressing zones?

    Coils/Contact zones stores single bits. For example in a lighting system you can imagine it like having an on/off bit for each light source in the building which can be used to turn on or off the specific light source. There is a second zone which holds the very same data but only allows read accesses.

    Register zones store numerical data. For example sensor readings if we are talking about output data. This is what the table name suggests as well: "Analog Output Holding Registers".

  2. What is a Coil?

    One bit variable, like a bool.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.