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.



在TestStand下執行Interactive Execution時如何取得Loop Index的數值



主要軟體:
主要軟體版本: 4.0
主要軟體修正版本:
次要軟體: N/A

問題: 我目前會選擇我要執行的steps同時右鍵選擇Loop on Selected Steps...來執行interactive execution。在執行interactive execution時,要如何取得執行中的loop index變數值?

解答:

在TestStand下,interactive loop index的值並沒有辦法直接來取得。有一個方法可以解決這樣的問題:使用step.GetSettingString()。在interactive execution時,這個方法會回傳如下格式的字串資料,其中X代表loop index的數值。

    Interactive (X)

你需要針對這個字串資料作額外的處理才能將X的數值取出來。注意只有在迴圈次數大於1的狀態時,loop index的數值才會包含在step setting字串下。

這個方法需要一個指向step的reference輸入。你可以使用sequence context來獲取sequence的reference,接著進一步獲取step的reference。另外,InteactiveArgs物件會含有在interactive execution下的step引數值。下面有一個簡單的範例示範這個方法的使用。要使用這個範例,只需選取sequence中的所有steps,然後右鍵選取Loop on Selected Steps...。



相關連結:

附加檔案:





報告日期: 02/06/2008
最後更新: 05/18/2008
文件偏號: 4I59QJM6