MEM.UnpackWord (FB prefix: memuw)

This function block of the CAA_Memory.library  will unpack the WORD “wValue“ and return the 2 bytes contained "byLowByte", "byHighByte" and the 16 bits "xBit0" .. "xBit15".

Input:

wValue

WORD

WORD to be unpacked

Output:

wLowByte

BYTE

Low byte of wValue

wHighByte

BYTE

High byte of wValue

xBit0

BOOL

Bit 0 of dwValue

xBit1

BOOL

Bit 1 of dwValue

xBit2

BOOL

Bit 2 of dwValue

xBit3

BOOL

Bit 3 of dwValue

xBit4

BOOL

Bit 4 of dwValue

xBit5

BOOL

Bit 5 of dwValue

xBit6

BOOL

Bit 6 of dwValue

xBit7

BOOL

Bit 7 of dwValue

xBit8

BOOL

Bit 8 of dwValue

xBit9

BOOL

Bit 9 of dwValue

xBit10

BOOL

Bit 10 of dwValue

xBit11

BOOL

Bit 11 of dwValue

xBit12

BOOL

Bit 12 of dwValue

xBit13

BOOL

Bit 13 of dwValue

xBit14

BOOL

Bit 14 of dwValue

xBit15

BOOL

Bit 15 of dwValue

Example:

wValue = 16#0102 = 2#00000001 00000010

->

byLowByte = 16#02

byHighByte = 16#01

xBit1,xBit8 = TRUE

remain bits = FALSE