11-02-2011 09:27 AM
There is an example of queuing "network queue.lvproj" in 2011 that I believe is in error.
It shows two TCP Clients working off the same queue implying they both get the same data to work off.
I believe the code in this example works because the queue depth is one and both clients simultaneously
access the queue which also indicates that the queue isn't locked when a process is accessing/dequeuing.
Meanwhile the enclosed example "LabVIEW Queuing.llb" makes more sense since a separate queue is opened for each client.
If one of you smart people can set me straight on this I'd appreciate it.
Thanks,
Mark
Solved! Go to Solution.
11-03-2011 02:23 PM
Hey Mark,
While the network queue.lvproj appears to be sending the same data to both the receivers, the queue is actually accessed at slightly different times by the two clients. You can observe this behavior by placing a wait VI in the server while-loop and wiring in a constant (I used 1000ms).This will cause an element to be queued every second (if 1000ms is used). You can then see the lag between the client indicators as they access the queue at different times. This is due to the fact that the queue is only having one element added to it every second while the dequeuing does not have a time restraint. They are indeed working from the same queue but they are not encountering identical data, rather each of them dequeues approximately half of the elements that enter the queue.
Depending on the application, it may be desireable to have this behavior or the behavior shown by your VIs.
Hope this helps,
Luke W
11-03-2011 04:06 PM
Luke,
Thanks for the explanation. I agree.
Just pointing out that the example provided is somewhat confusing to someone trying to get familiar with queues. Maybe it's just me.
Mark