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 FlexRay).vi

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

XNET Convert (Byte Array to Frame FlexRay).vi

Purpose

Converts between an NI-XNET byte array signal and FlexRay 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 FlexRay protocol. For more information, refer to Summary of the FlexRay Standard or the FlexRay Protocol Specification.

The cluster elements are:

slot specifies the slot number within the FlexRay cycle.
cycle count specifies the cycle number.

The FlexRay cycle count increments from 0 to 63, then rolls over back to 0.

startup? is a Boolean value that specifies whether the frame is a startup frame (true) or not (false).
sync? is a Boolean value that specifies whether the frame is a sync frame (true) or not (false).
preamble? is a Boolean value that specifies the value of the payload preamble indicator in the frame header.

If the frame is in the static segment, preamble? being true indicates the presence of a network management vector at the beginning of the payload. The XNET Cluster FlexRay:Network Management Vector Length property specifies the number of bytes at the beginning.

If the frame is in the dynamic segment, preamble? being true indicates the presence of a message ID at the beginning of the payload. The message ID is always 2 bytes in length.

If preamble? is false, the payload does not contain a network management vector or a message ID.

chA is a Boolean value that specifies whether the frame was received on channel A (true) or not (false).
chB is a Boolean value that specifies whether the frame was received on channel B (true) or not (false).
echo? is a Boolean value that determines whether the frame was an echo of a successful transmit (true), or received from the network (false).
type is the frame type (decimal value in parentheses):
  • FlexRay Data (32): FlexRay data frame. The frame contains payload data. This is the most commonly used frame type for FlexRay. All elements in the frame are applicable.
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 FlexRay frames of type FlexRay Data or FlexRay Null.

The array size indicates the received frame value payload length.

According to the FlexRay protocol, this length range is 0–254.

The XNET Convert (Signal to Frame FlexRay) VI writes the FlexRay frame identification to the following fields:

  • slot
  • cycle count
  • chA/chB

In addition, the following fields are set to their database definition:

  • startup?
  • sync?
  • preamble?

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

Log in to get a better experience