F_iecGetSPI

This help function can be used to mask the single point information of a byte variable. In the TwinCAT PLC the single point information occupies 1 bit of process data. In a byte variable, the information of up to 8 single points can therefore be mapped.
Syntax
FUNCTION F_iecGetSPI: E_IEC870_5_101SPI
VAR_INPUT
in : BYTE;
offset : UDINT(0..7);
END_VAR
Inputs
in: Byte variable, from which the single point information is to be masked.
offset: Bit offset of the single point.
Sample in ST
The information of the four single points is masked.
PROGRAM MAIN
VAR
memarea AT%M* : ARRAY[0..10] OF BYTE;
eSPI : E_IEC870_5_101SPI;
ENd_VAR
eSPI := F_iecGetSPI( memarea[0], 0 );
eSPI := F_iecGetSPI( memarea[0], 1 );
eSPI := F_iecGetSPI( memarea[0], 2 );
eSPI := F_iecGetSPI( 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) |