I have multiple timestamps at which instance I have data (say a 1 or 0). I want to make a single waveform out of these variable timestamps and the data associated with it.
background: I read Bus- Frame information and generate the timestamp based on the difference between 2 bus Frames.
Issue - the dt value cannot be same as sometimes the frame data can come at a difference of 10 ms or 30ms. Hence Timestamp for each data.
How do I get a waveform out of this data.
calculate the least common multpiple of your dt values. According to your description it should be 10ms.
Then create an Y array with a sample for each 10ms dt step: you need to interpolate in case there is a 30ms gap between samples…
Does NI offer any Solution to this as I believe I aint the first with this problem and this should be a common problem for digital Data.
I have the Soln u mentioned on my list of Workarounds but then it requires testing for all unforseen Scenarios as its data-Manipulation
there is a palette full of interpolation functions.
You can use them to interpolate your input data to a signal with evenly distributed (on the time scale) samples…
Would an XY Scatter plot help? Two arrays of data, x-array of timestamps, y-array of values. You can use any arrangement of timestamps that you please, the dt becomes irrelevant.
My bad - didn 't read the OP question fully. You need a waveform, not a cluster of two arrays.
in essence you have x-y pairs, from what you are describing. So this KB might help you (it is simply one possible implementation of GerdW's idea):
How Do I Convert XY Pairs to a Waveform? - National Instruments
The problem that you are facing here is that the waveform simply consists of these three elements: t0, delta-t and the y-values. That is the big advantage, but it is really not flixible. So either you get your data into that format, or you have to choose a different format, along the line that Thoric was thinking.
There may be better solutions to your specific problem, so if somebody has a diffent idea, I am excited in which way it goes!
Well its similar to an X-Y pair but I have a absolue Time Information(timestamp) which cant be easily used with this example VI.
Also I thought there could be a soln from NI like a VI which takes care of this.
I have a absolue Time Information(timestamp)
So you can easily determine the start time to be used for T0 in a waveform.
And you can easily calculate the time differences between T0 and all other timestamps: the result will be DBL values (time in seconds), which you can use in any interpolation function!