Here is fairly simplified example how you could do it.
// https://www.jmp.com/support/help/en/16.2/#page/jmp/example-of-control-limits.shtml#ww1447886
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Quality Control/Steam Turbine Historical.jmp");
dt_specs = New Table("Turbine Specs",
Add Rows(3),
New Column("Measurement", Character, Nominal, Values({"Fuel", "MW", "Cool Temp"})),
New Column("LCL", Numeric, Continuous, Values([200000, 19, 53])),
New Column("UCL", Numeric, Continuous, Values([250000, 22, 55])),
invisible
);
possible_measurements = Column(dt_specs, "Measurement") << get values;
nw = New Window("Select Limits", << modal, << return result,
V List Box(
Text Box("Select measurements to use predefined specs limits for:"),
cb_selections = Check Box(possible_measurements, << Set(1))
);
);
aa_specs = Associative Array();
For Each({selection_idx}, nw["cb_selections"],
aa_specs[possible_measurements[selection_idx]] = dt_specs[selection_idx, {"LCL", "UCL"}];
);
obj = dt << Control Chart Builder(
Show Control Panel(0),
Variables(Y(:Fuel)),
);
If(Contains(aa_specs, "Fuel"),
Eval(EvalExpr(
obj << Chart(Position(1), Set Control Limits({
LCL(Expr(aa_specs["Fuel"][1])), UCL(Expr(aa_specs["Fuel"][2]))
}))
));
);
Write();
How you should do it depends on your starting measurement data, control limit table, how you want to display control charts, how dynamic and robust you need this to be, your scripting skill level and so on
-Jarmo