JSL per importare i limiti delle specificheSto scrivendo un codice JSL per importare i limiti di specifica da una tabella dati separata nella tabella dati principale.
// 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 );Lo script imposta la proprietà spec. limit in tutti i punti corretti indicati dalla tabella spec. limit, ma non importa i limiti spec effettivi. Qualche suggerimento?
Automazione e scriptingRe: JSL per importare limiti di specifichePuoi utilizzare la piattaforma Manage Limit per questo se i tuoi dati sono nel formato corretto
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;
Se vuoi seguire la tua strada, devi valutare i limiti
Eval(EvalExpr(
col << Set Property("Spec Limits", {LSL(Expr(LSL)), USL(Expr(USL)), Show Limits(Expr(showLimits)}))
));
Re: JSL per importare limiti di specificheGrazie @jthi , funziona davvero bene!
Ho aggiornato il mio script originale per valutarne i limiti.
// 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 );Re: JSL per importare limiti di specifiche@jthi , quando si importano i limiti spec con la funzione EvalExpr, i limiti vengono importati ma non vengono visualizzati come limiti prima che io apra la finestra delle proprietà spec. limit e prema Apply. Sai perché e cosa si può fare per evitarlo?
Re: JSL per importare limiti di specificheSei sicuro che i dati nella tabella dei limiti delle specifiche siano numerici e non caratteri?
Re: JSL per importare limiti di specificheSì, è numerico. È stato salvato dalla piattaforma Manage Limits.
Re: JSL per importare limiti di specificheAh... ora ho notato che stai usando una sintassi non corretta per impostare i limiti, ti manca l'elenco (parentesi ondulate)

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);Re: JSL per importare limiti di specifichePerfetto, grazie! Ha funzionato!