更改列 USL 和 LSL 屬性的 JMP 腳本我有一個 JMP 腳本函數,它從存儲在“Ntwk Osnr Spec Table Filename”變量中的文本文件中獲取一組規範限制。 我正在嘗試更改“Ntwk Osnr 數據表”數據表中“PctDiff_ModBer_q_calcBer”列的 USL 和 LSL 列屬性。 但是當我運行以下 JMP 腳本命令時,我沒有收到腳本錯誤,但 USL 和 LSL 列屬性沒有更新。 從規格限制獲得的規格限制是 1.7。 當我通過以下幾行時,1.7 的值在 Speclimit 變量中更新,但 USL 和 LSL 列屬性沒有更新。 如果我將 Speclimit 變量設置為常數 1.7,則 USL 和 LSL 列屬性分別設置為 1.7 和 -1.7。 所以問題一定是從文本文件中獲取值,但我可以找出問題所在。 有人可以讓我知道從文本文件獲取規格限制並讓它更新列屬性的解決方案是什麼。
Include( "$CommonScriptPath/Function - Obtain Spec Limit Value.jsl" );
Speclimit = ObtainSpecLimit(
Ntwk Osnr Spec Table Filename, DeviceType, "*", "*", "ber_diffQcalc"
);
dt = Open( Ntwk Osnr Data Table Filename, invisible );
Data Table( dt ):PctDiff_ModBer_q_calcBer << Set Property(
"Spec Limits",
{LSL( (Speclimit * (-1)) ), USL( Speclimit ), Target( 0 ), Show Limits( 1 )}
);腳本回复:更改列 USL 和 LSL 屬性的 JMP 腳本確保值是數字並嘗試使用 Eval(EvalExpr()) 和 Expr()
Include("$CommonScriptPath/Function - Obtain Spec Limit Value.jsl");
Speclimit = ObtainSpecLimit(Ntwk Osnr Spec Table Filename, DeviceType, "*", "*", "ber_diffQcalc");
dt = Open(Ntwk Osnr Data Table Filename, invisible);
Eval(
Eval Expr(
Data Table(dt):PctDiff_ModBer_q_calcBer << Set Property(
"Spec Limits",
{LSL(Expr(Speclimit * (-1))), USL(Expr(Speclimit)), Target(0), Show Limits(1)}
)
)
);
使用 Eval Insert、Eval Expr、Parse 和 Substitute 將一個表達式插入另一個表達式
回复:更改列 USL 和 LSL 屬性的 JMP 腳本您在 JMP 列表中指定的計算不會在執行前進行評估。因此,在 Substitution 函數完成之前,必須對語句進行完全解析和評估
Include( "$CommonScriptPath/Function - Obtain Spec Limit Value.jsl" );
Speclimit = ObtainSpecLimit(
Ntwk Osnr Spec Table Filename, DeviceType, "*", "*", "ber_diffQcalc"
);
dt = Open( Ntwk Osnr Data Table Filename, invisible );
Eval(
Substitute(
Expr(
Data Table( dt ):PctDiff_ModBer_q_calcBer <<
Set Property(
"Spec Limits",
{LSL( __LSL__ ), USL( __USL__ ), Target( 0 ), Show Limits( 1 )}
)
),
Expr( __LSL__ ), Speclimit * (-1),
Expr( __USL__ ), Speclimit
)
);