06-24-2014 03:01 PM
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
Solved! Go to Solution.
06-24-2014 03:48 PM
Attach your VI that does the saving and loading of the data.
06-24-2014 04:06 PM
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
06-24-2014 04:36 PM
Based on the screenshot, I'm going to guess race condition.
Why are you using so many property nodes?
06-24-2014 05:23 PM
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.
06-25-2014 11:05 AM
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.
06-25-2014 12:23 PM
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
06-25-2014 12:40 PM
@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.
06-25-2014 12:58 PM
06-25-2014 01:00 PM
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...