10-16-2008 04:45 PM
I have 1 main VI which calls several Sub VIs in sequential order. The problem I am experiencing is that the real-time data created by a sub VI is not being displayed in the Main VI UNTIL the sub VI ends.
The sub VI: In a While Loop, a stepper motor is run either until an end position or threshold load has been reached. The NI MID-7604 motor drive and NI 7340 motion controller are being used for both motion of the stepper and data aquisition of the load cell. The current stepper motor position and load cell value are returned continously until the While Loop ends. I have connected the variables corresponding to the position and load from within the While Loop, as well as created global variables that are both within and out of the While Loop. Once the program has ended, a boolean becomes true, which is used by the main program to move on.
Main VI: The main program consistes of sequential frames. In the frame devoted to the sub VI above, The sub VI is called with 4 inputs and 3 outputs (true/false finished condition, and the position and load parameters). There is also a while loop containing the two charts corresponding to position and load, as well as the global variables (connected to charts as well). This is just an attempt to see what will work, obviously I only want 1 set of graphs. The condition for the while loop is the true/false condition outputed by the sub VI, and I know that the condition is false prior to the sequence frame.
In the Main VI I have tried putting the global variables in a While Loop, out of a While Loop, both the global variables and the sub VI in a While Loop, and placing the globals outside of the sequence frame. The same goes for the non-global variables that are wired to the sub VI's connectors. It appears as though within the sequence frame, the while loop containing the desired graphs is not begun until the sub VI ends (i've added a debugging counter and it never increments).
If nothing is in a While loop, just the last data points are graphed once the sub VI ends. If there is a while loop nothing is graphed.
If you have any suggestions I would greatly appreciate it.
Solved! Go to Solution.
10-17-2008 03:37 AM
Hi,
this is a very basic question about the principles of data flow in LabVIEW. I suggest to ask this question in the LabVIEW forums. You will get good answers and suggestions there. I also suggest that you post your vi there, as this makes things much clearer than describing everything with words.
Thanks,
Jochen