用於導入規格限制的 JSL我正在編寫 JSL 程式碼,將規格限從單獨的資料表匯入到主資料表中。
// Open the Spec Limits table
specTable = Open("C:\Trending Tool Spec Limits.jmp");
// Open data table for analysis
dataTable = Data Table( "Trending data" );
// Extract Spec Limits and Show Limits from Spec Table
For Each Row(
specName = specTable:Variable[];
LSL = specTable:LSL[];
USL = specTable:USL[];
showLimits = specTable:Show Limits[]; // Assume Show Limits column has 1 for "show" and 0 for "hide"
// Get the corresponding column in the data table
col = Column( dataTable, specName );
// Set the Spec Limits property as an associative array
col << Set Property( "Spec Limits", {LSL( LSL ), USL( USL ), "Show Limits"( showLimits )}
);
);
// Close the Spec Limits table
Close( specTable, NoSave );該腳本正在設定規範。將屬性限制在規範給出的所有正確位置。限製表,但它沒有導入實際的規格限制。有什麼建議嗎?
自動化和腳本編寫回覆:用於導入規格限制的 JSL如果您的資料格式正確,您可以使用管理限制平台來執行此操作
Names Default To Here(1);
dtLimits = New Table("Cities Limits",
Add Rows(4),
New Column("Process", Character, Set Values({"OZONE", "CO", "SO2", "NO"})),
New Column("LSL", Numeric, Set Values([0, 0, 0, 0])),
New Column("Target", Numeric, Set Values([0.2, 15, 0.05, 0.035])),
New Column("USL", Numeric, Set Values([0.4, 30, 0.1, 0.07])),
Set Label Columns(:Process)
);
dt = Open("$SAMPLE_DATA/Cities.jmp");
obj = dt << Manage Limits(
Process Variables(:OZONE, :CO, :SO2, :NO),
Load From Limits Table(dtLimits)
);
obj << Save to Column Properties;
如果你想走你的路線,你需要評估限制
Eval(EvalExpr(
col << Set Property("Spec Limits", {LSL(Expr(LSL)), USL(Expr(USL)), Show Limits(Expr(showLimits)}))
));
回覆:用於導入規格限制的 JSL謝謝@jthi ,很有魅力!
我更新了原始腳本來評估限制。
// Open the Spec Limits table
specTable = Open("C:\Trending Tool Spec Limits.jmp");
// Open data table for analysis
dataTable = Data Table( "Trending data" );
// Extract Spec Limits and Show Limits from Spec Table
For Each Row(
specName = specTable:Variable[];
LSL = specTable:LSL[];
USL = specTable:USL[];
showLimits = specTable:Show Limits[]; // Assume Show Limits column has 1 for "show" and 0 for "hide"
// Get the corresponding column in the data table
col = Column( dataTable, specName );
// Set the Spec Limits property as an associative array
Eval(EvalExpr(
col << Set Property("Spec Limits", {LSL(Expr(LSL)), USL(Expr(USL)), "Show Limits"n(Expr(showLimits)))})
);
);
// Close the Spec Limits table
Close( specTable, NoSave );回覆:用於導入規格限制的 JSL@jthi ,當使用 EvalExpr 函數匯入規格限制時,會匯入限制,但在開啟規格之前不會顯示為限制。限制屬性視窗並按應用。您知道為什麼嗎?
回覆:用於導入規格限制的 JSL您確定規格限製表中的資料是數字而不是字元嗎?
回覆:用於導入規格限制的 JSL是的,它是數字。它是從管理限制平台保存的。
回覆:用於導入規格限制的 JSL啊...現在我確實注意到您使用了不正確的語法來設定限制,您缺少列表(波浪括號)

Names Default To Here(1);
dtLimits = New Table("Cities Limits",
Add Rows(4),
New Column("Variable", Character, Set Values({"OZONE", "CO", "SO2", "NO"})),
New Column("LSL", Numeric, Set Values([0, 0, 0, 0])),
New Column("USL", Numeric, Set Values([0.4, 30, 0.1, 0.07])),
New Column("Show Limits", Numeric, Set Values([1, 1, 1, 1]))
);
dt = Open("$SAMPLE_DATA/Cities.jmp");
For Each Row(dtLimits,
specName = dtLimits:Variable[];
low = dtLimits:LSL[];
high = dtLimits:USL[];
showLimits = dtLimits:Show Limits[];
Eval(Eval Expr(
Column(dt, specName) << Set Property("Spec Limits", {LSL(Expr(low)), USL(Expr(high)), Show Limits(Expr(showLimits))})
));
);
Close(dtLimits, NoSave);回覆:用於導入規格限制的 JSL完美,謝謝!這樣就成功了!