READ_STS_QX: Reading the Status Parameters on EIO Bus
Original instructions
Description of the function
The READ_STS_QX function block is used to read the status words of a Modicon X80 Ethernet I/O module, by performing an explicit exchange with the processor memory.
These status words contain data on the operating mode of the module, and may be used to perform program-based diagnostics.
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
Representation:
LD representation
Representation:
IL representation
Representation:
CAL READ_STS_QX_Instance (ENABLE:=EnableREAD_STS, ABORT:=AbortREAD_STS, ADDR:=DataStructureAddress, CHANNEL:=StringChannel, DONE=>ReadStsSuccessful, ACTIVE=>ReadStsActiv, ERROR=>ReadStsFaulty, STATUS=>ErrorCode, STS_LEN=>NumberOfSTSWords, STS=>DataStructureChannelStatus)
ST representation
Representation:
READ_STS_QX_Instance (ENABLE:=EnableREAD_STS, ABORT:=AbortREAD_STS, ADDR:=DataStructureAddress, CHANNEL:=StringChannel, DONE=>ReadStsSuccessful, ACTIVE=>ReadStsActiv, ERROR=>ReadStsFaulty, STATUS=>ErrorCode, STS_LEN=>NumberOfSTSWords, STS=>DataStructureChannelStatus);
Description of parameters
The following table describes the input parameters:
Parameter
Type
Comment
EnableREAD_STS
Set to 1 to read the status words.
AbortREAD_STS
BOOL
Set to 1 to abort the current operation.
DataStructureAddress
Identifies the Modicon M340 drop which the module belongs to, result of ADDMX function (1).
StringChannel
Identifies 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.
(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
ReadStsSuccessful
BOOL
Operation completed indication. Set to 1 when the execution of the operation is completed successfully.
ReadStsActiv
BOOL
Operation in progress indication. Set to 1 when the execution of the operation is in progress.
ReadStsFaulty
BOOL
Set to 1 if an error is detected by the function block.
ErrorCode
Code providing the detected error identification.
NumberOfSTSWords
Number of status words read.
DataStructureChannelStatus
Channel status word. Number of status words to read. Instance of a DDT applicable to a specific IO channel status.
The status word description is provided in each EIO device manual.