LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

network queue.lvproj" example

Solved!
Go to solution

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

0 Kudos
Message 1 of 3
(2,950 Views)
Solution
Accepted by topic author Mark Levine

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

Message 2 of 3
(2,924 Views)

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

0 Kudos
Message 3 of 3
(2,916 Views)