Frame Output Queued Mode
- Updated2025-10-10
- 3 minute(s) read
This mode provides a sequence of values for a single frame, for transmit using that frame's timing as specified in the database.
The output data is provided as an array of frame values, to be transmitted sequentially for the frame specified in the session.
This mode allows you to specify only one frame for the session. To transmit sequential values for multiple frames, use a different Frame Output Queued session for each frame or use the Frame Output Stream mode.
The frame values for this mode are stored in a queue, such that every value provided is transmitted.
For this mode, NI-XNET transmits each frame according to its properties in the database. Therefore, when you call nxWriteFrame, the number of payload bytes in each frame value must match that frame's Payload Length property. The other frame value elements are ignored, so you can leave them uninitialized. For CAN interfaces, if the number of payload bytes you write is smaller than the Payload Length configured in the database, the requested number of bytes transmits. If the number of payload bytes is larger than the Payload Length configured in the database, the queue is flushed and no frames transmit. For other interfaces, transmitting a number of payload bytes different than the frame's payload may cause unexpected results on the bus.
Examples
In this example network, frame C is a cyclic frame that transmits on the network once every 2.0 ms. Frame E is an event-driven frame that uses a transmit time (minimum interval) of 2.5 ms. For information about cyclic and event-driven frames, refer to Cyclic and Event Timing.
Each frame contains two signals, one in the first byte and another in the second byte.
The example uses CAN. The following figure shows a timeline of a frame transfer on the CAN network. Each frame contains its name (C or E), followed by the value of its two signals. The timeline begins with two calls to nxWriteFrame, one for frame C, followed immediately by another call for frame E.
The following figure shows the data provided to each call to nxWriteFrame. Each frame is displayed with CAN-specific elements. For information about the data returned from the write function, refer to Raw Frame Format. The first array shows data for the session with frame C. The second array shows data for the session with frame E.
Assuming the Auto Start? property uses the default of true, each session starts within the call to nxWriteFrame. Frame C transmits followed by frame E, both using the frame values from the first element (index 0 of each array).
According to the database, frame C transmits once every 2.0 ms, and frame E is limited to an event-driven transmit once every 2.5 ms.
At 2.0 ms in the timeline, the frame value with bytes 3, 4 is taken from index 1 of the frame C array and used for transmit of frame C.
When 2.5 ms have elapsed after acknowledgment of the previous transmit of frame E, the frame value with bytes 5, 8, 0, 0 is taken from index 1 of frame E array and used for transmit of frame E.
At 4.0 ms in the timeline, the frame value with bytes 5, 6 is taken from index 2 of the frame C array and used for transmit of frame C.
Because there are no more frame values for frame E, this frame no longer transmits. Frame E is event-driven, so new frame values are required for each transmit.
Because frame C is a cyclic frame, it transmits repeatedly. Although there are no more frame values for frame C, the previous frame value is used again at 6.0 ms in the timeline, and every 2.0 ms thereafter. If nxWriteFrame is called again, the new frame value is used.
Related Information
- Frame Output Stream Mode
A frame output stream session transmits an arbitrary sequence of frame values using a single stream. The frame values are not limited to a single frame—they can transmit any frame.
- Cyclic and Event Timing for Frames with
For all embedded network protocols that supports, the transmission of a specific frame can be either cyclic or event.
- CAN, FlexRay, and LIN
- Session Modes