Download this file
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
FUNCTION_BLOCK FB_2BYTES_TO_WORD VAR_INPUT bLSB: BYTE; //Less significant Bytes bHSB: BYTE; //High significant Bytes END_VAR VAR_OUTPUT wOutput_value: WORD; VAR wShifted_word: WORD; wShifted_word.0 := bLSB.0; wShifted_word.1 := bLSB.1; wShifted_word.2 := bLSB.2; wShifted_word.3 := bLSB.3; wShifted_word.4 := bLSB.4; wShifted_word.5 := bLSB.5; wShifted_word.6 := bLSB.6; wShifted_word.7 := bLSB.7; wShifted_word.8 := bHSB.0; wShifted_word.9 := bHSB.1; wShifted_word.10 := bHSB.2; wShifted_word.11 := bHSB.3; wShifted_word.12 := bHSB.4; wShifted_word.13 := bHSB.5; wShifted_word.14 := bHSB.6; wShifted_word.15 := bHSB.7; wOutput_value := wShifted_word;