LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read the contents of a table and then stop the VI when finished? Stopping a Queue automatically

I have my vi reading the contents of the table. And then parsing the table out. But what I can't seem to figure out is how to stop the VI automatically when the end of the table data is reached. I wanted this done with a Queue so you could stop the Vi in the middle of the table if needed.

How do I stop the VI after the table end is reached.

0 Kudos
Message 1 of 8
(648 Views)

A VI stops once all structures have completed. A normal program should run when opened and close when done (state machine) because edit mode is for editing.

 

I am not sure why you are jumping through all these flaming loop with queues and such.

 

Most of your code is just plain silly and I recommend to start with a few basic tutorials:

 

  • A "One iteration" FOR loop is just a glorified sequence frame
  • Index array is resizable, so why would you branch the wire outside the loop and use two index array nodes?
  • etc etc.

 

0 Kudos
Message 2 of 8
(602 Views)

Maybe all you really need is the following:

 

altenbach_0-1694794718221.png

 

0 Kudos
Message 3 of 8
(599 Views)

Well gee Thanks 

0 Kudos
Message 4 of 8
(592 Views)

Maybe I have never used a Queue before and wanted to learn how they work.

0 Kudos
Message 5 of 8
(587 Views)

Well, you can enqueue the table, but if you then stop the lower loop after processing it, the upper loop continues to run until you press stop. At the same time you could never enqueue another table because the lower loop cannot be restarted once it exists.

 

Of you want to use a queue:

 

  • define the queue as 2D array of strings )a simple diagram constant is sufficient!)
  • enqueue the table, not a local variable of it!
  • etc.
  • v

 

0 Kudos
Message 6 of 8
(583 Views)

Thank you I learned something. Very helpful.

0 Kudos
Message 7 of 8
(576 Views)

Here's how it could look like with the queue.

 

altenbach_0-1694796302495.png

 

(Of course making the lower loop interruptible would require slightly more code.)

0 Kudos
Message 8 of 8
(570 Views)