LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Really simple question, stop function and scroll bar won't work

Solved!
Go to solution

I was working on different parts of this VI separately, when I put them together the scroll bar and stop button stopped working. 

 

In the individual VI both are in the while loop. In the final one I was one scroll bar and one stop button to apply to all 5 while loops.

 

I tried taking the scroll bar in and out of the first loop to attach it to the rest but it still won't work.

 

I'm sure that there is a really stupid simple answer but I've been playing with it for a while.

 

I attached the VI that I am working on as well at fake data (to test the color boxes).

 

Thanks!

 

 

Download All
0 Kudos
Message 1 of 4
(2,614 Views)
Solution
Accepted by topic author sofiakyle

You have a typical beginner problem due to incorrect understanding of dataflow. Run the code using execution highlighting and watch the diagram to see.

 

  1. Your stop button is outside any loop and thus will only be read by the code exactly once at the start of the program.
  2. Your scroll bar is read in the first loop. All other loops cannot start until the first loop has completed and since (1) is true, it will never happen if the boolean is false when the code starts.

Why do you have so much duplicate code? 95% of the loop code is the same and can be re-used. I am sure the entire thing could be written using 5% of the total code. Put everything in one loop, the iterate over the 2D array to get all the values. Don't forget to place a small wait inside the while loop.

Message 2 of 4
(2,605 Views)

I don't understand how I could do this. The code that in the while loop accepts only single numbers, when i change it to an array the booleans don't match up. Also the sink in the RGB to Color stops working with arrays. Would I have to change how to code works? Or can I alter the begining? If I'm using an array wouldn't it have to carry all the way through so that I could index it and apply each one to a different sensor?

 

Sorry I'm new Smiley Frustrated

 

Thanks!

0 Kudos
Message 3 of 4
(2,592 Views)

Actually nevermind! I got it,

 

Thanks! 🙂 

0 Kudos
Message 4 of 4
(2,582 Views)