My problem is that second while loop is executed so many times, depending on the data lengt passed through queue. So dequeue element wont't work outside while loop, but if dequeue element is in while loop, each time while loop is suppose to executed (let sey 6 times) data from a new queue is used ( while loop execute once), so I am processing only one part of the data each time not the wholle "message". First while loop is time besed. It is important to me that while loop is executed multiple times and not time based. How can I sole this.
Solved! Go to Solution.
the dequeue has to be inside a loop, otherwise you will only get elements once.
I understand that queue is not working outside the loop, but how can I make my program work without queue, simply as posible. Sorry if it has been aswerewd but i didn't find solution.
Here is whole program, please ignore error wiring an lack of subVI's.
sorry can't open .. am still on 2016
if you'd like you could back save "File"->"Save for Previous Version"
from the looks of it you could do this all as a state machine in the first loop.
put all the logic from loop2 and 3 in the timeout case and wire some timeout value to the event structure.
the VISA write should be only triggered when you push one of your buttons, so wrap it with a case structure and wire a boolean coming from the event cases where you want to write.
you should find a way to get rid of the "Bytes at Port" and make use of a termination character instead.
First, dequeue in a while loop. Use a for loop auto indexed on the queue data array inside the while loop.
Alternately, this sounds like a great place to use a "Channel Wire"
Averna Automated Test Systems
you are welcome :cheers: