03-28-2019 01:19 AM
Dear all,
I have been developing a code to generate 2D image using intensity graph, where the user can control the scale of the graph by changing (user input X mm and user input Y mm).
I want the user to be able to control these inputs while the VI is running but it didn't work, I used event structure but its still not working, so what is the solution for such a problem?
( Please find attached the VI and SubVI)
03-28-2019 03:28 AM - edited 03-28-2019 03:31 AM
Hi Mariam,
THINK DATAFLOW!
This is the basic programming paradigm in LabVIEW - and you failed in obeying it…
When you want to read the X/Y controls more than once they should belong into a loop. Right now they will be read just once before the loop!
On your VI:
- Why is the data saving routine placed in the producer loop, using a local variable of the graph? Why not place it in the consumer loop, reading the data directly from that shift register?
- Why did you delete the label of the tab container? NEVER delete labels of controls/indicators!
- The subVI can be made more readable like this:
- Why don't you use a typedef'd cluster with your queue? Why do you use two different cluster constants with your queue?
- You don't need to unbundle the "Status" from your error wires just to OR them: boolean operations also can take error wires!
03-28-2019 03:48 AM
Hi, thank you for replying to me.
I tried to put the user input in a while loop but its still not working, the new values will not be updated in the graph unless I stopped the program.
03-28-2019 03:56 AM
03-28-2019 11:36 AM
The "X" and "Y" controls need to be inside the loop.
The loop will only read these tunnels once, at the first iteration.