請問一下~我程式會輸出一個數值,是連續的電壓值,隨著我的取樣頻率會有變化,我想把這個數值儲存起來,儲存成記事本(*.txt),每儲存一個數值會自動換行,不會連著,麻煩各位告訴我怎麼做,越詳細越好,麻煩各位了~~~~
附檔就是我要儲存值的地方,請告訴我要接哪個物件,要怎麼接,真的麻煩各位了~~~謝謝
已解決! 轉到解決方案。
在 11-26-2008 07:17 PM
You may use Format Into String with the format string as "%#f\t%s\t%d\r\n"
note: "...\r\n" will go to next line (換行).
Attached is the basic code for your reference. Please make necessary editing i.e. adding while-loop with shift-register etc.
那我只有一個一維的data就是要從input進入囉,那format string裡面輸入的字串就是讓我的data在筆記本裡面可以自動換行囉?~那請問resulting string是顯示我的data值嗎?
那我要如何設定它會儲存在什麼地方?還有就是只是我開始擷取訊號,系統會自動創一個.txt檔自動紀錄嗎? 謝謝
在 11-26-2008 11:18 PM
Hi,
Please look/ explore at examples on File I/O or related topics that shipped with your LabVIEW software.
For your info, you definitely need some File I/O functions to create *.txt etc.
I am sorry for not able to spoon-feed you but hope you will explore the functions on your own. And, if you do have doubts (after exploring), feel free to post it here.
OK~~~我了解,那我會試試看的。
對了,還有一個問題請教一下~~~如附檔的圖片所示,我想要設定一個數值達到時,while loop就會停止,我從(圖CCC)將那個訊號拉出來時,線路經過case structure都是出現空心的連結點,然後我再將線拉至stop時(圖BBB),整個線路變成錯誤連接,不知道為什麼?想請教一下,是我的寫法不錯還是有其他原因,可以交我如何解決及達成我的要求嗎??
PS:我number產生的值是實數
在 11-27-2008 03:46 AM
Hi,
For CCC, I am not sure what is controlling your case(s). However, if you wire it out through the case(s), all you need to do is to give a FALSE constant in its False Case.
For BBB, if you need to have either the condition or the stop button to stop the while-loop, wire them to an OR Gate, and the OR Gate's output to stop the while loop.
Hope above make sense to you 😉
你大於之後的布林值是輸出,stop的布林值也是輸出,你的錯誤在於接線的線頭兩端都是接輸出(線頭兩端一定要一進一出)
你若要用大於跟stop這兩個布林值來控制迴圈停止的話,你要將這兩個控制的布林值接到一個OR Gate的兩個輸入端
再將OR Gate的輸出端接到迴圈的停止符號
OR Gate在functions裡的"Boolean"
BBB&CCC的問題我解決了,但那個data存檔的問題依然不太懂,可以在跟我說明一下嗎,我要將電壓值存在筆記本裡(*.txt)?筆記本可以自動創造,麻煩了~try好久都怪怪的,無法存???
麻煩了~~~謝謝