CANFrame

Type: CANFrame

Script class for a Can Frame.

Properties

PropertyDescription
brs Flag indicating if the frame is has BRS (Bit Rate Switch) set.
cycleTime Cycle time for the frame (as identified by 'frame.key'), in seconds.
dataHex Get/Set the data of the frame as a hexadecimal string, with bytes separated by spaces (e.g. "01 02 03 04 05 06 07 08"). The spaces are optional when setting the value, so "0102030405060708" is also valid.
extended Flag indicating if the frame is extended (true) or standard (false).
fd Flag indicating if the frame is CAN-FD (EDL)
id Get/Set the ID of the frame.
key Get a key value suitable for use in a map or set, based on the frame ID and flags. Actual bit layout is subject to change between application versions.
length Length of the frame in bytes. This is the number of data bytes in the frame, not including the ID or CRC.
rtr Flag indicating if the frame is has RTR (Remote Transmission Request) set.

Methods

MethodDescription
frame[index] Get / Set the data byte at the given index in the frame.
getSignalFloatBE(start_bit, length) Get the value of a big-endian (Motorola) signal in the frame as a float, given the start bit and length in bits.
getSignalFloatLE(start_bit, length) Get the value of a little-endian (Intel) signal in the frame as a float, given the start bit and length in bits.
getSignalIntBE(start_bit, length) Get the value of a big-endian (Motorola) signal in the frame as a signed integer, given the start bit and length in bits.
getSignalIntLE(start_bit, length) Get the value of a little-endian (Intel) signal in the frame as a signed integer, given the start bit and length in bits.
getSignalUIntBE(start_bit, length) Get the value of a big-endian (Motorola) signal in the frame as an unsigned integer, given the start bit and length in bits.
getSignalUIntLE(start_bit, length) Get the value of a little-endian (Intel) signal in the frame as an unsigned integer, given the start bit and length in bits.
setExtID(id) Set the ID of the frame to an extended (29-bit) ID.
setFDExtID(id) Set the ID of the frame to a CAN-FD extended (29-bit) ID.
setFDStdID(id) Set the ID of the frame to a CAN-FD standard (11-bit) ID.
setSignalFloatBE(start_bit, length, value) Set the value of a big-endian (Motorola) signal in the frame as a float, given the start bit and length in bits.
setSignalFloatLE(start_bit, length, value) Set the value of a little-endian (Intel) signal in the frame as a float, given the start bit and length in bits.
setSignalIntBE(start_bit, length, value) Set the value of a big-endian (Motorola) signal in the frame as a signed integer, given the start bit and length in bits.
setSignalIntLE(start_bit, length, value) Set the value of a little-endian (Intel) signal in the frame as a signed integer, given the start bit and length in bits.
setSignalUIntBE(start_bit, length, value) Set the value of a big-endian (Motorola) signal in the frame as an unsigned integer, given the start bit and length in bits.
setSignalUIntLE(start_bit, length, value) Set the value of a little-endian (Intel) signal in the frame as an unsigned integer, given the start bit and length in bits.
setStdID(id) Set the ID of the frame to a standard (11-bit) ID.