Difference between revisions of "Blocks MODBUS RTU"
Line 56: | Line 56: | ||
Reads one coil register | Reads one coil register | ||
{| class="wikitable" | {| class="wikitable" | ||
− | | colspan="5" |[[ | + | | colspan="5" | [[Libraries for IEC 61131-3|Asynchronous interface]] |
|- | |- | ||
|in | |in | ||
Line 92: | Line 92: | ||
Read one discrete discrete input register | Read one discrete discrete input register | ||
{| class="wikitable" | {| class="wikitable" | ||
− | | colspan="5" |[[ | + | | colspan="5" | [[Libraries for IEC 61131-3|Asynchronous interface]] |
|- | |- | ||
|in | |in | ||
Line 128: | Line 128: | ||
Reads one holding register | Reads one holding register | ||
{| class="wikitable" | {| class="wikitable" | ||
− | | colspan="5" |[[ | + | | colspan="5" |[[Libraries for IEC 61131-3|Asynchronous interface]] |
|- | |- | ||
|in | |in | ||
Line 164: | Line 164: | ||
Reads one input register | Reads one input register | ||
{| class="wikitable" | {| class="wikitable" | ||
− | | colspan="5" |[[ | + | | colspan="5" |[[Libraries for IEC 61131-3|Asynchronous interface]] |
|- | |- | ||
|in | |in | ||
Line 200: | Line 200: | ||
Writes value to one coil register | Writes value to one coil register | ||
{| class="wikitable" | {| class="wikitable" | ||
− | | colspan="5" |[[ | + | | colspan="5" |[[Libraries for IEC 61131-3|Asynchronous interface]] |
|- | |- | ||
|in | |in | ||
Line 236: | Line 236: | ||
Writes value to one holding register | Writes value to one holding register | ||
{| class="wikitable" | {| class="wikitable" | ||
− | | colspan="5" |[[ | + | | colspan="5" |[[Libraries for IEC 61131-3|Asynchronous interface]] |
|- | |- | ||
|in | |in |
Revision as of 07:03, 2 October 2018
Contents
Modbus Libraries
MODBUS_RTU_CFG
Set bus parameters
in | Bus | string | path to bus device (/dev/ttyS0) | |
in | Baud | int | standard baudrates from 150 to 115200 | |
in | Parity | string[1] | "N" = none, "E" = even, "O" = odd | |
in | Databit | USINT | Databits (5,6,7,8) | |
in | Stopbit | USINT | Stopbits (1,2) | |
out | ERR | bool | indicates some error occurs (0 = OK) | |
out | ERR_ID | WORD | identifies occured error by unique code |
Note:
/dev/ttyS3 = BUS1 on the Connector E
/dev/ttyS2 = BUS2 on the Connector E
Example:
MODBUS_RTU_R_COIL
Reads one coil register
Asynchronous interface | ||||
in | Bus | string | path to bus device (/dev/ttyS0) | |
in | UnitID | byte | device bus address (0-247) | |
in | OfsAdr | word | register address (1-9999) | |
in | Timeout | byte | timeout in seconds | |
out | Q | bool | readed value |
MODBUS_RTU_R_DISCRETE
Read one discrete discrete input register
Asynchronous interface | ||||
in | Bus | string | path to bus device (/dev/ttyS0) | |
in | UnitID | byte | device bus address (0-247) | |
in | OfsAdr | word | register address (1-9999) | |
in | Timeout | byte | timeout in seconds | |
out | Q | bool | readed value |
MODBUS_RTU_R_HOLDING
Reads one holding register
Asynchronous interface | ||||
in | Bus | string | path to bus device (/dev/ttyS0) | |
in | UnitID | byte | device bus address (0-247) | |
in | OfsAdr | word | register address (1-9999) | |
in | Timeout | byte | timeout in seconds | |
out | Q | word | readed value |
MODBUS_RTU_R_INPUT
Reads one input register
Asynchronous interface | ||||
in | Bus | string | path to bus device (/dev/ttyS0) | |
in | UnitID | byte | device bus address (0-247) | |
in | OfsAdr | word | register address (1-9999) | |
in | Timeout | byte | timeout in seconds | |
out | Q | word | readed value |
MODBUS_RTU_W_COIL
Writes value to one coil register
Asynchronous interface | ||||
in | Bus | string | path to bus device (/dev/ttyS0) | |
in | UnitID | byte | device bus address (0-247) | |
in | OfsAdr | word | register address (1-9999) | |
in | Timeout | byte | timeout in seconds | |
in | VAL | bool | value to write |
MODBUS_RTU_W_HOLDING
Writes value to one holding register
Asynchronous interface | ||||
in | Bus | string | path to bus device (/dev/ttyS0) | |
in | UnitID | byte | device bus address (0-247) | |
in | OfsAdr | word | register address (1-9999) | |
in | Timeout | byte | timeout in seconds | |
in | VAL | word | value to write |