CAN Timing Type and Session Mode

For each XNET Frame CAN:Timing Type property value, this topic describes how the frame behaves for each XNET session mode.

An input session receives the CAN data frame from the network, and an output session transmits the CAN data frame. The CAN data frame data (payload) is mapped to/from signal values.

You use CAN remote frames to request the associated CAN data frame from a remote ECU. When Timing Type is Cyclic Remote or Event Remote, an input session transmits the CAN remote frame, and an output session receives the CAN remote frame.

Cyclic Data

The data frame transmits in a cyclic (periodic) manner. The XNET Frame CAN:Transmit Time property defines the time between cycles.

Signal Input Single-Point, Signal Input Waveform, Signal Input XY, Frame Input Single-Point, and Frame Input Queued Modes

You specify the CAN frame (or its signals) when you create the session. When the CAN data frame is received, a subsequent call to the appropriate nxRead function returns its data. For information about how the data is represented for each mode, refer to Session Modes.

If the CAN remote frame is received, it is ignored (with no effect on the appropriate nxRead function).

Frame Input Stream Mode

You specify the CAN cluster when you create the session, but not the specific CAN frame. When the CAN data frame is received, a subsequent call to the appropriate nxRead function returns its data.

If the CAN remote frame is received, a subsequent call to the appropriate nxRead function for the stream returns it.

Signal Output Single-Point, Signal Output Waveform, Signal Output XY, Frame Output Single-Point, and Frame Output Queued Modes

You specify the CAN frame (or its signals) when you create the session. When you write data using the appropriate nxWrite function, the CAN data frame is transmitted onto the network. For information about how the data is represented for each mode, refer to Session Modes.

When the session and its associated interface are started, the first cycle occurs, and the CAN data frame transmits. After that first transmit, the CAN data frame transmits once every cycle, regardless of whether the appropriate nxWrite function is called. If no new data is available for transmit, the next cycle transmits using the previous CAN data frame (repeats the payload).

If you pass the CAN remote frame to the appropriate nxWrite function, it is ignored.

Frame Output Stream Mode

You specify the CAN cluster when you create the session, but not the specific CAN frame. When you write the CAN data frame using the nxWrite function, it is transmitted onto the network.

The stream I/O modes do not use the database-specified timing for frames. Therefore, CAN data and CAN remote frames transmit only when you pass them to the nxWrite function, and do not transmit cyclically afterward.

When using a stream output timing of immediate mode, data is transmitted onto the network as soon as possible.

When using a stream output timing of either Replay Exclusive or Replay Inclusive, data is transmitted onto the network based on the timestamps in the frame.

Event Data

The data frame transmits in an event-driven manner. For output sessions, the event is the appropriate nxWrite function. The XNET Frame CAN:Transmit Time property defines the minimum interval.

Signal Input Single-Point, Signal Input Waveform, Signal Input XY, Frame Input Single-Point, and Frame Input Queued Modes

The behavior is the same as Cyclic Data.

Frame Input Stream Mode

The behavior is the same as Cyclic Data. Because the stream I/O modes ignore the database-specified timing for all frames, you can read either CAN data or CAN remote frames.

Signal Output Single-Point, Signal Output Waveform, Signal Output XY, Frame Output Single-Point, and Frame Output Queued Modes

The behavior is the same as Cyclic Data, except that the CAN data frame does not continue to transmit cyclically after the data from the appropriate nxWrite function has transmitted. Because the database-specified timing for the frame is event based, after the CAN data frames for the appropriate nxWrite function have transmitted, the CAN data frame does not transmit again until a subsequent call to the appropriate nxWrite function.

Frame Output Stream Mode

The behavior is the same as Cyclic Data. Because the stream I/O modes ignore the database-specified timing for all frames, you can write either CAN data or CAN remote frames.

Cyclic Remote

The CAN remote frame transmits in a cyclic (periodic) manner, followed by the associated CAN data frame as a response.

Signal Input Single-Point, Signal Input Waveform, Signal Input XY, Frame Input Single-Point, and Frame Input Queued Modes

You specify the CAN frame (or its signals) when you create the session. When the CAN data frame is received, a subsequent call to the appropriate nxRead function returns its data. For information about how the data is represented for each mode, refer to Session Modes.

When the session and its associated interface are started, the first cycle occurs, and the CAN remote frame transmits. This CAN remote frame requests data from the remote ECU, which soon responds with the associated CAN data frame (same identifier). After that first transmit, the CAN remote frame transmits once every cycle. You do not call the appropriate nxWrite function for the session.

The CAN remote frame cyclic transmit is independent of the corresponding CAN data frame reception. When NI-XNET transmits a CAN remote frame, it transmits a CAN remote frame again CAN:Transmit Time later, even if no CAN data frame is received.

Frame Input Stream Mode

The behavior is the same as Cyclic Data. Because the stream I/O modes ignore the database-specified timing for all frames, you can read either CAN data or CAN remote frames.

Signal Output Single-Point, Signal Output Waveform, Signal Output XY, Frame Output Single-Point, and Frame Output Queued Modes

You specify the CAN frame (or its signals) when you create the session. When you write data using the appropriate nxWrite function, the CAN data frame is transmitted onto the network when the associated CAN remote frame is received (same identifier). For information about how the data is represented for each mode, refer to Session Modes.

Although the session receives the CAN remote frame, you do not call nxRead to read that frame. NI-XNET detects the received CAN remote frame, and immediately transmits the next CAN data frame. Your application uses the appropriate nxWrite function to provide the CAN data frames used for transmit. When you call the appropriate nxWrite function, the CAN data frame does not transmit immediately, but instead waits for the associated CAN remote frame to be received.

Frame Output Stream Modes

The behavior is the same as Cyclic Data. Because the stream I/O modes ignore the database-specified timing for all frames, you can write either CAN data or CAN remote frames.

Event Remote

The CAN remote frame transmits in an event-driven manner, followed by the associated CAN data frame as a response. For input sessions, the event is the appropriate nxWrite function.

Signal Input Single-Point, Signal Input Waveform, Signal Input XY, Frame Input Single-Point, and Frame Input Queued Modes

You specify the CAN frame (or its signals) when you create the session. When the CAN data frame is received, its data is returned from a subsequent call to the appropriate nxRead function. For information about how the data is represented for each mode, refer to Session Modes.

This CAN Timing Type and mode combination is somewhat advanced, in that you must call both the appropriate nxRead and nxWrite functions. You must call the appropriate nxWrite function to provide the event that triggers the CAN remote frame transmit. When you call the appropriate nxWrite function, the data is ignored, and one CAN remote frame transmits as soon as possible. Each call to the appropriate nxWrite function transmits only one CAN remote frame, even if you provide multiple signal or frame values. When the remote ECU receives the CAN remote frame, it responds with a CAN data frame, which is received and read using the appropriate nxRead function.

Frame Input Stream Modes

The behavior is the same as Cyclic Data. Because the stream I/O modes ignore the database-specified timing for all frames, you can read either CAN data or CAN remote frames.

Signal Output Single-Point, Signal Output Waveform, Signal Output XY, Frame Output Single-Point, and Frame Output Queued Modes

The behavior is the same as Cyclic Remote. When you write data using the appropriate nxWrite function, the CAN data frame transmits onto the network when the associated CAN remote frame is received (same identifier). Unlike Cyclic Data, the remote ECU sends the associated CAN remote frame in an event-driven manner, but the behavior is the same regarding the appropriate nxWrite function and the CAN data frame transmit.

Frame Output Stream Mode

The behavior is the same as Cyclic Data. Because the stream I/O modes ignore the database-specified timing for all frames, you can write either CAN data or CAN remote frames.