LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why my graphs show peaks?

Solved!
Go to solution

I think that the direction of the feedback is different because of the location. But I'll check again.

 

Jose

0 Kudos
Message 11 of 25
(1,247 Views)

Your code looks OK as long as the Timestamp array is increasing at each iteration of the loop, it’s not clear how this is happening from your image. Add an array size for the timestamps and one of the Y data arrays and check that they agree.

 

When trying to debug your code use the probe tool and possibly add a time delay inside the loop so that you can watch what’s happening to the data on each iteration.

0 Kudos
Message 12 of 25
(1,239 Views)

Ok,

 

I think I know what's happening. My program usually updates every 15 seconds. It is possible to synchronize the Get Date/Time in Seconds function with the data acquisition? The data actually comes from different sources, but they all use the same Time Stamp Array. So I'm guessing that I should find a way to synch each, or is there a another way?

 

Thanks,

 

Jose

0 Kudos
Message 13 of 25
(1,225 Views)

Hello,

 

I tried a different method to plot the graphs. I'm not getting the peak, but there is a discrepancy between the time axis of the time stamp array. Attached are the images of the subvi that creates the graphs and the main vi which creates the time stamp array. If anyone can help me I would greatly appreciate it.

 

Thanks all,

 

Jose

0 Kudos
Message 14 of 25
(1,197 Views)
Solution
Accepted by topic author Jose_Perez

You seem to be getting your time stamps from looking at the file modified time. Why not read the time when you collect your data, convert to a double and save it along with your measured data to the file. You can extract the time (seconds since 1st Jan 1904) like you do your measured data and use that for the X axis in your plots.

 

You can also simplify the way you get your file data into the 3 plots, take a look at the image.

 

Ian

 

0 Kudos
Message 15 of 25
(1,178 Views)

Hello,

 

Thanks for the suggestion. I hope this doesn't make my VI too slow. I tried it with three graphs and it looks good so far. The attached image shows a good idea of how I did this. And looking at the results it's pretty promising. Although, I'm getting Error Code 4 on every execution. Do you why that might be?

 

Thanks for all the help.

 

Jose

0 Kudos
Message 16 of 25
(1,159 Views)

You can get details of the error codes here: http://zone.ni.com/reference/en-XX/help/371361H-01/lverror/misc_lv_error_codes/

 

Error code 4 is 'End of file encountered.'

0 Kudos
Message 17 of 25
(1,152 Views)

IanW,

 

Could that error be the cause of this resulting graph. I also attached a graph done with excel using the captured values. In the labview it seems that the graph duplicated or went back in time. The graph is done with the logged data as see in the code I send earlier. Using the logged data in an spreadsheet It can be seen that the data does not go back in time or duplicates. What might be causing the data to do this? Thanks.

 

Jose

Download All
0 Kudos
Message 18 of 25
(1,129 Views)

Looking at your Excel graph the data is taken over approximately 3 hours, whereas the LabVIEW chart shows time for 13 hours (taking you into the next day).

 

I notice that in your code you take two columns from your data array into a sub vi, this then outputs the timestamp array. I don’t know how your date and time are formatted, but I should check out the code in that vi. Is there a mismatch between 12 or 24 hr system?

 

Regards

Ian

Message 19 of 25
(1,117 Views)

IanW,

 

Thanks. I got it. It appears that my code for changing AM-PM to hours from 0-24 was not accurate. Now it is working very well.

 

Thanks for the help.

 

Jose

0 Kudos
Message 20 of 25
(1,095 Views)