F_iecGetDPI

This function decodes the double point information from byte variable. One byte variable yields up to 4 double points information. Every double point information occupies 2 bits.
FUNCTION F_iecGetDPI: E_IEC870_5_101DPI
VAR_INPUT
in : BYTE; (* Byte variable from where the double point information have to be decoded *)
offset : UDINT(0..3); (* Double point information offset *)
END_VAR
Example:
Decoding the information of 4 double points from one byte variable.
PROGRAM MAIN
VAR
memarea AT%MB0 : 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 | PLC libraries to include |
---|---|---|
TwinCAT v2.10.0 Build >= 1324 | PC or CX (x86, ARM) | TcIEC870_5_101.Lib ( Standard.Lib; TcBase.Lib; TcSystem.Lib; TcUtilities.Lib are included automatically ) |