From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Queue size for XNET Write Signal Waveform

Solved!
Go to solution

Hello,

 

I'm trying to use XNET librairy to play a predefined waveform on an output signal. I'm working with LabVIEW 2014 SP1, XNET 14.5 on a W7 Pro 32 bits operating system. I use a NI PCI-8512 card. It's my first application using xnet library.

 

In my test application, I give to user the possibility to define the waveform to play. The total time and the sample frequency are settable. The output CAN signal is cyclic, with a cycle time of 0.01s (10Hz). I chose to use same frequency for sample my waveform and the CAN writing.

 

I've difficulties to work with the queue size. In this example, that's good but I don't really why. I've tested different values of Queue size and 100000 seems to be good until 60sec. But for longer times (about 5 minutes), this method is not good...

 

xnet.png

 

What is the good way to work in this mode, and how to use efficiently the queue size property? The information and the example in the NI-XNET Hardware and Software Help are not very probant...

 

Thanks per advance!

Francis M
0 Kudos
Message 1 of 5
(6,457 Views)
Solution
Accepted by topic author Cisco

You can add more items to the end of the Queue, before the queue empties.  So if you wan to write 10,000 items, and your buffer is only 1000 items, then wait, and monitor the number of messages that remain in the buffer and once it is less than say 100 add another 900.

 

I've used this method for flashing over CAN and LIN.  I needed a way to put down specific frames at specified times, and not repeat a frame link single point would do (that might write the same byte twice which would be bad)  I could have done stream and used software timing, but a better solution was to use queued, and add more frames to the end of the queue to try to keep it as full as possible.

Message 2 of 5
(6,449 Views)

Thank you for the answer. So I understand I have to put my XNET Write vi into a while loop, and use property nodes to manage the queue. Is it compatible with usage of XNET Wait (Transmit complete) vi? Do you have a little example that I could in my case?

 

Thank you again

Francis M
0 Kudos
Message 3 of 5
(6,447 Views)

Sounds like you have the concept.  I've never done this with signals, only frames, but I assume there is a queued option.  You'll want to read the help, or just try it and see if it works.  Attached is an example that does not run which demonstrates something similar to what I've done in the past.  Basically fill the buffer, wait a little, then add more frames to fill it again.  Repeat until there are no more frames to add to the buffer.

Message 4 of 5
(6,445 Views)

Thank you very much!

Francis M
0 Kudos
Message 5 of 5
(6,442 Views)