LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Asynchronous Waveforms and the waveform variable

Solved!
Go to solution

I am receiveing data from a piece of software outside of my control via a data socket. That software gets data from a piece of data acqusition hardware over a serial bus.  It is known to drop packets, but every packet sent (2/second) has a time stamp.  If I lose a packet of data, there seems to be no way of adjusting T0 in the waveform data so that the missing data is skipped rather than simply appended to the next good data.  How do I keep track of or fill with zeros missing time in waveform data?  Here is a VI showing the problem.  

0 Kudos
Message 1 of 5
(3,427 Views)

Changing T0 is just saying that the data started later than it actually did, it doesn't fill in the missing data.

What you need to do is when you detect you've missed data, create an array of zeroes that is equal to the number of missing samples and build that into the waveform array.

0 Kudos
Message 2 of 5
(3,421 Views)
Solution
Accepted by manjagu

Hi manjagu,

 

What Ravens Fan stated is correct, T0 in waveform data is the time of the first data point.  This means that you wouldn't want to change this value but rather your data to all zeros as mentioned. 

Regional Account Manager
NI
0 Kudos
Message 3 of 5
(3,385 Views)

I was afraid of that.  It might be nice if the waveform data type were a bit smarter and incorporated handlers for such situations.  But then again, maybe most people don't deal with this problem.  Thanks.

0 Kudos
Message 4 of 5
(3,380 Views)

@manjagu wrote:

I was afraid of that.  It might be nice if the waveform data type were a bit smarter and incorporated handlers for such situations.  But then again, maybe most people don't deal with this problem.  Thanks.


Have no fear the WF chart is here (to do what you want).

 

As shown below

 

you can use the WF data to specify when in thime the value is plotted.

 

If you want to force a break in the line, throw in some "NaN" so the chart "lifts the pen" while drawing.

 

Ben

 

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 5
(3,374 Views)