F_iecSetSCS

This help function copies the single command state to a byte variable. In the TwinCAT PLC the single command state occupies one bit of process data. In a byte variable, the state of up to 8 single commands can therefore be mapped.
Syntax
FUNCTION F_iecSetSCS: BYTE
VAR_INPUT
in : BYTE;
offset : UDINT(0..7);
eSCS : E_IEC870_5_101SCS;
END_VAR
Inputs
in: Target variable into which the single command state is to be copied.
offset: Bit offset of the single command state.
eSCS: The new value of the single command state.
Sample in ST
The state of the four single commands is set to ON.
PROGRAM MAIN
VAR
memarea AT%M* : ARRAY[0..10] OF BYTE;
END_VAR
memarea[0] := F_iecSetSCS( memarea[0], 0, eIEC870_SCS_ON );
memarea[0] := F_iecSetSCS( memarea[0], 1, eIEC870_SCS_ON );
memarea[0] := F_iecSetSCS( memarea[0], 2, eIEC870_SCS_ON );
memarea[0] := F_iecSetSCS( memarea[0], 3, eIEC870_SCS_ON );
Requirements
Development environment | Target system type | PLC libraries to be linked (category group) |
---|---|---|
TwinCAT v3.1.4012.0 | PC oder CX (x86, x64, Arm®) | Tc2_IEC60870_5_10x (Communication->IEC60870) |