FUNCTION_BLOCK REJ_CTL

ECC

An instance of this Function Block type provides the logic for sorting peg/ring assemblies from unassembled pegs in the Sortation/Inspection example. Its operation is defined by the Execution Control Chart (ECC) shown above and Structured Text (ST) algorithms below.

Since the sortation solenoid is physically separated from the inspection area, the result of the inspection is stored in the internal variable REJ_BIT until the presence of the workpiece is detected in the sortation area. This approach works as long as the workpiece passes the sortation area before another workpiece enters the inspection area. If this were not the case, a queue of inspection results would have to be maintained.

See the TESTBED_MVCL system configuration for an example of the use of an instance of this type.

ALGORITHM INIT IN ST : (* Clear Reject Solenoid *)
REJECT_SOLENOID := FALSE;
REJ_BIT := FALSE;
END_ALGORITHM

ALGORITHM INSPECT IN ST : (* Inspection failed, set REJ_BIT *)
REJ_BIT := TRUE;
END_ALGORITHM

ALGORITHM REJECT IN ST : (* Set state of Reject Solenoid *)
REJECT_SOLENOID := REJ_BIT;
END_ALGORITHM