unpack

Unpack signal data from message

Syntax

value = unpack(message, startbit, signalsize, byteorder, datatype)

Description

value = unpack(message, startbit, signalsize, byteorder, datatype) takes a set of input parameters to unpack the signal value from the message and returns the value as output.

Input Arguments

message

The CAN message structure that you specify for the signal to be unpacked from.

startbit

The signal's starting bit in the data. This is the least significant bit position in the signal data. Accepted values for starbit are from 0 through 63.

signalsize

The length of the signal in bits. Accepted values for signalsize are from 1 through 64.

byteorder

The signal binary or binblock format. Accepted values are LittleEndian and BigEndian.

datatype

The data type that you want to get the unpacked value in.

Output Arguments

value

The value of the message that you specify to be unpacked.

Examples

value = unpack(message, 0, 16, 'LittleEndian', 'int16')
Was this topic helpful?