LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

「日付/時間を秒で取得関数」を使用して経過時間を判定する処理について

Solved!
Go to solution

こんにちは。

 

添付ファイルのような約1秒経過を検出するプログラムがあります。

このプログラムを長い時間実行していると、ケースストラクチャのTRUE側を実行しなくなることはあるのでしょうか?

 

「日付/時間を秒で取得関数」が出力する「タイムスタンプ」を調べても良く分からなかったので、質問させていただきました。

数値カウンタのようなものであれば、497日後とか49.7日後のカウンタが1周したときに、TRUE側が実行されなくなるのでは・・・と、考えています。

0 Kudos
Message 1 of 3
(775 Views)
Solution
Accepted by topic author t.tanaka

You seem to think that there is a connection between timestamps and the uInt32 value of the timer tick in the Wait node. But they are two completely different things.

 

The timer tick is simply a counter that gets incremented in ms intervals (but not necessarily every ms, that depends a bit on the underlying OS and its configuration). The resulting value is however guaranteed to be in milliseconds since an arbitrary point of time, normally the moment your computer started up, and it wraps around when reaching the maximum of 2^32 ms, which is about your 49 days).

 

The timestamp value however is a very different thing. It is based on the real-time clock of your PC and in the case of Windows it is the number of 100 ns intervals since January 1, 1601 00:00 UTC. It is an uInt64 value and will wrap around at about year 60,055 AD. So it is safe to assume that Windows won't exist at that point. 😁

 

A LabVIEW timestamp is even more extreme. It is a 128-bit value, with a 64-bit signed integer part that measures the seconds since January 1, 1904 00:00 GMT and a 64 bit unsigned fractional part that measures the fractional seconds. So it can go up to about +- 9.2 * 10^18 years (that is about 10^9 times the age of our universe and also a lot more than the expected lifespan of it too) with a theoretical fractional resolution of 5.4 * 10^-20 seconds. That is actually about 50 zepto seconds. In reality the fractional part of the LabVIEW timestamp only uses the 32 highest significant bits which is still about 0.2 * 10^-9 seconds or 0.2 nano seconds resolution.

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 3
(755 Views)

Rolf Kalbermatter,

 

thank you for all your help.
It has been very helpful.

0 Kudos
Message 3 of 3
(730 Views)