Specifications

Chapter 5 - AsconMBCommLib
133
5-3-5 Modbus MASTER WORD WRITE
FB Prototype
MB_MST_WR_WORD
Input parameters
Output parameters
Description
This function block performs a writing of max 16 continuous Modbus REG-
ISTERS in according to the parameters specified as Inputs
1
.
Input 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 6 (Single REGIS-
TERS) or 16 (Multiple REGISTERS)
ID_REG UINT
Modbus starting REGISTERS address
[num]
1... 65535
NR_REG UINT
Modbus number of REGISTERS to man-
age [num] (admitted range 1... 16)
1... 32
WR_REG
ARRAY [1..16]
OF WORD
Array of 16 WORDS to be written
T_OUT UINT
Communication Time Out factor of 100 ms
(eg. 10 means 10 x 100 ms = 1s) [num]
0... 65535
RETRY USINT Number of retry on the same operation 1... 255
Output 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_REG
NR_REG
WR_REG
T_OUT
RETRY
USINT
USINT
USINT
UINT
UINT
ARRAY [1..16] OF WORD
UINT
USINT
¡
¡
¡
¡
¡
¡
¡
¡
BOOL
BOOL
BOOL
USINT
USINT
MB_FAIL
MB_TOUT
MB_ERR
MB_STS
MB_OPRS
¡
¡
¡
¡
¡
1. The MB_MST_xx_yyy function blocks need a series of global variables that must be
linked at compile time. In the Ascon Template project these are defined in the files
“SystemDirectVar.POE” and “SystemVar.POE”