LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Trouble displaying multiple while loop data in one box an graph

All:
 
I've developed a VI program that steps sequentially from one while loop to the next. In each while loop, I read the output of a single moisture analyzer from my CFP using a the fieldpoint IO express. THis value is displayed as well as graphed. I also use this value in a process control loop inside the while loop.
 
My question: How can I use 1 display to read the information from the while loops at each step. AT present, I have 4 displays stacked under neath each other, and one activates while the others deactivate as you progress through the steps. This also means that each dispaly box has it's own graph, and therefore, I have to have pages of individual graphs. Ulitmately, I would like to display all of the data on one continuous chart.
 
WHen I've tried moving the displays outside of the while loops, they do not update until the loop ends. Also, if I wire multiple fieldpoint express IO's to the display, the program errors out with a data direction problem.
 
Solving this problem will halp me solve the 11 pressure sensor readings issue as well.
 
At some point this I would like to write this data to a file as well, but one dragon slaying at a time.
 
Any help would be appreciated. I would post the VI, but it looks disasterous.....functional, but ugly.
 
Thanks
Sig.
0 Kudos
Message 1 of 5
(2,870 Views)
Actually, here is a snap shot of one of the while loops, simply imagine these linked to each other, each having identical Fieldpoint express IO readouts.
0 Kudos
Message 2 of 5
(2,865 Views)
The ugly solution would be to write to a local variables of the graph in all locations (-1). (This breaks dataflow and can possibly cause race conditions. It also forces extra data copies in memory)
 
A better solution would be to redesign your application from ground up as a state machine using only a single loop. Inside the loop you have a case structure, each case containing the code unique to the current state. Shared code is outside the case structure. Since the graph terminal is shared between states, place it to the right of the case structure so it gets data from all cases. Search for "state machine" here in the forum and in the example finder for some ideas.
0 Kudos
Message 3 of 5
(2,860 Views)

Altenbach:

 

Thanks for the great advice, I tried a few simulations in the state machine, it seems like it will work. Data passes from the register into the next state OK.  The hang up is the linearity that I need in the program for process protection. Is it possible to only let the user to go in one direction, for instance, from state 1 to 2 to 3 and not allow them to back up, skip setps or cycle through again?  I haven't been able to figure a way to prevent them from going backwards on the state or jumping from step one to step 3. All else seems to work right. To truly expose my ignorance, can I change to state cases to indifivual button clicks on the pront panel?

Thanks again.

Sig. 

0 Kudos
Message 4 of 5
(2,846 Views)
You can have the state machine running under full program control. You can also validate user actions to make sure the don't conflict with required execution order. For example, if state 0 ends, force state 1, if that ends, force state 2, etc.
0 Kudos
Message 5 of 5
(2,840 Views)