LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

continuous addition of data to same chart

Hello community,

 

Very new user to LabVIEW and still getting the hang of things.  My issue is this:  I have a vi with four while loops to run a thermo cycling program, each temperature and incubation time is given its own loop.  Within each loop there is the ability to plot temperature data on a waveform chart, this gives me four charts on my front panel.  What I would really like is one waveform chart that takes the data from one loop continuously at a time and holds that data, then once the loop is broken the data from the second loop continues from where the first data left off.

 

Theoretical picture

 

 

                555555 777777

 

x-axis        Loop 1 Loop 2   and so and so on.  

 

I have found examples on how to stack, but I was hoping for a continuous type of chart.  

I have tried to gather the data from outputs of the shift registers for each while loop, but what I get is the data coming out all at once after the loop is broken.  Also this only works if I have one data set going into the waveform.

 

Any assistance would be fantastic and greatly appreciated,

Thank you,

Daniel

0 Kudos
Message 1 of 7
(2,716 Views)

Please attach your VI to your post.  It is really hard to figure out what you are doing just by your description.

0 Kudos
Message 2 of 7
(2,712 Views)

Thank you for your immediate interest!

 

I didnt attach the sub vi since they are not important with regards to my question.

 

To clarify, one will notice that the front panel has four similar structures.  I am trying to find a way for all of the data on each waveform chart to be displayed on a single waveform chart, so one for voltage, one for resistance and so on.  The idea is to have a pid control ramp up to a temperature after which the temperature will incubate for a certain time then the process will repeat to the next set temperature.

 

 As the program is now,  after one temperature incubates for a set time, the next temperature data moves to the subsequent chart. 

 

Hope this clarifies.

Thank you,

Daniel

0 Kudos
Message 3 of 7
(2,710 Views)

Waveform charts can do multiplots if you feed it a 2-D array.

For plots that you don't want to display data, you can feed it an NaN value, and nothing shows for that point.

 

Do you need the data for one graph to be overlapping so 0-10 for one plot in the first loop, then 0-10 for the 2nd plot in the 2nd loop?  Or is 0-10 for the first plot then 11-20 for the 2nd plot okay?  For that latter, you do something like I'm showing below.

 

But if you need the 2nd plot to retrace its steps, then you can't use a waveform chart since new data is always appended after old data.  (If there is a way to do it, someone please show me.)  You would have to use a waveform graph or XY graph where you store your values in an array in a shift register.  Constantly append to the array or replace elements, and build that into a data type that the waveform graph or XY graph takes.

 

Message 4 of 7
(2,705 Views)

You have an incredible amount of duplicate code. Instead of moving from while loop to while loop, use a single loop and a state machine architecture. Now you only need one chart for each parameter.

 

There are a lot of very odd constructs, such as the output of "tick count(ms)" wired to "loop time(s)"? That makes no sense.

 

 

Message 5 of 7
(2,701 Views)

Thank you both for your help.

 

I will get to coding this tomorrow when I get into my workstation.  I know the amount of duplicate code is absurd, but I was approaching this project by doing baby steps and simple as possible.  

 

I am actually unfamiliar with the architecture term Altenbach said.  Unfortunately I am not a proficient coder (as may be seen) and while loops seemed the straightforward route.  I will practice with the different structures though.

 

I will certainly let you know how things turn out and if I need more help.

 

Again, Thank you both,

I truly appreciate your time,

Daniel

0 Kudos
Message 6 of 7
(2,694 Views)

Hi Dan,

 

Here is a tutorial that should be helpful if you want more information about state machines as mentioned by Altenbach.

 

Application Design Patterns: State Machines

 

Good luck!

 

Kim W.

Applications Engineer
National Instruments
Message 7 of 7
(2,672 Views)