LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Appending Data to tables and graphs

I'm trying to figure out how to append data that's collected to the table and xy graph.  To get the initial data the program goes through a while loop with shift registers (it's a massive program) once it's finishes collecting the data and graphing it, the next time say after I change the sample and tell it to restart collecting data it clears the table and graph.  Is there a way to just append the data?  Currently I have to copy the data out of the table and put it into an excel spread sheet.  I'm collecting data from 8 different sensors, so it does take some time.  I know there's a VI I could use, but I'm still new at labview and it's really not my primary function.  I'm also pretty sure the way I currently have the program set up to collect data from all 8 sensors could have been made neater, but I was in a hurry and do plan to clean it up later.

 

 

0 Kudos
Message 1 of 10
(4,347 Views)

Can u show some code?  it's impossible to "debug" words.

0 Kudos
Message 2 of 10
(4,346 Views)

Here's part of the code, sorry it's not very neat.  I've circled the area of interest.  Thanks

0 Kudos
Message 3 of 10
(4,329 Views)

Store the data in a shift register (or a file if needed) and append the new data

append.png

0 Kudos
Message 4 of 10
(4,304 Views)

Thanks,  I've only tried the top section, but it didn't quite work, so I have a few questions. 

 

Does this for loop exist inside the current case structure? 

The number for the loops I'm assuming that this is the number of times I wish to append the data so I could make that I number on the front page that the user inputs?

I'm assuming that the "sensor 1" and "2d string array" are just my data strings and that I bring them into the for loop and remove the indexing for them (i.e. they aren't the switch loops). 

The actual switches what is the control for them?  Or can I just have it like you show it. 

 

I'm really not much of a labview person.

 

 

 

0 Kudos
Message 5 of 10
(4,290 Views)

Serena,

 

The example code I provided is meant as a demonstration of how it can be done. You'll have to integrate it into you own code.

The idea is to use a shift register which holds all the data and append the newly acquired data to it.

 

I added the outer for loop and the timing function to allow you to run the code and see what happens (drag the snippet into an empty block diagram and run it).

 

You don't need the extra for loop. In your application, you need to create the shift registers on your own while loop used to collect data ("switch" loops, I guess, that big one in the pictureSmiley Wink).

The small for loop (100), is what I used to generate random data, to simulate your measurements. You don't need that either.
Replace the small for loop with your own data arrays. The same goes for the "sensor 1" and "2D string array" controls.

 

The lower shift register works the same as the upper, only difference is that you need to unbundle the XY-data before appending the new data and then bundle it again. An other option is to store the X- and Y-arrays in two separate shift registers and only bundle them to create the graph.

 

Hope this helps,

 

PJ

0 Kudos
Message 6 of 10
(4,269 Views)

I think my problem may be that I'm already appending the data in a shift register.  I actually need to move the first group of appended data out of the shift register (I can't seem to get it out) and then when I restart the cycle (this is where I loose the first appended data) be apple to append the second set of data.  I tried making a secondary shift register that encompassed the initial shift register, but I couldn't get the data generated in the first shift register out of it.

0 Kudos
Message 7 of 10
(4,252 Views)

What do you mean by "getting the first group of data out of the shift register" ?

 

Do you have a loop with shift register inside another loop and want to pass data from the inner shift register into the outer loop's shift register?

 

 

0 Kudos
Message 8 of 10
(4,237 Views)

Yes something like that.

0 Kudos
Message 9 of 10
(4,232 Views)

append2.png

0 Kudos
Message 10 of 10
(4,225 Views)