Index >> Technical support & download >> Application notes

AN28: Damocles family & Modbus/TCP  

Application examples show how to use the Modbus/TCP network protocol for communication with Damocles family products (models MINI and 2404). Use „Modbus Poll version 3.2“ program to test communication – Windows PC client over Modbus/TCP that is for free in limited version.

Content

What you can find in this application note:

  • We describe how to properly setup Modbus Poll program version 3.20
  • We help you to orientate yourself in map of Damocles product variables
  • You find out what is possible to read via Modbus/TCP protocol

Notice: Modbus Poll application version 3.20 in its unregistered version works only for 4 minutes after launch. It is necessary to restart the program after to run it again.

 

Damocles MINI

Description of Modbus/TCP interface for MINI model

Damocles model MINI accesses over Modbus/TCP protocol:
  • 4 binary inputs (inputs for contact)
    • 32-bit counter of inputs
  • 2 relays outputs
For more see product description: Damocles model MINI
Damocles MINI Digital values
address register type function Values Meaning
100 read bit 2 0 - open, 1 - close Input 1 - current value
101 read bit 2 0 - open, 1 - close Input 2 - current value
102 read bit 2 0 - open, 1 - close Input 3 - current value
103 read bit 2 0 - open, 1 - close Input 4 - current value
200 read bit 1 0 - open, 1 - close Output 1 - current value
201 read bit 1 0 - open, 1 - close Output 2 - current value
200 write bit 5 0 - open, 1 - close Output 1 - set value
201 write bit 5 0 - open, 1 - close Output 2 - set value

 

Damocles MINI counters
address register type function Values Meaning
200 read int 4 - Number of counters
201 read int 4 - Input 1 counter - address 201(H) - 202(L)
203 read int 4 - Input 2 counter - address 203(H) - 204(L)
205 read int 4 - Input 3 counter - address 205(H) - 206(L)
207 read int 4 - Input 4 counter - address 207(H) - 208(L)
201 write int 16 - Setting input 1 counter - address 201(H) - 202(L)
203 write int 16 - Setting input 2 counter - address 203(H) - 204(L)
205 write int 16 - Setting input 3 counter - address 205(H) - 206(L)
207 write int 16 - Setting input 4 counter - address 207(H) - 208(L)


Notice: In case your application for Modbus/TCP communication does not support setting of functions (Modbus Poll supports them) you can set whole length of the variable address
  • Binary inputs: 10100 for Input1, 10101 for Input2 etc.
  • Binary inputs: 00200 for Output1, 00201 for Output2 etc.
  • Counters: 30201 for Input1 counter, 30203 for Input2 counter etc.
  • 32-bit counter: counter for input 1 = 201*65535 + 202. For example 201 = 10 and 202 = 33 counter value is 65565.

 

Program Modbus Poll & Damocles MINI

Dry contact inputs - model MINI

Connect the Damocles MINI unit to ethernet and power supply. Launch Modbus Poll application (mbpoll.exe file). In setup menu select option Poll Definition (keyboard short cut F2).

Modbus/TCP & Damocles MINI
Picture a - Input setting

Setting of inputs in Modbus Poll program (Picture a)

  • Slave ID: 2
  • Function: definition of running function 02 INPUT STATUS for monitoring of input states
  • Address: definition of used variables that will be loaded (for addresses see figure bellow). Beginning at the address 100 - ending at the address 103
  • Length: length of loaded variables
  • Scan Rate: delay between two following loadings
  • Auto Read Enable: to enable automatic reading of values
  • Click OK button to confirm

 


Picture b - Network parameters setting

Addresses of inputs in terms of protocol are configured, now set up connection to device itself.

  • In Connection menu select Connect (keyboard short cut F3)
  • Select TCP/IP
  • Set up device IP address and Port (standard is 502)
  • Push OK button to confirm

Application is now connected to selected device and in periodic interval loads input values (see the picture c).

 

Damocles MINI
Picture c - Values loading

 

Damocles MINI
Picture d - Damocles MINI - WWW page


>> Damocles MINI
Download and application of Modbus Poll + examples

 

Binary outputs (Damocles MINI)

Open Poll Definition menu to control binary outputs.

Modbus/TCP & Damocles MINI
Picture e - Output setting

  • Slave ID: 2
  • Function: definition of running function 01 COIL STATUS for monitoring of output states
  • Address: defines the address of used variables that will be logged (for addresses see figure bellow). It begins at the address 200 - ending at the address 201
  • Length: number of loaded variables
  • Scan Rate: delay between two loadings
  • Auto Read Enable: to enable automatic reloading
  • Click OK button to confirm


To control binary inputs select option 05 in function menu: Write Single Coil (short cut F7).

Modbus/TCP & Damocles MINI
Picture f - Output control

You can safe setting of Poll Definition to mbp file to simplify your work. Any time you need it simply load the saved setting.


>> Damocles MINI
>> Application of Modbus Poll and examples

 

Damocles 2404

Description of Modbus/TCP interface for model 2404

Damocles MINI Damocles model 2404 accesses over Modbus/TCP protocol:

  • 24 binary inputs (dry contact inputs)
    • 32-bit counters of inputs
  • 4 relays outputs

For more see product description: Damocles model 2404


Digital values
address register type function Values Meaning
1xx read bit 2 0 - open, 1 - close Input current value, where xx is index of output
20x read bit 1 0 - open, 1 - close Output current value, where x is index of output
20x write bit 5 0 - open, 1 - close Output set value, where x is index of output

 

Analog/Digital values
address register type function Values Meaning
100 read bit 4   Number of sensors
101 read bit 4 0,1°C Temperature 1 - current value
200 read int 4 - Number of counters
2xx read int 4 - Input xx counter - address 201(H) - 202(L)
2xx write int 16 - Setting input xx counter - address 201(H) - 202(L)


>> Detailed table of addresses

In case your application for Modbus/TCP communication does not support setting of functions (Modbus Poll supports them) you can set whole length of the variable address

  • Binary inputs: 10100 for Input1, 10101 for Input2 etc.
  • Binary outputs: 00200 for Output1, 00201 for Output2 etc.
  • Temperature sensor: 30100 for number of connected sensors and 30101 for actual value
  • 32-bit counter: counter for input 1 = 201*65535 + 202. For example 201 = 10 and 202 = 33 counter value is 65565.

 

Modbus Poll & Damocles 2404

Binary inputs- model 2404

Setting of Modbus Poll application for communication with Damocles 2404 is identical with setting for Damocles MINI above, change value of Length parameter, model 2404 support 24 inputs instead of 4 and 4 outputs instead of 2.

Modbus/TCP & Damocles 2404
Picture h - Output setting - Damocles 2404

 

Temperature sensor - model 2404

Open Poll Definition in menu.

  • Slave ID: 2
  • Function: definition of running function 04 INPUT REGISTER for monitoring of output states
  • Address: defines address of used variables that will be loaded (for address see figure above).
    • Andrea 100 - number of sensors
    • Addressed 101 - current value
  • Length: number of logged values
  • Scan Rate: delay between two readings
  • Auto Read Enable: to enable automatic reloading
  • Click OK button to confirm

Modbus/TCP & Damocles MINI
Picture ch - Setting of temperature sensor

Two lines are displayed. The first line shows number of connected sensors and the second current temperature with an accuracy of 0.1° C. Save your setting to mbp file to simplify work with Poll Definition. In case you need it, simply load saved setting.

>> Damocles 2404

Download

 

Related products and links

 

We are looking forward to your feedback.

Zdenek Stupnanek - Stupnanek@ hwg.cz