FUNCTION "ByteOfDWord" : Byte { S7_Optimized_Access := 'FALSE' } VERSION : 0.1 VAR_INPUT I_In : DWord; // Eingangs-DWORD I_N : Int; // Byte-Nr END_VAR BEGIN (*################################################################################################# Copyright (c) Fondium Singen GmbH ### Änderungshistorie ### Datum: Version: Bearbeiter: Beschreibung: 04.03.2021 0.0 St. Maier Neuerstellung #################################################################################################*) (*################################################################################################# Beschreibung: Der Funktion zerlegt ein Byte(I_In) in seine einzelnen Bits (O_B0 .. O_B7) #################################################################################################*) #ByteOfDWord := DWORD_TO_BYTE(SHR(IN := #I_In, N := WORD_TO_INT(SHL(IN := INT_TO_WORD(#I_N), N := 3)))); END_FUNCTION