F_iecGetSCS

 

F_iecGetSCS 1:

This function decodes the single command state from byte variable. One byte variable yields up to 8 single command states. Every single command state occupies 1 bit.

FUNCTION F_iecGetSCS: E_IEC870_5_101SCS

E_IEC870_5_101SCS

VAR_INPUT
    in     : BYTE;(* Byte variable from where the single command state have to be decoded *)
    offset : UDINT(0..7); (* Single command state offset *)
END_VAR

 

Example:

Decoding the state of 4 single commands from one byte variable.

PROGRAM MAIN
VAR
    memarea AT%MB0 : ARRAY[0..10] OF BYTE;
    eSCS : E_IEC870_5_101SCS;
ENd_VAR
eSCS := F_iecGetSCS( memarea[0], 0 );
eSCS := F_iecGetSCS( memarea[0], 1 );
eSCS := F_iecGetSCS( memarea[0], 2 );
eSCS := F_iecGetSCS( 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 )