F_iecGetDCS

This function decodes the double command state from byte variable. One byte variable yields up to 4 double commands states. Every double command state occupies 2 bits.
FUNCTION F_iecGetDCS: E_IEC870_5_101DCS
VAR_INPUT
in : BYTE; (* Byte variable from where the double command state have to be decoded *)
offset : UDINT(0..3); (* Double command state offset *)
END_VAR
Example:
Decoding the state of 4 double commands from byte variable.
PROGRAM MAIN
VAR
memarea AT%MB0 : 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 | 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 ) |