WRITE_CMD_QX: Updating the Command Parameters on EIO Bus
Original instructions
Description of the function
The WRITE_CMD_QX function block can be used to send a command to a Modicon X80 Ethernet I/O module through the use of command words, by performing an explicit exchange.
NOTE: The command words are specific to each specific application, and are described in the specific application manuals.
The additional parameters EN and ENO may also be configured.
The communication function blocks use one data transaction path and require multiple cycles to complete an operation. The number of transaction paths available by module and by MAST cycle depends on the communication port used:
More communication function blocks may be programmed on the same communication port. However, a communication block exceeding the maximum number on that port is not serviced until one of the transaction paths is available. Then, the next block on the same port becomes active and begins using an available path.
FBD representation
LD representation
IL representation
Representation:
CAL WRITE_CMD_QX_Instance (ENABLE:=EnableWRITE_CMD, ABORT:=AbortWRITE_CMD, ADDR:=DataStructureAddress, CHANNEL:=StringChannel, CMD_LEN:=NumberOfCMDWords, CMD:=DataStructureCommand, DONE=>WriteCmdSuccessful, ACTIVE=>WriteCmdActiv, ERROR=>WriteCmdFaulty, STATUS=>ErrorCode)
ST representation
Representation:
WRITE_CMD_QX_Instance (ENABLE:=EnableWRITE_CMD, ABORT:=AbortWRITE_CMD, ADDR:=DataStructureAddress, CHANNEL:=StringChannel, CMD_LEN:=NumberOfCMDWords, CMD:=DataStructureCommand, DONE=>WriteCmdSuccessful, ACTIVE=>WriteCmdActiv, ERROR=>WriteCmdFaulty, STATUS=>ErrorCode);
Description of parameters
The following table describes the input parameters:
Parameter
Type
Comment
EnableWRITE_CMD
Set to 1 to send a command.
AbortWRITE_CMD
BOOL
Set to 1 to abort the current operation.
DataStructureAddress
ANY_ARRAY_INT
Array containing the Modbus slave address, result of ADDMX function (1).
StringChannel
Identify the channel to work upon. Contains the rack, slot and channel numbers as follows: ‘r.s.c’. If the channel is omitted, then the module server is addressed.
NumberOfCMDWords
Number of command words to be sent.
If set to 0, all command words will be sent.
DataStructureCommand
Channel command words. Command words to write. Instance of a DDT applicable to a specific IO channel command.
The command word description is provided in each EIO device manual.
(1) To address a module in the local rack, enter 0.0.10 (CPU main server address).
The following table describes the output parameters:
Parameter
Type
Comment
WriteCmdSuccessful
BOOL
Operation completed indication. Set to 1 when the execution of the operation is completed successfully.
WriteCmdActiv
BOOL
Operation in progress indication. Set to 1 when the execution of the operation is in progress.
WriteCmdFaulty
BOOL
Set to 1 if an error is detected by the function block.
ErrorCode
Code providing the detected error identification.