From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
|
为了将.NET的日期时间对象转化为LabVIEW时间标识,LabVIEW内部调用了DateTime.ToFileTime()函数。当时间早于1601年1月1日时,产生异常错误。(参考MSDN entry)
当通过构造函数节点创建日期时间对象为LabVIEW时间标识,且没有参数和日期属性时,该问题就会产生。当另一个应用程序创建了.NET日期时间属性,但是没有正确初始化时,也会出现该错误。
例如当调用网络发布工具产生的VIs,当它返回LabVIEW时间标识时,就会产生该错误。这些日期时间对象应该由网络对象初始化。
获取日期属性前确保一个日期时间对象表示一个有效的日期属性,能避免这种错误。为了这样做,确保年属性值是大或等于1601。在处理来自网络发布工具的VIs时,在日期属性被访问和添加代码前,确保日期时间已被检察。
KnowledgeBase 2XSBFPHM: LabVIEW and .NET Exceptions
MSDN: DateTime Structure (System)
KnowledgeBase 2HDCFJV5: Universal Time and LabVIEW
|