LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a graph with memory

Hi everyone,

 

In the attached vi (xy_plot_problem_updated.vi) I am able to get 3 individual values x, y and z in an array, element 0 being x, element 1 being y and element 2 being z.
 
These three values come for every iteration. I would like to store all generated x values into one array and same with y and z so I can use the final arrays to generate the graph.

 

The outer while loop runs 30 times and I would like to record the 30 different values generated at index 0 in a separate array. I tried using a shift register, build array etc but its just replacing element 1 (of the new array) with the newest element generated (They are not getting accumulated).
 
I have encountered this problem while designing for a system which records 3 different readings for every 5 degree increase in temperature. I want to be alble to plot the accquired values against the current temperature. Hence, the outer while loop is actually a case statement which gets triggered everytime the temperature goes up by 5 degrees.
 
I have also attached the main VI too alongside (final.vi).
 
Any help appreciated!!
 
Thanks in advance!!!
Download All
0 Kudos
Message 1 of 7
(2,486 Views)

Build Array and Shift Registers work just fine for me.

 

 

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

How are you running final.vi? Are you using the Run Continuously button?  That button should not be used for routine operation of a VI.

 

The feedback node connected to elapsed time in the left while loop and the Output after indicator does not make sense for a top-level VI.

 

The code in the Formula node does not define output values for all possible cases. The formula node probably uses default values in those cases, but you have not documented that you want that.  Hmmmm... I just ran a little test. It seems the Formula node retains the last value of an output while it remains in memory. This is a little strange  as most LV functions generate a default output if the inputs do not define a value.  The documention does not specify this behavior.  I will have to think about that a while.

 

Lynn

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

Hi Lynn,

 

The final.vi is not the fully finished one. I will have tinker with it by running the actual tests using the equipment (although I have already ran these tests I have not completed the process).

 

But before that, I need to make sure the graph shows up properly. I am not really expert on Labview but I am good at general coding, thats why I used the formula node. Please let me know if there is a better way to do that.

 

Thanks!

Sanjay.

0 Kudos
Message 4 of 7
(2,459 Views)

Hi RavensFan,

 

I tried the solution you gave me and it seemed to work fine but my problem was different. I think I have finally found the right way to define the problem (Please see the attached vi).

 

The problem is that the outer while loop is actually a case statement which is triggered periodically. I have attached a new vi outlining the problem, this one has a case statement that is triggered by a square wave periadically. I would like to have the values to be accumulated in a environment like this.

 

Please help.

 

Thanks!

Sanjay.

0 Kudos
Message 5 of 7
(2,427 Views)

You don't have an outer while loop, an inner while loop, or a while loop anywhere.  So your question doesn't make any sense.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

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

Sanjay,

 

I agree with Ravens Fan that you could benefit from the tutorials.

 

Here is a VI which show some of the things we have been talking about.

 

Lynn

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