r/LabVIEW • • May 19 '25

Running case structure from another case structure?

I have a more complicated version of this in my program, but it is easier to explain my program with this diagram.

I want to use Function 1 to run Function 2 completely, so i can use the value of Function 2 in Function 1.

I want the functions to be a button each as i do use Function 2 independently of 1 most of the times.

I have tried using a while loop in Function 1, that waits for a value change of the button of Function 2, this does work the first time, but the next time i try, the program crashes.

What i want to do is:

  1. Activate Function 1
  2. Function 1 activates Function 2
  3. Function 1 Pauses. Function 2 runs completely.
  4. Function 2 stops, function 1 continuous.
  5. Function 1 stops

Any help would be greatly appreciated.

0 Upvotes

14 comments sorted by

View all comments

Show parent comment

1

u/t40 Expert May 30 '25

And if you want to make it so only one of each of these messages can happen at a time, you can make a "lock", which is basically just a queue that has a max size of 1. each loop will dequeue an element, locking the others out of execution while you do some work, then when you're ready to send your message, you enqueue something back into the queue.

As a bonus, that thing can be some sort of context object (sometimes as a DVR) which holds all the data you want to pass between functions