LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data is distorted between saving and loading

Solved!
Go to solution

Hello,

 

I am having an issue saving and loading data back into my VI. My software allows the user to collect data from a DAQ that is then displayed on a graph for them to see. They can save that data, then load it back later to compare against current data. Here is the basic methodology:

1. Data is read into the program via a DAQ

2. Data is saved to a spreadsheet file from an array with the "save to spreadsheet file" VI

3. Data is loaded back  to the program with the "read from spreadsheet file" VI

4. Data is moved to the same graph is was originally shown on

 

 

However, when I save the data and reload it, my graph is slightly distorted. I noticed a few things:

1. The X values are slightly more for the loaded data vs. the same data before save/load (DECIMAL NUMBERS)

2. The Y values are not affected. (WHOLE NUMBERS)

3. The loaded data has more straight lines, meaning the same data point is used for consecutive X or Y values

 

attached is a screenshot of data on the graph - Red is native from that session, Green is loaded data.

attached is the excel export of that same graph.

 

Does anyone notice any interesting trend in this anomaly, or have any ideas about what I can check? My code does not change values, but only manipulates them. Please let me know if you need more information, I tried including as much as I could without writing an unneccessary book.

 

Thanks,

Joe

 

 

Download All
0 Kudos
Message 1 of 10
(3,120 Views)

Attach your VI that does the saving and loading of the data.

0 Kudos
Message 2 of 10
(3,081 Views)

RavensFan,

 

Thank you very much for your help. Unfortunately, we as engineers are limited on we are allowed to post to the forums. Attached are screenshots of the code in question.

 

Thanks

Joe

Download All
0 Kudos
Message 3 of 10
(3,069 Views)

Based on the screenshot, I'm going to guess race condition.

 

Why are you using so many property nodes?

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

Ok, but the big question is given the data that you are acquiring, is the data in the file correct? If it is the problem is with the loading. If not, it's with the saving.

 

Mike...

 

PS: I just looked at the excel file and the red and green are different datasets -- when the values shift higher or lower, they don't happen on the same row and they don't even have the same number of datapoints.


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 5 of 10
(3,033 Views)

Taki1999,

 

We have a very complex VI that does multiple calculations, which displays the seults on various indicators. The property nodes are gathering all those values in one place from all over the VI. Even if it was a race condition, what would explain the discrepancies in data? At least on the read side, it should be loading the entire array of data, as opposed to each data point at a time which would lead to a RC... Or I'm misinterpreting your conclusion.

 

mikeporter,

That is an excellent question! Right now, my DAQ is replaced with random number generators merged into a dynamic datastream, so it is difficult to tell what the correct data is. Hooking up the machine is a long way off.

0 Kudos
Message 6 of 10
(2,991 Views)
Solution
Accepted by topic author tidalwave62

For troubleshooting this kind of problem replace the random number generators with a simple signal which you can easily identify such as a linear ramp, the iteration count, or a low frequency sine wave. By selecting a signal which is suitable for your application you should be able to tell if the data is all being saved and in the correct order.

 

The use of property nodes for moving data around sounds like a disaster in the making.  Consider queues, user events, or functional global variables.

 

Lynn

Message 7 of 10
(2,978 Views)

@tidalwave62 wrote:

Taki1999,

 

We have a very complex VI that does multiple calculations, which displays the seults on various indicators. The property nodes are gathering all those values in one place from all over the VI. Even if it was a race condition, what would explain the discrepancies in data? At least on the read side, it should be loading the entire array of data, as opposed to each data point at a time which would lead to a RC... Or I'm misinterpreting your conclusion.


I don't think the data you're saving is the data you think you're saving. Depending on what's happening with those indicators, you may see values on the screen which differ from those that are packed into the array.

Property nodes for retrieving data from indicators is a bad idea.

 

My guess is that you are loading exactly what you wrote and that your problem is on the saving side.

Message 8 of 10
(2,972 Views)
I second Lynn's idea to get rid of the random number generator. Since you can simulate a DAQ device wire easily, I would recommend that.

0 Kudos
Message 9 of 10
(2,964 Views)

Thank you all for your help! I didn't even consider issues with the property nodes, and I will definitely change my sample signal to better match my real machine.

 

I have a lot to do now...

0 Kudos
Message 10 of 10
(2,959 Views)