LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

best practice updating plots ?

Folks -

I'm looking for best practice advice, better yet point-me-to-the-FAQ.  What's the one-true-Labview-way to keep a stacked plot of a waveform chart updated ?  I've got a main loop consisting of a flat sequence, the first two frames of which  which may be updating either of two 1-D arrays. There is  a time axis common to both.  I need both plotted soon (1-2 sec) after the update happens. RIght now, the three arrays are just shared variables , written in the subvis , while the plot is outside the flat sequence , inside the Until-stop. I put the three together into a waveform, but I'm not at all sure this is good practice . Advice ?

 

thanks

Alex

 

0 Kudos
Message 1 of 3
(2,470 Views)

Your code makes absolutely no sense.

 

  • Whatever you are doing to the chart data does NOT create multiple traces, you create a single waveform, but writing the y data twice, the lower set simply overwriting the data wired higher up.
  • Never hide an event structure inside a long sequence. If you would press the "commit" button during a time where the code is elsewehere, you might lock up the front panel forever.
  • What is the point for all these network shared variables? What else needs to access those? Any other remote code?
  • ...

 

All your subVIs are missing and I don't have your DAQ hardware. There is no way to really see what else is going on.

 

In any case, I recommend to rearchitect this entire thing as a plain state machine. One outer loop. One case structure, and each frame a state of a single case structure. Now you only need once instance of each variable.

0 Kudos
Message 2 of 3
(2,451 Views)

Thanks 10^6 . I am confused but have a hardware blockage to events (6133) , and can't find coherent guidance from NI on the one true path to Labview goodness, only asking stupid questions.

 

  • Whatever you are doing to the chart data does NOT create multiple traces, you create a single waveform, but writing the y data twice, the lower set simply overwriting the data wired higher up.

Ahh, thanks. Tried to find documents on how to build a waveform of multiple plots. the NI examples I've found don't have time axes.  I can't find one summary document about plots, so have to try things until they work. XY charts did but Could not reliably update. Tryng to 

 

  • Never hide an event structure inside a long sequence. If you would press the "commit" button during a time where the code is elsewehere, you might lock up the front panel forever.

I was afraid of that , intended on disabling the commit button except when needed (second frame) .  

 Among my problems are : in a 2 minute period, I wait for a switch signal external to me. That must start a sequence of waiting for another switch to close and checking a file frequently for updates. if the operator likes that new file, then commit (copy to another SV array). The second signal is my cue to set up and arm a few usb and pci digitizers. then about 30 sec of things happen in a sequence. If I could get events out of the 6133, a state machine would be possible, but NI says no, gotta poll.

 

  • What is the point for all these network shared variables? 

Bind variables from subvi's  to indicators.

 

  • What else needs to access those? Any other remote code?

A few are actual Network SV from elsewhere, or are local copies I make and then need on indicators.

 

 

  • In any case, I recommend to rearchitect this entire thing as a plain state machine. One outer loop. One case structure, and each frame a state of a single case structure. Now you only need once instance of each variable.

Yeah, that was the plan until I found out that 6133 doesn't support events. Need to try harder to re-arrange .

 

thanks again.

 

 

 

0 Kudos
Message 3 of 3
(2,431 Views)