F_iecGetDPI

F_iecGetDPI 1:

This help function can be used to mask the double point information of a byte variable. In the TwinCAT PLC the double point information occupies 2 bit of process data. In a byte variable, the information of up to 4 double points can therefore be mapped.

Syntax

FUNCTION F_iecGetDPI: E_IEC870_5_101DPI
VAR_INPUT
    in     : BYTE;
    offset : UDINT(0..3);
END_VAR

F_iecGetDPI 2: Inputs

in: Variable, from which the double point information is to be masked.

offset: Bit offset of a double point information.

Sample in ST

The information of the four double points is masked.

PROGRAM MAIN
VAR
    memarea AT%M* : ARRAY[0..10] OF BYTE;
    eDPI          : E_IEC870_5_101DPI;
ENd_VAR
eDPI := F_iecGetDPI( memarea[0], 0 );
eDPI := F_iecGetDPI( memarea[0], 1 );
eDPI := F_iecGetDPI( memarea[0], 2 );
eDPI := F_iecGetDPI( 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)