Function description
The WRITE_REG_QX
function is used to write registers
in a Modbus slave connected to a Modicon M340 Modbus communication
module (BMX NOM) located in an EIO drop.
When programming a WRITE_REG_QX
function, you
must be familiar with the routing procedures used by your network.
The additional parameters EN
and ENO
can be configured.
Representation in FBD
Representation:

Representation in LD
Representation:

Representation in IL
Representation:
CAL WRITE_REG_QX_Instance (ENABLE:=WriteRegQxEnable,
ABORT:=WriteRegQxAbort, ADDR:=ModuleAddress, NO_REG:=NbRegistersToWrite,
REG_WRITE:=WriteData, SLAVEREG:=SlaveAddress, IEC:=IndexAdjust, DONE=>WriteRegQxSuccessfull,
ACTIVE=>WriteRegQxActive, ERROR=>WriteRegQxFaulty, STATUS=>ErrorCode)
Representation in ST
Representation:
WRITE_REG_QX_Instance (ENABLE:=WriteRegQxEnable,
ABORT:=WriteRegQxAbort, ADDR:=ModuleAddress, NO_REG:=NbRegistersToWrite,
REG_WRITE:=WriteData, SLAVEREG:=SlaveAddress, IEC:=IndexAdjust, DONE=>WriteRegQxSuccessfull,
ACTIVE=>WriteRegQxActive, ERROR=>WriteRegQxFaulty, STATUS=>ErrorCode)
Parameter description
Description of input parameters:
Parameter |
Data type |
Meaning |
---|---|---|
|
|
Set to 1 to write registers. |
|
|
Set to 1 to abort the current operation. |
|
|
Array containing the Modbus slave address, result of ADDMX function. |
|
|
Number of registers to be written to the Modbus slave. |
|
|
Source data field (A data structure must be declared as a located variable for the source file.) |
|
|
Offset address of the first |
|
|
Index adjust applied to
|
Description of output parameters:
Parameter |
Data type |
Meaning |
---|---|---|
|
|
Set to 1 when the execution of the function is completed successfully. |
|
|
Set to 1 when the execution of the function is in progress. |
|
|
Set to 1 if an error is detected by the function block. |
|
|
Provides the error code if an error is detected by the function block. |