文章分類

顯示具有 [LabVIEW] Timing 標籤的文章。 顯示所有文章
顯示具有 [LabVIEW] Timing 標籤的文章。 顯示所有文章

2016年3月2日 星期三

[分享] 倒數計時器 Count Down Timer(FGV)

Hello everyone,

上一篇文章距今已經好久了XD

I'm too lazy to update my blog.

今天想分享的是倒數計時器的小程式,

是用FGV去做的,

下圖為程式為function的程式碼,

Today, I want to share count down timer.







接著我們再寫一支小程式來測試我們的function是否正確,

Now, I write a test program to verify function is correct or not.


在最左側,只要輸入需要倒數的時間,單位為ms。

然後在迴圈裡面只要一直讀取倒數計時器的狀態即可,

只要倒數完成,就會輸出一個TRUE的布林值。

In left side, you can connect the value you want to count down.

Next, use READ enum to read count down status.

If the timer count down equal to your setting, and it will output TRUE(Boolean).




因此你可以在不同的地方設定和計算倒數的數值,

也不用將線連來連去。

In conclusion, you can use this function to calculate the count down value in everywhere you want.


影片 :




程式下載點: 點這

Download link: Click



Patrick

2015年3月9日 星期一

[教學] 時間擷取成字串(Time to string)

今天來分享的是如何擷取到時間變成字串。

就是用這個Format Data/Time String




至於時間String的格式,可以自己去制定,以下是help裡面的說明。

The following codes are some of the most commonly used time format codes:

%c displays locale-specific date/time time-related format codes include %X (locale-specific time).



%H (hour, 24-hour clock), %I (hour, 12-hour clock), %M (minute), %S (second).

%<digit>u (fractional seconds with <digit> precision)

%p (a.m./p.m. flag); date-related format codes include %x (locale-specific date)

%y (year within century)

%Y (year including century)

%m (month number)

%b (abbreviated month name),

%d (day of month)

%a (abbreviated weekday name).


所以我們想存什麼樣的形式,基本上都有。

舉個例,我希望存檔格式為:年_月_日_星期_時_分_秒

字串只要改成這樣即可



應該算蠻簡單的,以後存檔的每筆資料都可以用這樣子記錄時間下來。


Patrick