05-15-2020 01:41 PM
Hello!
I have a code in LabVIEW that uses a matlab script to output a few graphs that are dependent on certain input controls in labVIEW. I wanted to modify the code so that as the program runs, the graphs change as the controls are changed. I started by putting the code in a while loop, but found that the graphs pop up indefinitely, so i will get hundreds of graphs until i stop the code.
Essentially I was wondering if there was a way to only proceed to the next iteration of the while loop if the controls on the front panel are changed. That way, a new set of graphs will pop up each time the controls are changed, and I won't need to keep stopping and starting the program.
I hope this makes sense but if there are any questions let me know! Thanks in advance!
Solved! Go to Solution.
05-15-2020 01:57 PM
If I understand correctly an event structure could help here. This will pause the while loop until a certain event is fired and registered. Look at the attached VI and see whether you can make something of this.
Feel free to ask further.
05-15-2020 02:14 PM
It typically helps if you attach your code, because there are millions of possibilities to do what you describe. Very ambiguous!
What else does the while loop do? Is there any defined timing? Is there a reason you need to use matlab? Seems like a gigantic detour to show a few graphs. Why can't you use LabVIEW graphs without popping anything at all?
05-15-2020 02:44 PM
Take a look at this answer Yddet gave me just today.
https://forums.ni.com/t5/LabVIEW/Change-input-controls-during-execution-of-a-loop/td-p/4050180
Looks very promising except I haven't figured out how to use it with my instrument handles and errors between states but I'm sure there is a way.
05-18-2020 08:56 AM
Thank you so much! This does exactly what I want!