Blocks MODBUS RTU

From IPLOG
Revision as of 12:48, 1 October 2018 by Z033 (talk | contribs) (Created page with "== Modbus library == === RTU === ==== MODBUS_RTU_CFG ==== Set bus parameters {| class="wikitable" |- |in |Bus |string | |path to bus device (/dev/ttyS0) |- |in |Baud |int |...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Modbus library

RTU

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

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