04-01-2015 03:12 AM
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...
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!
Solved! Go to Solution.
04-01-2015 07:07 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-01-2015 07:26 AM
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
04-01-2015 07:45 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-01-2015 07:51 AM
Thank you very much!