F_iecGetSCS

This help function can be used to mask the single command state in 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_iecGetSCS: E_IEC870_5_101SCS
VAR_INPUT
in : BYTE;
offset : UDINT(0..7);
END_VAR
Inputs
in: Byte variable, from which the single command state is to be extracted.
offset: Bit offset of the single command.
Sample in ST
The state of the four single commands is masked.
PROGRAM MAIN
VAR
memarea AT%M* : ARRAY[0..10] OF BYTE;
eSCS : E_IEC870_5_101SCS;
ENd_VAR
eSCS := F_iecGetSCS( memarea[0], 0 );
eSCS := F_iecGetSCS( memarea[0], 1 );
eSCS := F_iecGetSCS( memarea[0], 2 );
eSCS := F_iecGetSCS( memarea[0], 3 );
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) |