UnpackDWord (FB)¶
FUNCTION_BLOCK UnpackDWord
Function block unpacks “dwValue” and returns the two contained “wLowWord”, “wHighWord”, the 4 contained bytes “byLLByte” .. “byHHByte” and the 32 bits “xBit0” .. “xBit31”.
Prefix: “memudw”.
Example:
dwValue = 16#01020304 = 2#00000001 00000010 00000011 00000100
->
byLowWord = 16#0304
byHighWord = 16#0102
byLLByte = 16#04
byLHByte = 16#03
byHLByte = 16#02
byHHByte = 16#01
xBit2, xBit8, xBit9, xBit17 and xBit24 = TRUE
remaining bits = FALSE
- InOut:
Scope
Name
Type
Comment
Input
dwValueDWORDDWORD to analyse
Output
wLowWordWORDlow word of dwValue
wHighWordWORDhigh word of dwValue
byLLByteBYTEbyte LL of dwValue
byLHByteBYTEbyte LH of dwValue
byHLByteBYTEbyte HL of dwValue
byHHByteBYTEbyte HH of dwValue
xBit0BOOLBit 0 of dwValue
xBit1BOOLBit 1 of dwValue
xBit2BOOLBit 2 of dwValue
xBit3BOOLBit 3 of dwValue
xBit4BOOLBit 4 of dwValue
xBit5BOOLBit 5 of dwValue
xBit6BOOLBit 6 of dwValue
xBit7BOOLBit 7 of dwValue
xBit8BOOLBit 8 of dwValue
xBit9BOOLBit 9 of dwValue
xBit10BOOLBit 10 of dwValue
xBit11BOOLBit 11 of dwValue
xBit12BOOLBit 12 of dwValue
xBit13BOOLBit 13 of dwValue
xBit14BOOLBit 14 of dwValue
xBit15BOOLBit 15 of dwValue
xBit16BOOLBit 16 of dwValue
xBit17BOOLBit 17 of dwValue
xBit18BOOLBit 18 of dwValue
xBit19BOOLBit 19 of dwValue
xBit20BOOLBit 20 of dwValue
xBit21BOOLBit 21 of dwValue
xBit22BOOLBit 22 of dwValue
xBit23BOOLBit 23 of dwValue
xBit24BOOLBit 24 of dwValue
xBit25BOOLBit 25 of dwValue
xBit26BOOLBit 26 of dwValue
xBit27BOOLBit 27 of dwValue
xBit28BOOLBit 28 of dwValue
xBit29BOOLBit 29 of dwValue
xBit30BOOLBit 30 of dwValue
xBit31BOOLBit 31 of dwValue