07-28-2010 04:49 PM
Hello,
I am making separate queried to a database to retrieve analog and digital data over the same time period. The data were logged at 2 second intervals. I have verified that both result sets return the same number of values with the same t0 and dt. I then plot the analog values on an XY Graph and the digital values on a Digital Waveform Graph. I then use property nodes to sync the two graphs (left and right plot bounds, XScale.Range, and Cursor Position.X). After doing this, I can see that the datasets do not line up between the two graphs. The data on the Digital Waveform graph ends several seconds sooner than the analog data. The x scales of the graphs appear to match but the plots don't align in time.
Has anyone else observed this behavior? Is there any work-around?
Thank you,
Peter
07-29-2010 01:12 PM
Could you post a small smippet of code that reproduces this issue?
08-11-2010 12:19 PM
Sure. Sorry it took so long to build this. This is a minimal subset of the full application but it demonstrates the problem. Example datasets are stored as default values in front panel controls.
Run the main VI and click the Get Data button. Notice how the number of points are the same for digital and analog datasets. Change the tab control at the top to Values, then drag the right cursor in the bottom graph all the way to the right. Notice how the x-axis (time) value at the cursor is different for the two graphs.
This is LabVIEW 8.6.1
Thanks,
Peter
08-12-2010 09:34 AM
There is a much simpler way to synchronize these charts. Just use a stacked chart.
If you use a bundle function you can take two signals (almost data type) and wire them into a Waveform Chart together.
Then on the front panel right click on the chart and select Stack Plots
Since you only have 1 X axis now they are instrincly synched and will always write valules at the same time and update the UI together. You can skip all of the scale synching....
Since the data you are working with has lincked time stamps, the data will need to be matched, (make sure the samples are anyched and each itteration both would have the same number of samples.
The last allternative would be to strip the time stamp off of your data then build a new data structure, with the digital data, analog data and 1 set of matched time stamps. You can then plot this on an XY chart using the time stamp for the X axis for both of your other plots. Let me know if you have other questions.
08-18-2010 10:46 AM
Thank you for your response. I originally chose the format I did because I wanted to separate out each of the digital plots along the Y axis. Can this be done on an XY graph?
In the last part of your message I think you are implying that you found a mismatch in the timestamps between the two data sets. It that correct? If so, please tell me what I am missing! As far as I can tell, both datasets have the same T0, dT and the same number of points.
It seems like there is a difference in the way digital and XY charts display data. Or does it have something to do with the difference between the digital waveform datatype versus a bundled array?
Thank you,
Peter
08-19-2010 05:53 PM
I did not find any mismathces in your data, I just wanted to point out that was a possible casue. If your dT and T0 are the same you should be able to syncronize the data. I think this issue is mainly one of datatypes, figure out exactly how you want to take your raw data and build a data structure that will carry the timestamps and data.