Version:

Last Modified: February 7, 2018

Unpacks data to an unsigned or signed integer array.

This node unpacks *MN*-sized binary data of the form *b* _{ i } = {0,1}, to an unsigned or signed integer array a_n,

where;

*i* = 0…*MN*-1, and *M* denotes the number of bits per integer.

*n* = 0…*N*-1, and *N* denotes the size of the array.

The signed or unsigned integer data *a* _{ n }, *n* = 0…*N*-1, to be converted into binary data.

**Default: **empty

Number of binary data values that are packed into an integer.

If you set the **integer format** parameter to **Unsigned**, the maximum value is 31. If you set the **integer format** parameter to **Signed**, the maximum value is 32.

**Default: **1

The order in which the binary data stream is packed into integers.

Name | Description |
---|---|

MSB first | Data is packed with the most significant bit (MSB) first. |

LSB first | Data is packed with the least significant bit (LSB) first. |

**Default: ****MSB first**

Input integer format.

Name | Description |
---|---|

Unsigned | The entire number is packed as a positive integer. |

Signed | The most significant bit (MSB) determines the sign of the input integer. |

**Default: ****Unsigned**

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an **error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

**Default: **No error

The output binary data stream *b* _{ i } = {0,1}, *i* = 0…*MN*-1, that corresponds to the packed representation of the input binary data.

Where,

*i* = 0…*MN*-1, and *M* denotes the number of bits per integer.

*n* = 0…*N*-1, and *N* denotes the size of the array.

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

**error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

The relationship between the **input integers** and the **output bit stream** is given by the following equations:

*b* _{ i×M+j } = (*a* _{ i }»(*M*-1-*j*)) &1, *j* = 0…*M*-1, *i* = 0…*N* - 1 (**packed bit order** set to MSB first)

*b* _{ i×M+j } = (*a* _{ i }»*j*) &1, *j* = 0…*M* - 1, *i* = 0…*N* - 1 (**packed bit order** set to LSB first)

Where » denotes the operation of right shifting, and the operator & stands for the logical AND operation.

For example, assume the **input integers** array is the element [4], the **bits per integer** value is specified as 3, and **integer format** is set to **Unsigned**. If **packed bit order** is set to **MSB first**, the **output bit stream** is [1 0 0]. If the **packed bit order** is set to **LSB first**, the **output bit stream** is [0 0 1]. The signed negative numbers are stored as the 2's complement. Thus, if **integer format** is set to **Signed** and the **bits per integer** is set to 3, the **input integer** array is the element [-3], and the **packed bit order** is set to **MSB First** the **output bit stream** is [1 0 1].

**Where This Node Can Run: **

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application