ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

NI-XNET API for LabVIEW and C

XNET Convert (Byte Array to Frame LIN).vi

  • Updated2023-11-11
  • 3 minute(s) read
 XNET Convert (Byte Array to Frame LIN).vi

XNET Convert (Byte Array to Frame LIN).vi

Purpose

Converts between an NI-XNET byte array signal and LIN frame data.

Format

Inputs

session in is the session to read. This session is returned from the XNET Create Session VI. The session mode must be Conversion.
signal data contains a byte array representation of the signal value. The bytes will be transferred 1:1 to the signal in the frame.

If the session contains more than one signal, or the signal cannot be represented as a byte array, an error is returned.

The data provides the value for the next conversion of the signal.

error in is the error cluster input (refer to Error Handling).

Outputs

session out is the same as session in, provided for use with subsequent VIs.
frame data returns an array of LabVIEW clusters.

Each array element corresponds to a frame the session converted.

The elements of each cluster are specific to the LIN protocol. For more information, refer to Summary of the LIN Standard or the LIN protocol specification.

The cluster elements are:

identifier is the identifier received within the frame's header.

The identifier is a number from 0 to 63.

If the schedule entry (slot) is unconditional or sporadic, this identifies the payload data (LIN frame). If the schedule entry is event triggered, this identifies the schedule entry itself, and the protected ID contained in the first payload byte identifies the payload.

event slot? is not used. This element is false.
event ID is not used. This element is 0.
echo? is a Boolean value that determines whether the frame was an echo of a successful transmit (true), or received from the network (false). For conversion, it is always set to false.
type is the frame type (decimal value in parentheses):
  • LIN Data (64): The LIN data frame contains payload data. This is currently the only frame type for LIN.

For conversion, this is always set to false.

timestamp represents the absolute time when the XNET interface received the frame (end of frame), accurate to microseconds. The timestamp returned by the conversion is always invalid (0).
payload is the array of data bytes for the LIN data frame.

The array size indicates the received frame's payload length.

According to the LIN protocol, this payload is 0–8 bytes in length.

error out is the error cluster output (refer to Error Handling).

Log in to get a better experience