08-25-2014 10:41 AM
I am trying to use a queue to send data from my pulse train subVI to my main VI.
After my pulse train completes, I send a TRUE boolean via the 'Enqueue element' which goes to the 'Obtain Queue' and then to the Dequeue Element to acquire and log data.
I am not sure why the data is only sent the first time, and not consequentially.
I've tried the same with the Notifier to no awail. I am not sure if this is an issue in my SubVI or my main VI.
I am not sure if this is correct? Do I need to release the reference or something?
Thanks!
08-25-2014 10:47 AM
here is the pulse train. I would have figured that if I have this in the 'Cycle' message case, if I call it again, which it does successfully, I would be sending another TRUE boolean to my main VI, but it doesnt..
08-25-2014 11:07 AM
Your Dequeue Element is only ran once. That needs to be in a loop.
08-25-2014 11:10 AM
Thanks - I tried that in a while loop, also tried probing the queue prior to it - would this probe list all of the elements queue up?
If so, the additional elements never enter the queue....
08-25-2014 11:55 AM
@belopsky wrote:
Thanks - I tried that in a while loop, also tried probing the queue prior to it - would this probe list all of the elements queue up?
If so, the additional elements never enter the queue....
Probing the queue reference will not show the elements in the queue.
If you are sure you are not getting more elements in your queue, then it is a problem with your producer loop. Are you sure that loop isn't waiting for a message in order to do something that would then add an element to your queue?
08-25-2014 11:59 AM
I am sure it's not waiting for a message.
I created a message case solely to test the enqueue element function, probed the message queue, and see that the subVI is going through the various message cases.
How do I debug whether or not elements are being added to the queue?
Thank you
08-25-2014 01:58 PM
belopsky wrote:
How do I debug whether or not elements are being added to the queue?
Breakpoints at the Enqueue Element is the simple way since the code will stop when it hits a breakpoint. If it keeps stopping at the breakpoint, then you should be adding more elements to the queue. Also make sure there are no errors happening.
08-25-2014 08:49 PM
I hope this is just a gutted VI? Because if you usually code with sequence structures and no dataflow with error wires, then I can't even guess what might be your problem.