F_iecSetSCS

This function encodes the single command state in the byte variable. One byte variable yields up to 8 single command states. Every single command state occupies 1 bit.
FUNCTION F_iecSetSCS: BYTE
VAR_INPUT
in : BYTE; (* Byte variable where the new single command state have to be encoded. *)
offset : UDINT(0..7);(* Single command state offset. *)
eSCS : E_IEC870_5_101SCS; (* The new value of single command state. *)
END_VAR
Example:
Setting the state of 4 single command to ON.
PROGRAM MAIN
VAR
memarea AT%MB0 : ARRAY[0..10] OF BYTE;
END_VAR
memarea[0] := F_iecSetSCS( memarea[0], 0, eIEC870_SCS_ON );
memarea[0] := F_iecSetSCS( memarea[0], 1, eIEC870_SCS_ON );
memarea[0] := F_iecSetSCS( memarea[0], 2, eIEC870_SCS_ON );
memarea[0] := F_iecSetSCS( memarea[0], 3, eIEC870_SCS_ON );
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 ) |
See also