取消
显示结果 
搜索替代 
您的意思是: 

Asynchronous Waveforms and the waveform variable

已解决!
转到解答

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 项奖励
1 条消息(共 5 条)
5,385 次查看

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 项奖励
2 条消息(共 5 条)
5,379 次查看
解答
接受人 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 项奖励
3 条消息(共 5 条)
5,343 次查看

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 项奖励
4 条消息(共 5 条)
5,338 次查看

@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 项奖励
5 条消息(共 5 条)
5,332 次查看