Sequencer Output (SQO)

The SQO instruction sets output conditions for the next step of a sequence pair of SQO/SQI instructions.
When .EN transitions from false to true, the .POS is incremented. The .POS is reset to 1 when the .POS becomes greater than or equal to .LEN
When .EN is true the SQO instruction moves the Array data at the .POS through the Mask and then moves the current Destination value through the complemented Mask. The results of those operations are ORed together and the result is stored in the Destination.
SQO Description 1
Typically, you should use the same CONTROL structure as the SQI and SQL instructions.
Available Languages
Ladder Diagram
FBD Function_Sequencer Output (SQO)_v1
Operands
The data conversion rules for mixed data types within an instruction. See Data Conversion.
Operand
Type
Format
Description
Array
DINT
array tag
Sequencer array
Specify the first element of the sequencer array
do not use CONTROL.POS in the subscript
Mask
SINT
INT
DINT
tag
immediate
Used to determine which bits to block (0) or pass (1) and applied during the output masking operation.
Destination
DINT
tag
Output data from the sequencer array. This value is used in the output masking operation.
Control
CONTROL
tag
Control structure for the operation
The same control tag should be used in the SQI and SQL instructions
Length
DINT
immediate
Number of elements in the Array (sequencer table) to the output
Position
DINT
immediate
Current position in the array
Initial value is typically 0.
CONTROL Structure
Mnemonic
Data Type
Description
.EN (Enable)
BOOL
The enable bit indicates the SQO instruction is enabled.
.DN (Done)
BOOL
The done bit is set when .POS = .LEN
.ER (Error)
BOOL
Indicates the instruction encountered an error.
.LEN (Length)
DINT
The length specifies the number of sequencer steps in the sequencer array.
.POS (Position)
DINT
The position identifies the Array element that the instruction is currently using in the output masking operation.
Affects Math Status Flags
No
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related faults.
Execution
Ladder Diagram
Condition/State
Action Taken
Prescan
The .EN is set to true.
Rung-condition-in is false
The .EN is cleared to false
Rung-condition-in is true
See the following Flow Chart (True)
Postscan
N/A
Flow Chart (True)
SQO Flow Chart True
Example
The Mask value is AND’d with the array value e.g. Array[SqoControl.POS]. The complement of the Mask value is AND’d with the current Dest value. The results of these two operations are then OR’d together and the result is stored to the Dest.
To reset .POS to the initial value (.POS = 0), us'e a RES instruction to clear the control structure. This example uses the status of the first-scan bit to clear the .POS value.
FTStudio-SQO-LD-EX2-V1
Ladder Diagram
FTStudio-SQO-LD-EX2-V1
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.