UnpackWord (FB)¶
FUNCTION_BLOCK UnpackWord
Function block unpacks “wValue” and returns the 2 bytes contained “byLowByte” and “byHighByte” and the 16 bits “xBit0” .. “xBit15”.
Prefix: “memuw”.
Example:
wValue = 16#0102 = 2#00000001 00000010
->
byLowByte = 16#02
byHighByte = 16#01
xBit1, xBit8 = TRUE
remain bits = FALSE
- InOut:
Scope
Name
Type
Comment
Input
wValueWORDWORD to analyse
Output
byLowByteBYTElow byte of wValue
byHighByteBYTEhigh byte of wValue
xBit0BOOLBit 0 of wValue
xBit1BOOLBit 1 of wValue
xBit2BOOLBit 2 of wValue
xBit3BOOLBit 3 of wValue
xBit4BOOLBit 4 of wValue
xBit5BOOLBit 5 of wValue
xBit6BOOLBit 6 of wValue
xBit7BOOLBit 7 of wValue
xBit8BOOLBit 8 of wValue
xBit9BOOLBit 9 of wValue
xBit10BOOLBit 10 of wValue
xBit11BOOLBit 11 of wValue
xBit12BOOLBit 12 of wValue
xBit13BOOLBit 13 of wValue
xBit14BOOLBit 14 of wValue
xBit15BOOLBit 15 of wValue