F_iecGetDCS

F_iecGetDCS 1:

This help function can be used to mask the double command state in a byte variable. In the TwinCAT PLC the double command state occupies 2 bits of process data. In a byte variable, the state of up to 4 double commands can therefore be mapped.

Syntax

FUNCTION F_iecGetDCS: E_IEC870_5_101DCS
VAR_INPUT
    in     : BYTE;
    offset : UDINT(0..3);
END_VAR

F_iecGetDCS 2: Inputs

in: Variable, from which the double command state is to be masked.

offset: Bit offset of the double command state.

Sample in ST

The state of the four double commands is masked.

PROGRAM MAIN
VAR
    memarea AT%M* : ARRAY[0..10] OF BYTE;
    eDCS          : E_IEC870_5_101DCS;
ENd_VAR
eDCS := F_iecGetDCS( memarea[0], 0 );
eDCS := F_iecGetDCS( memarea[0], 1 );
eDCS := F_iecGetDCS( memarea[0], 2 );
eDCS := F_iecGetDCS( 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)
Tc2_SerialCom (Communication->Serial)
Tc2_TcpIp (Communication->TcpIp)
Tc2_Utilities (System)