首頁
支援
如何透過LabVIEW從Sequence檔案中取得Step屬性
如何透過LabVIEW從Sequence檔案中取得Step屬性
更新 Oct 28, 2022
環境
環境顯示經過驗證可用於本文描述的解決方案的產品。此解決方案也可能適用於其他類似產品或應用程序。
軟體
TestStand
我在找一種不需要打開TestStand,便可以從sequence檔案中取得step屬性的方法。我是否能使用LabVIEW來呼叫TestStand API進而達到此目的?
啟動
NI TestStand
並建立一個新的sequence檔案。
新增一個
Statement
step
將step重新命名為
Test
在
Expression
中加入
Random(1,100)
將檔案命名為
Test.seq
並儲存在
C:\Test\
啟動
LabVIEW
並建立一個新VI。現在,您應該參考
TestStand API Reference Help
來實現下方的功能。
建立
TestStand UI Application Manger
的instance。
使用
ApplicationMgr.GetEngine
方法建立TestStand Engine object
使用
Engine.GetSequenceFileEx
方法來載入儲存於
C:\Test\Test.seq
的檔案。
使用
SequenceFile.GetSequence
方法來存取MainSequence並將index的值設定為
0
。
使用
Sequence.AsPropertyObject
方法來存取PropertyObject class中定義的屬性和方法。
使用
PropertyObject.GetValString
方法。
使用lookup string
Main["Test"].TS.PostExpr來
取得Test step的Post-Expression
將options的值設定為
0
使用
Engine.ReleaseSequenceFileEx
方法釋放檔案並關閉所有reference。
此時,完整的VI將如下所示。
執行VI後,該VI將在GetValString的string indicator中顯示“Random(0,100)”。
相關連結
ApplicationMgr.GetEngine - NI
Engine.GetSequenceFileEx - NI
SequenceFile.GetSequence - NI
Sequence.AsPropertyObject - NI
PropertyObject.GetValString - NI
Engine.ReleaseSequenceFileEx - NI
Lookup Strings - NI
其他支持選項
詢問NI社區
在我們的論壇中與其他用戶協作
搜索NI社區以尋求解決方案
請求工程師的支持
需要具備有效的服務合約或有效的租用版軟體,且支援選項因國家/地區而異。
打開服務請求
了解租用版軟體與服務
了解硬體服務計畫
Was this information helpful?
Helpful
Not Helpful