For output sessions, queues store data passed to XNET Write and not yet transmitted onto the network. For input sessions, queues store data received from the network and not yet obtained using XNET Read. For most applications, the default queue sizes are sufficient. You can write to this property to override the default.
When you write (set) this property, you must do so prior to the first session start. You cannot set this property again after calling XNET Stop.
For frame I/O sessions, Queue Size is the number of bytes of frame data stored.
For standard CAN and LIN frame I/O sessions, each frame uses exactly 24 bytes. You can use this number to convert the Queue Size (in bytes) to/from the number of frame values.
For CAN FD and FlexRay frame I/O sessions, each frame value size can vary depending on the payload length. For more information, refer to Raw Frame Format.
For Signal I/O XY sessions, you can use signals from more than one frame. Within the implementation, each frame uses a dedicated queue. According to the formulas below, the default queue sizes can be different for each frame. If you read the default Queue Size property for a Signal Input XY session, the largest queue size is returned, so that a call to XNET Read of that size can empty all queues. If you read the default Queue Size property for a Signal Output XY session, the smallest queue size is returned, so that a call to XNET Write of that size can succeed when all queues are empty. If you write the Queue Size property for a Signal I/O XY session, that size is used for all frames, so you must ensure that it is sufficient for the frame with the fastest transmit time.
For Signal I/O Waveform sessions, you can use signals from more than one frame. Within the implementation, each frame uses a dedicated queue. The Queue Size property does not represent the memory in these queues, but rather the amount of time stored. The default queue allocations store Application Time worth of resampled signal values. If you read the default Queue Size property for a Signal I/O Waveform session, it returns Application Time multiplied by the time Resample Rate. If you write the Queue Size property for a Signal I/O Waveform session, that value is translated from a number of samples to a time, and that time is used to allocate memory for each queue.
For Single-Point sessions (signal or frame), this property is ignored. Single-Point sessions always use a value of 1 as the effective queue size.
Long Name: Queue Size
Class: XNET Session
You calculate the default queue size based on the following assumptions:
The following pseudo code describes the default queue size formula:
if (session is Signal I/O Waveform) Queue_Size = (Application_Time * Resample_Rate); else Queue_Size = (Application_Time / Frame_Time); if (Queue_Size < 64) Queue_Size = 64; if (session mode is Frame I/O) Queue_Size = Queue_Size * Frame_Size;
For Signal I/O Waveform sessions, the initial formula calculates the number of resampled values that occur within the Application Time. This is done by multiplying Application Time by the XNET Session Resample Rate property.
For all other session modes, the initial formula divides Application Time by Frame Time.
The minimum for this formula is 64. This minimum ensures that you can read or write at least 64 elements. If you need to read or write more elements for a slow frame, you can set the Queue Size property to a larger number than the default. If you set a large Queue Size, this may limit the maximum number of frames you can use in all sessions.
For Frame I/O sessions, this formula result is multiplied by each frame value size to obtain a queue size in bytes.
For Signal I/O sessions, this formula result is used directly for the queue size property to provide the number of signal values for the XNET Read VI or XNET Write VI. Within the Signal I/O session, the memory allocated for the queue incorporates frame sizes, because the signal values are mapped to/from frame values internally.
The LabVIEW target in which your application runs determines the Application Time:
This works under the assumption that for Windows, more memory is available for input queues, and you have limited control over the application timing. LabVIEW RT targets typically have less available memory, but your application has better control over application timing.
Frame Time is calculated differently for Frame I/O Stream sessions compared to other modes. For Frame I/O Stream, you access all frames in the network (cluster), so the Frame Time is related to the average bus load on your network. For other modes, you access specific frames only, so the Frame Time is obtained from database properties for those frames.
The Frame Time used for the default varies by session mode and protocol, as described below.
CAN, Frame I/O Stream:
FlexRay, Frame I/O Stream:
LIN, Frame I/O Stream:
CAN, Other Modes:
FlexRay, Other Modes:
LIN, Other Modes:
The following table lists example session configurations and the resulting default queue sizes.
|Session Configuration||Default Queue Size||Formula|
|Frame Input Stream, CAN, Windows||96000||(0.4 / 0.0001) = 4000; 4000 x 24 bytes|
|Frame Output Stream, CAN, Windows||96000||(0.4 / 0.0001) = 4000; 4000 x 24 bytes; output is always same as input|
|Frame Input Stream, FlexRay, Windows||480000||(0.4 / 0.00002) = 20000; 20000 x 24 bytes|
|Frame Input Stream, CAN, LabVIEW RT||24000||(0.1 / 0.0001) = 1000; 1000 x 24 bytes|
|Frame Input Stream, FlexRay, LabVIEW RT||120000||(0.1 / 0.00002) = 5000; 5000 x 24 bytes|
|Frame Input Queued, CAN, Transmit Time 0.0, Windows||1536||(0.4 / 0.05) = 8; Transmit Time 0 uses Frame Time 50 ms; use minimum of 64 frames (64 x 24)|
|Frame Input Queued, CAN, Transmit Time 0.0005, Windows||19200||(0.4 / 0.0005) = 800; 800 x 24 bytes|
|Frame Input Queued, CAN, Transmit Time 1.0 (1 s), Windows||1536||(0.4 / 1.0) = 0.4; use minimum of 64 frames (64 x 24)|
|Frame Input Queued, FlexRay, every 2 ms cycle, payload length 4, Windows||4800||(0.4 / 0.002) = 200; 200 x 24 bytes|
|Frame Input Queued, FlexRay, every 2 ms cycle, payload length 16, LabVIEW RT||2048||(0.1 / 0.002) = 50, use minimum of 64; payload length 16 requires 32 bytes; 64 x 32 bytes|
|Signal Input XY, two CAN frames, Transmit Time 0.0 and 0.0005, Windows||64 and 800 (read as 800)||(0.4 / 0.05) = 8, use minimum of 64; (0.4 / 0.0005) = 800; expressed as signal values|
|Signal Output XY, two CAN frames, Transmit Time 0.0 and 0.0005, Windows||64 and 800 (read as 64)||(0.4 / 0.05) = 8, use minimum of 64; (0.4 / 0.0005) = 800; expressed as signal values|
|Signal Output Waveform, two CAN frames, 1 ms and 400 ms, resample rate 1000 Hz, Windows||400||Memory allocation is 400 and 64 frames to provide 0.4 sec of storage, queue size represents number of samples, or (0.4 x 1000.0)|
Where This Property Is Available:
Desktop OS: Windows
FPGA: Not supported
Web Server: Not supported in VIs that run in a web application