Specifications

Chapter 5 - AsconMBCommLib
129
5-3-3 Modbus MASTER COIL WRITE
FB Prototype
MB_MST_WR_COIL
Input parameters
Output parameters
Description
This function block performs a writing of max 32 continuous Modbus COILS in
according to the parameters specified as Inputs.
Rerefence
table
Input
Label Type Description Range
SEQ USINT
Sequence identifiable number. This number
MUST BE UNIQUE
for each MB_MST series
FB [num]
1... 255
NR_SEQ USINT
Input that MUST
be connected to the
MB_MST_Sync output [num]
NODE USINT Node of the Slave Address to be Inquired [num] 0... 247
MB_FUNC USINT
Modbus Query Function 5 (Single COIL) or 15
(Multiple COILS)
ID_COIL UINT Modbus starting COIL address. [num] 1... 65535
NR_COIL UINT Modbus number of COIL to manage. [num] 1... 32
WR_COIL DWORD
Dword containing the coils to be written
masked in according to the NR_COIL value
T_OUT UINT
Communication Time Out factor of 100 ms (eg.
10 means 10 x 100 ms = 1 s) [num]
0... 65535
RETRY USINT Number of Retry on the same operation [num] 1... 255
Label Type Description
MB_FAIL BOOL Modbus operation fail status
MB_TOUT BOOL Modbus timeout error status
MB_ERR BOOL Generic Modbus error event
MB_STS USINT Modbus communication status
MB_OPRS USINT Modbus function block operations status
SEQ
NR_SEQ
NODE
ID_COIL
NR_COIL
WR_COIL
T_OUT
RETRY
USINT
USINT
USINT
UINT
UINT
DWORD
UINT
USINT
¡
¡
¡
¡
¡
¡
¡
¡
BOOL
BOOL
BOOL
USINT
USINT
MB_FAIL
MB_TOUT
MB_ERR
MB_STS
MB_OPRS
¡
¡
¡
¡
¡
Label Description
SEQ
Value from 1 to what specified as NR_CMD for the MB_MST_Sync
function block (max. 255)
NODE From 0... 247
MB_FUNC 5 or 15, in according to the Modbus specifications
ID_COIL From 1... 65535
NR_COIL From 1... 32
T_OUT From 1... 65535. Deafult value 10 (1000 ms)
RETRY From 1... 255. Deafult value 1