NI-XNET API for LabVIEW and C

XNET Convert (Frame LIN to Byte Array).vi

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

XNET Convert (Frame LIN to Byte Array).vi

Purpose

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

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.
frame data provides the array of LabVIEW clusters.

Each array element corresponds to a frame value to convert.

The data you write is converted to signal values in the order you provide them. Only the latest signal value is returned.

For an example of how this data applies, refer to Conversion Mode.

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 not used for transmit. You must set this element to 0.

Each frame is identified based on the list of frames or signals provided for the session. The actual identifier to transmit is taken from the database (frame and schedule properties). Therefore, this identifier in the frame value is ignored.

event slot? is not used for transmit. You must set this element to false.

The currently running schedule is used to map the specific frame to a corresponding schedule entry (slot). The schedule entry itself determines whether the slot is unconditional, sporadic, or event triggered.

event ID is not used for transmit. You must set this element to 0.
echo? is not used for conversion. You must set this element 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.

This value is ignored for conversion.

timestamp represents absolute time using the LabVIEW absolute timestamp type. timestamp is not used for conversion. You must set this element to the default value, invalid (0).
payload is the array of data bytes for a LIN data frame.

The array size indicates the payload length of the frame value to transmit. According to the LIN protocol, the payload length range is 0–8.

For more information, refer to the section for each mode.

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.
signal data returns a byte array representation of the single signal in the conversion session.

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

The data returns the most recent converted value for each signal. If multiple frames for the signal are input, only signal data from the most recent frame is returned. Here, most recent is defined by the order of the frames in the frame data array, not the timestamp.

If no frame is input for the corresponding signals, the XNET Signal Default Value is returned.

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

Log in to get a better experience