如何在LabVIEW中将Chart的X轴设置成绝对日期时间



主要软件:
主要软件版本: N/A
主要软件修正版本: N/A
次要软件: N/A

问题: 我如何将数据针对绝对时间画在strip chart上?

解答: 缺省的, waveform chart和graph显示绝对时间0为基于Windows系统的7:00:00 PM, 12/31/1903。应用属性节点可以用来获得正确地绝对时间,并显示在x轴上。

首先,右键点击前面办上的chart,并选择X Scale >> Formatting。然后,设置格式为Absolute Time

创建一个waveform chart的属性节点,通过在程序框图上右键点击这个chart,并选择 Create >> Property Node。展开属性节点,获得两个属性。选择Format属性和Offset属性。Format属性位于X-Scale >> Format and Precision >> Format, Offset属性位于X-Scale >> Offset and Multiplier >> Offset。右键点击属性节点,选择Change All to Write

对于ormat属性,内容帮助显示,有很多输入给这个属性。连一个数值7给给set the format to Time and Date。对于Offset属性, 首先将Get Data/Time in Seconds VI的输出给To Double Precision Float VI的输入。然后,将To Double Precision Float VI的输出给Offset属性。在早期的Labview 7.0版本前,Get Data/Time in Seconds VI 直接输出一个双精度数据类型,而非timestamp数据类型,所以To Double Precision Float VI是没有必要的。您可以将Get Data/Time in Seconds VI的输出直接连到Offset属性。

另外,如果您知道每秒钟会画几个点到chart,您可以设置Multiplier属性,位于 X-Scale >> Offset and Multiplier >> Multiplier。如果有x每秒钟产生的数据点,连接1/x给Multiplier 属性。附件一个简单的例子说明了如何实现。


相关链接:
KnowledgeBase 326F9HIP: Why Doesn't My Graph Show the Current Time?
KnowledgeBase 2SGBHKOK: How Can I Plot My Acquired Data Versus A Timestamp in LabVIEW?
KnowledgeBase 1W3F9QHE: How Do I Set the Time and Date on the X-axis of a Graph in LabVIEW?

附件:


Chart with Timestamp.vi


报告日期: 08/03/2006
最近更新: 08/04/2006
文档编号: 3E6I65K7