Difference between revisions of "Blocks MODBUS TCP"

From IPLOG
Jump to: navigation, search
 
Line 1: Line 1:
== [[Libraries for IEC 61131-3|Back to Libraries]] ==
+
=== Slave MODE ===
 +
MODBUS SLAVE contains 4 mapping arrays each with 9999 entries. The arrays are:
 +
* Coils (0xxxxx) - cells of type BOOL
  
===== MODBUS_TCP_R_COIL =====
+
* Discretes Input (1xxxxx) - cells of type BOOL
Reads one coil register
+
 
 +
* Holding Registers (4xxxxx) - cells of type WORD
 +
 
 +
* Input Registers (3xxxxx) - cells of type WORD
 +
Lines 1..9999 correspond to the MODBUS address offset.
 +
 
 +
The default value for all cells in the arrays is '''NULL'''.
 +
 
 +
===== Reading values from arrays =====
 +
Use the ''MODBUS_GET_COIL'', ''MODBUS_GET_DISCRETE'', ''MODBUS_GET_HOLDING'', ''MODBUS_GET_INPUT'', ''MODBUS_GET2_HOLDING'' or ''MODBUS_GET2_INPUT'' function block to locally read array values.
 +
 
 +
For remote reading of array values, use the standard MODBUS function via TCP connection.
 +
 
 +
<u>NOTE: If you try to read a NULL value, the INVALID VALUE error is returned.</u>
 +
 
 +
===== Write the values to the arrays =====
 +
Use the ''MODBUS_SET_COIL'', ''MODBUS_SET_DISCRETE'', ''MODBUS_SET_HOLDING'', ''MODBUS_SET_INPUT, MODBUS_SET2_HOLDING or MODBUS_SET2_INPUT'' function block to locally write array values.
 +
 
 +
Remote values can be writen to Coils and Holding arrays. For write, use standard MODBUS functions via TCP connection.
 +
 
 +
===== Application =====
 +
MODBUS TCP SLAVE is useful if you need to provide a state of your own inputs for remote devices. For example, the switch on/off state of the button is provided for another device.
 +
 
 +
Similarly, if you need to set the status of the local relay from another device.
 +
 
 +
===== MODBUS_GET_COIL =====
 +
Reads the appropriate COIL value from the internal modbus table of values.
 
{| class="wikitable"
 
{| class="wikitable"
| colspan="5" |[[Libraries for IEC 61131-3|Asynchronous interface]]
+
|in
 +
|OfsAdr
 +
|word
 +
|
 +
|register address (1-9999)
 +
|-
 +
|out
 +
|ERR
 +
|bool
 +
|
 +
|F = No error, T = occur any error
 
|-
 
|-
|in
+
|out
|IP
+
|ERR_ID
|string
+
|word
 
|
 
|
|IP address of slave device (syntax: "aaa.bbb.ccc.ddd")
+
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 
|-
 
|-
|in
+
|out
|Port
+
|Q
|int
+
|bool
 
|
 
|
|TCP port of slave device (default: 502)
+
|return value
 
|-
 
|-
|in
+
|out
|UnitID
+
|R_TRIG
|byte
+
|bool
 
|
 
|
|Device bus address (default: 1)
+
|for future use - not implemented
 
|-
 
|-
 +
|out
 +
|W_TRIG
 +
|bool
 +
|
 +
|for future use - not implemented
 +
|}
 +
 +
===== MODBUS_GET_DISCRETE =====
 +
Reads the appropriate DISCRETE value from the internal modbus table of values.
 +
{| class="wikitable"
 
|in
 
|in
 
|OfsAdr
 
|OfsAdr
Line 30: Line 78:
 
|register address (1-9999)
 
|register address (1-9999)
 
|-
 
|-
|in
+
|out
|Timeout
+
|ERR
|byte
+
|bool
 +
|
 +
|F = No error, T = occur any error
 +
|-
 +
|out
 +
|ERR_ID
 +
|word
 
|
 
|
|timeout in seconds
+
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 
|-
 
|-
 
|out
 
|out
Line 40: Line 94:
 
|bool
 
|bool
 
|
 
|
|readed value
+
|return value
 +
|-
 +
|out
 +
|R_TRIG
 +
|bool
 +
|
 +
|for future use - not implemented
 +
|-
 +
|out
 +
|W_TRIG
 +
|bool
 +
|
 +
|for future use - not implemented
 
|}
 
|}
  
===== MODBUS_TCP_R_DISCRETE =====
+
===== MODBUS_GET_HOLDING =====
Read one discrete discrete input register
+
Reads the appropriate HOLDING register value from the internal modbus table of values.
 
{| class="wikitable"
 
{| class="wikitable"
| colspan="5" |[[Libraries for IEC 61131-3|Asynchronous interface]]
+
|in
 +
|OfsAdr
 +
|word
 +
|
 +
|register address (1-9999)
 +
|-
 +
|out
 +
|ERR
 +
|bool
 +
|
 +
|F = No error, T = occur any error
 +
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 
|-
 
|-
 +
|out
 +
|Q
 +
|word
 +
|
 +
|return value
 +
|-
 +
|out
 +
|R_TRIG
 +
|bool
 +
|
 +
|for future use - not implemented
 +
|-
 +
|out
 +
|W_TRIG
 +
|bool
 +
|
 +
|for future use - not implemented
 +
|}
 +
===== MODBUS_GET2_HOLDING =====
 +
Reads the two appropriate HOLDING registers value from the internal modbus table of values (lower register with higher weight).
 +
{| class="wikitable"
 
|in
 
|in
|IP
+
|OfsAdr
|string
+
|word
 +
|
 +
|register address (1-9999)
 +
|-
 +
|out
 +
|ERR
 +
|bool
 +
|
 +
|F = No error, T = occur any error
 +
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 +
|-
 +
|out
 +
|Q
 +
|dword
 +
|
 +
|return value
 +
|-
 +
|out
 +
|R_TRIG
 +
|bool
 
|
 
|
|IP address of slave device (syntax: "aaa.bbb.ccc.ddd")
+
|for future use - not implemented
 
|-
 
|-
 +
|out
 +
|W_TRIG
 +
|bool
 +
|
 +
|for future use - not implemented
 +
|}
 +
===== MODBUS_GET_INPUT =====
 +
Reads the appropriate INPUT register value from the internal modbus table of values.
 +
{| class="wikitable"
 
|in
 
|in
|Port
+
|OfsAdr
|int
+
|word
 +
|
 +
|register address (1-9999)
 +
|-
 +
|out
 +
|ERR
 +
|bool
 +
|
 +
|F = No error, T = occur any error
 +
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 +
|-
 +
|out
 +
|Q
 +
|word
 +
|
 +
|return value
 +
|-
 +
|out
 +
|R_TRIG
 +
|bool
 
|
 
|
|TCP port of slave device (default: 502)
+
|for future use - not implemented
 
|-
 
|-
 +
|out
 +
|W_TRIG
 +
|bool
 +
|
 +
|for future use - not implemented
 +
|}
 +
===== MODBUS_GET2_INPUT =====
 +
Reads the two appropriate INPUT registers value from the internal modbus table of values (lower register with higher weight).
 +
{| class="wikitable"
 
|in
 
|in
|UnitID
+
|OfsAdr
|byte
+
|word
 +
|
 +
|register address (1-9999)
 +
|-
 +
|out
 +
|ERR
 +
|bool
 +
|
 +
|F = No error, T = occur any error
 +
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 +
|-
 +
|out
 +
|Q
 +
|dword
 +
|
 +
|return value
 +
|-
 +
|out
 +
|R_TRIG
 +
|bool
 
|
 
|
|Device bus address (default: 1)
+
|for future use - not implemented
 
|-
 
|-
 +
|out
 +
|W_TRIG
 +
|bool
 +
|
 +
|for future use - not implemented
 +
|}
 +
===== MODBUS_SET_COIL =====
 +
Writes the appropriate COIL value to the internal modbus table of values.
 +
{| class="wikitable"
 
|in
 
|in
 
|OfsAdr
 
|OfsAdr
Line 73: Line 275:
 
|-
 
|-
 
|in
 
|in
|Timeout
+
|VAL
|byte
+
|bool
 
|
 
|
|timeout in seconds
+
|value to write
 
|-
 
|-
 
|out
 
|out
|Q
+
|ERR
 
|bool
 
|bool
 
|
 
|
|readed value
+
|F = No error, T = occur any error
 +
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 
|}
 
|}
  
===== MODBUS_TCP_R_HOLDING =====
+
===== MODBUS_SET_COILS =====
Reads one holding register
+
Writes the appropriate COILS value to the internal modbus table of values. In the range OfsAddrStart to OfsAddrEnd.
 +
 
 +
'''Always OfsAddrStart must be less than OfsAddrEnd.'''
 
{| class="wikitable"
 
{| class="wikitable"
| colspan="5" |[[Libraries for IEC 61131-3|Asynchronous interface]]
+
|in
 +
|OfsAddrStart
 +
|word
 +
|
 +
|address start (1-9999)
 
|-
 
|-
 
|in
 
|in
|IP
+
|OfsAddrEnd
|string
+
|word
 
|
 
|
|IP address of slave device (syntax: "aaa.bbb.ccc.ddd")
+
|address stop (1-9999)
 
|-
 
|-
 
|in
 
|in
|Port
+
|VAL
|int
+
|bool
 +
|
 +
|value to vrite
 +
|-
 +
|out
 +
|Err
 +
|bool
 
|
 
|
|TCP port of slave device (default: 502)
+
|F = No error, T = occur any error
 
|-
 
|-
 +
|out
 +
|Err_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 +
|}
 +
 +
===== MODBUS_SET_COILS_ALL =====
 +
Write all COILS value cross all registers 1 - 9999.
 +
{| class="wikitable"
 
|in
 
|in
|UnitID
+
|VAL
|byte
+
|bool
 +
|
 +
|value to write
 +
|-
 +
|out
 +
|ERR
 +
|bool
 
|
 
|
|Device bus address (default: 1)
+
|F = No error, T = occur any error
 
|-
 
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 +
|}
 +
 +
===== MODBUS_SET_DISCRETE =====
 +
Writes the appropriate DISCRETE value to the internal modbus table of values.
 +
{| class="wikitable"
 
|in
 
|in
 
|OfsAdr
 
|OfsAdr
Line 115: Line 361:
 
|-
 
|-
 
|in
 
|in
|Timeout
+
|VAL
|byte
+
|bool
 +
|
 +
|value to write
 +
|-
 +
|out
 +
|ERR
 +
|bool
 
|
 
|
|timeout in seconds
+
|F = No error, T = occur any error
 
|-
 
|-
 
|out
 
|out
|Q
+
|ERR_ID
 
|word
 
|word
 
|
 
|
|readed value
+
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 
|}
 
|}
  
===== MODBUS_TCP_R_INPUT =====
+
===== MODBUS_SET_DISCRETES =====
Reads one input register
+
Writes the appropriate DISCRETES value to the internal modbus table of values. In the range OfsAddrStart to OfsAddrEnd.
 +
 
 
{| class="wikitable"
 
{| class="wikitable"
| colspan="5" |[[Libraries for IEC 61131-3|Asynchronous interface]]
+
|in
 +
|OfsAddrStart
 +
|word
 +
|
 +
|address start (1-9999)
 
|-
 
|-
 
|in
 
|in
|IP
+
|OfsAddrEnd
|string
+
|word
 
|
 
|
|IP address of slave device (syntax: "aaa.bbb.ccc.ddd")
+
|address stop (1-9999)
 
|-
 
|-
 
|in
 
|in
|Port
+
|VAL
|int
+
|bool
 +
|
 +
|value to write
 +
|-
 +
|out
 +
|ERR
 +
|bool
 
|
 
|
|TCP port of slave device (default: 502)
+
|F = No error, T = occur any error
 
|-
 
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 +
|}
 +
 +
===== MODBUS_SET_DISCRETES_ALL =====
 +
Write all DISCRETES value cross all registers 1 - 9999.
 +
{| class="wikitable"
 
|in
 
|in
|UnitID
+
|VAL
|byte
+
|word
 +
|
 +
|val to write
 +
|-
 +
|out
 +
|ERR
 +
|bool
 
|
 
|
|Device bus address (default: 1)
+
|F = No error, T = occur any error
 
|-
 
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 +
|}
 +
 +
===== MODBUS_SET_HOLDING =====
 +
Writes the appropriate HOLDING register value to the internal modbus table of values.
 +
{| class="wikitable"
 
|in
 
|in
 
|OfsAdr
 
|OfsAdr
Line 157: Line 446:
 
|-
 
|-
 
|in
 
|in
|Timeout
+
|VAL
|byte
+
|word
 +
|
 +
|value to write
 +
|-
 +
|out
 +
|ERR
 +
|bool
 
|
 
|
|timeout in seconds
+
|F = No error, T = occur any error
 
|-
 
|-
 
|out
 
|out
|Q
+
|ERR_ID
 
|word
 
|word
 
|
 
|
|readed value
+
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 
|}
 
|}
  
===== MODBUS_TCP_W_COIL =====
+
===== MODBUS_SET_HOLDINGS =====
Writes value to one coil register
+
Writes the appropriate HOLDINGS value to the internal modbus table of values. In the range OfsAddrStart to OfsAddrEnd.
 
{| class="wikitable"
 
{| class="wikitable"
| colspan="5" |[[Libraries for IEC 61131-3|Asynchronous interface]]
+
|in
 +
|OfsAddrStart
 +
|word
 +
|
 +
|address start (1-9999)
 
|-
 
|-
 
|in
 
|in
|IP
+
|OfsAddrStop
|string
+
|word
 
|
 
|
|IP address of slave device (syntax: "aaa.bbb.ccc.ddd")
+
|address stop(1-9999)
 
|-
 
|-
 
|in
 
|in
|Port
+
|VAL
|int
+
|word
 +
|
 +
|value to write
 +
|-
 +
|out
 +
|ERR
 +
|bool
 
|
 
|
|TCP port of slave device (default: 502)
+
|F = No error, T = occur any error
 
|-
 
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 +
|}
 +
 +
===== MODBUS_SET_HOLDINGS_ALL =====
 +
Write all HOLDINGS value cross all registers 1 - 9999.
 +
{| class="wikitable"
 
|in
 
|in
|UnitID
+
|VAL
|byte
+
|word
 +
|
 +
|value to write
 +
|-
 +
|out
 +
|ERR
 +
|bool
 
|
 
|
|Device bus address (default: 1)
+
|F = No error, T = occur any error
 
|-
 
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 +
|}
 +
 +
===== MODBUS_SET2_HOLDING =====
 +
Writes the two appropriate HOLDING registers value to the internal modbus table of values (lower register with higher weight).
 +
{| class="wikitable"
 
|in
 
|in
 
|OfsAdr
 
|OfsAdr
Line 199: Line 530:
 
|-
 
|-
 
|in
 
|in
|Timeout
+
|VAL
|byte
+
|dword
 +
|
 +
|value to write
 +
|-
 +
|out
 +
|ERR
 +
|bool
 +
|
 +
|F = No error, T = occur any error
 +
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 +
|}
 +
===== MODBUS_SET_INPUT =====
 +
Writes the appropriate INPUT register value to the internal modbus table of values.
 +
{| class="wikitable"
 +
|in
 +
|OfsAdr
 +
|word
 
|
 
|
|timeout in seconds
+
|register address (1-9999)
 
|-
 
|-
 
|in
 
|in
 
|VAL
 
|VAL
 +
|word
 +
|
 +
|value to write
 +
|-
 +
|out
 +
|ERR
 
|bool
 
|bool
 
|
 
|
|value to write
+
|F = No error, T = occur any error
 +
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 
|}
 
|}
  
===== MODBUS_TCP_W_HOLDING =====
+
===== MODBUS_SET_INPUTS =====
Writes value to one holding register
+
Writes the appropriate INPUTS value to the internal modbus table of values. In the range OfsAddrStart to OfsAddrEnd.
 
{| class="wikitable"
 
{| class="wikitable"
| colspan="5" |[[Libraries for IEC 61131-3|Asynchronous interface]]
+
|in
 +
|OfsAddrStart
 +
|word
 +
|
 +
|address start (1-9999)
 
|-
 
|-
 
|in
 
|in
|IP
+
|OfsAddrStop
|string
+
|word
 
|
 
|
|IP address of slave device (syntax: "aaa.bbb.ccc.ddd")
+
|address stop (1-9999)
 
|-
 
|-
 
|in
 
|in
|Port
+
|VAL
|int
+
|word
 +
|
 +
|value to write
 +
|-
 +
|out
 +
|ERR
 +
|bool
 
|
 
|
|TCP port of slave device (default: 502)
+
|F = No error, T = occur any error
 
|-
 
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 +
|}
 +
 +
===== MODBUS_SET_INPUTS_ALL =====
 +
Write all INPUTS value cross all registers 1 - 9999.
 +
{| class="wikitable"
 
|in
 
|in
|UnitID
+
|VAL
|byte
+
|word
 +
|
 +
|value to write
 +
|-
 +
|out
 +
|ERR
 +
|bool
 
|
 
|
|Device bus address (default: 1)
+
|F = No error, T = occur any error
 
|-
 
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 +
|}
 +
 +
===== MODBUS_SET2_INPUT =====
 +
Writes the two appropriate INPUT registers value to the internal modbus table of values (lower register with higher weight).
 +
{| class="wikitable"
 
|in
 
|in
 
|OfsAdr
 
|OfsAdr
Line 241: Line 641:
 
|-
 
|-
 
|in
 
|in
|Timeout
+
|VAL
 +
|word
 +
|
 +
|value to write
 +
|-
 +
|out
 +
|ERR
 +
|bool
 +
|
 +
|F = No error, T = occur any error
 +
|-
 +
|out
 +
|ERR_ID
 +
|word
 +
|
 +
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 +
|}
 +
===== MODBUS_TCP_SLAVE =====
 +
This function block starts listening TCP MODBUS slave deamon on the appropriate port.
 +
{| class="wikitable"
 +
|in
 +
|Port
 +
|int
 +
|
 +
|Listening TCP port (default: 502)
 +
|-
 +
|in
 +
|UnitID
 
|byte
 
|byte
 
|
 
|
|timeout in seconds
+
|device bus address (1-247) (default: 1)
 
|-
 
|-
|in
+
|out
|VAL
+
|ERR
 +
|bool
 +
|
 +
|F = No error, T = occur any error
 +
|-
 +
|out
 +
|ERR_ID
 
|word
 
|word
 
|
 
|
|value to write
+
|Error ID - see [[Error codes for IEC 61131-3 libraries|Error table]]
 
|}
 
|}

Latest revision as of 04:55, 16 July 2025

Slave MODE

MODBUS SLAVE contains 4 mapping arrays each with 9999 entries. The arrays are:

  • Coils (0xxxxx) - cells of type BOOL
  • Discretes Input (1xxxxx) - cells of type BOOL
  • Holding Registers (4xxxxx) - cells of type WORD
  • Input Registers (3xxxxx) - cells of type WORD

Lines 1..9999 correspond to the MODBUS address offset.

The default value for all cells in the arrays is NULL.

Reading values from arrays

Use the MODBUS_GET_COIL, MODBUS_GET_DISCRETE, MODBUS_GET_HOLDING, MODBUS_GET_INPUT, MODBUS_GET2_HOLDING or MODBUS_GET2_INPUT function block to locally read array values.

For remote reading of array values, use the standard MODBUS function via TCP connection.

NOTE: If you try to read a NULL value, the INVALID VALUE error is returned.

Write the values to the arrays

Use the MODBUS_SET_COIL, MODBUS_SET_DISCRETE, MODBUS_SET_HOLDING, MODBUS_SET_INPUT, MODBUS_SET2_HOLDING or MODBUS_SET2_INPUT function block to locally write array values.

Remote values can be writen to Coils and Holding arrays. For write, use standard MODBUS functions via TCP connection.

Application

MODBUS TCP SLAVE is useful if you need to provide a state of your own inputs for remote devices. For example, the switch on/off state of the button is provided for another device.

Similarly, if you need to set the status of the local relay from another device.

MODBUS_GET_COIL

Reads the appropriate COIL value from the internal modbus table of values.

in OfsAdr word register address (1-9999)
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
out Q bool return value
out R_TRIG bool for future use - not implemented
out W_TRIG bool for future use - not implemented
MODBUS_GET_DISCRETE

Reads the appropriate DISCRETE value from the internal modbus table of values.

in OfsAdr word register address (1-9999)
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
out Q bool return value
out R_TRIG bool for future use - not implemented
out W_TRIG bool for future use - not implemented
MODBUS_GET_HOLDING

Reads the appropriate HOLDING register value from the internal modbus table of values.

in OfsAdr word register address (1-9999)
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
out Q word return value
out R_TRIG bool for future use - not implemented
out W_TRIG bool for future use - not implemented
MODBUS_GET2_HOLDING

Reads the two appropriate HOLDING registers value from the internal modbus table of values (lower register with higher weight).

in OfsAdr word register address (1-9999)
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
out Q dword return value
out R_TRIG bool for future use - not implemented
out W_TRIG bool for future use - not implemented
MODBUS_GET_INPUT

Reads the appropriate INPUT register value from the internal modbus table of values.

in OfsAdr word register address (1-9999)
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
out Q word return value
out R_TRIG bool for future use - not implemented
out W_TRIG bool for future use - not implemented
MODBUS_GET2_INPUT

Reads the two appropriate INPUT registers value from the internal modbus table of values (lower register with higher weight).

in OfsAdr word register address (1-9999)
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
out Q dword return value
out R_TRIG bool for future use - not implemented
out W_TRIG bool for future use - not implemented
MODBUS_SET_COIL

Writes the appropriate COIL value to the internal modbus table of values.

in OfsAdr word register address (1-9999)
in VAL bool value to write
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
MODBUS_SET_COILS

Writes the appropriate COILS value to the internal modbus table of values. In the range OfsAddrStart to OfsAddrEnd.

Always OfsAddrStart must be less than OfsAddrEnd.

in OfsAddrStart word address start (1-9999)
in OfsAddrEnd word address stop (1-9999)
in VAL bool value to vrite
out Err bool F = No error, T = occur any error
out Err_ID word Error ID - see Error table
MODBUS_SET_COILS_ALL

Write all COILS value cross all registers 1 - 9999.

in VAL bool value to write
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
MODBUS_SET_DISCRETE

Writes the appropriate DISCRETE value to the internal modbus table of values.

in OfsAdr word register address (1-9999)
in VAL bool value to write
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
MODBUS_SET_DISCRETES

Writes the appropriate DISCRETES value to the internal modbus table of values. In the range OfsAddrStart to OfsAddrEnd.

in OfsAddrStart word address start (1-9999)
in OfsAddrEnd word address stop (1-9999)
in VAL bool value to write
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
MODBUS_SET_DISCRETES_ALL

Write all DISCRETES value cross all registers 1 - 9999.

in VAL word val to write
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
MODBUS_SET_HOLDING

Writes the appropriate HOLDING register value to the internal modbus table of values.

in OfsAdr word register address (1-9999)
in VAL word value to write
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
MODBUS_SET_HOLDINGS

Writes the appropriate HOLDINGS value to the internal modbus table of values. In the range OfsAddrStart to OfsAddrEnd.

in OfsAddrStart word address start (1-9999)
in OfsAddrStop word address stop(1-9999)
in VAL word value to write
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
MODBUS_SET_HOLDINGS_ALL

Write all HOLDINGS value cross all registers 1 - 9999.

in VAL word value to write
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
MODBUS_SET2_HOLDING

Writes the two appropriate HOLDING registers value to the internal modbus table of values (lower register with higher weight).

in OfsAdr word register address (1-9999)
in VAL dword value to write
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
MODBUS_SET_INPUT

Writes the appropriate INPUT register value to the internal modbus table of values.

in OfsAdr word register address (1-9999)
in VAL word value to write
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
MODBUS_SET_INPUTS

Writes the appropriate INPUTS value to the internal modbus table of values. In the range OfsAddrStart to OfsAddrEnd.

in OfsAddrStart word address start (1-9999)
in OfsAddrStop word address stop (1-9999)
in VAL word value to write
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
MODBUS_SET_INPUTS_ALL

Write all INPUTS value cross all registers 1 - 9999.

in VAL word value to write
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
MODBUS_SET2_INPUT

Writes the two appropriate INPUT registers value to the internal modbus table of values (lower register with higher weight).

in OfsAdr word register address (1-9999)
in VAL word value to write
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table
MODBUS_TCP_SLAVE

This function block starts listening TCP MODBUS slave deamon on the appropriate port.

in Port int Listening TCP port (default: 502)
in UnitID byte device bus address (1-247) (default: 1)
out ERR bool F = No error, T = occur any error
out ERR_ID word Error ID - see Error table