Subscribe Bookmark RSS Feed

spec limits jsl script

Highlighted
Salil

Community Member

Joined:

Jun 30, 2017

Hi,

I tried to write a jsl script for reading in spec limits from a table to columns in another data table, based on discussions in this community. Pasted below is the script, and the corresponding data and spec limits tables are attached.

 

I am not sure what I am doing wrong, but when I check the column properties of the data table after running the script, the Spec Limits fields are still blank. Can someone please let me know what I am doing wrong? Thanks in advance.

 

Names Default To Here( 1 );

dt = Open("test1.jmp");

dt1 = Open("test1_spec.csv");

dt << current data table ();

x = dt << Get Column Names(string);
y = dt1 << Get Column Names(string);

ncols = N Items (x);

for (i=1, i<=ncols, i++,
	v = Column(i) << Get Name;
	z = (Loc(y,v)) [1];
	dt1 << current data table();
	uLimit = Column(z)[1];	
	lLimit = Column(z)[2];
	tLimit = Column(z)[3];
	dt << current data table ();
	Eval(
		Eval Expr(
		Column(dt,char(x[i])) << Set Property(
			"Spec Limits",
			{LSL( Expr( lLimit ) ), USL( Expr( uLimit ) ), Target( Expr( tLimit ) ),
			Show Limits( 1 )}
		)
	)
)
);

test_spec (spec limits table):

Descriptionacd
USL112542
LSL012.5
TT51123

 

test1 (data table):

abcd
1324
2648
39612
412816
5151020
6181224
7211428
8241632
9271836
10302040
1 REPLY
txnelson

Super User

Joined:

Jun 22, 2012

Take a look at the File Exchange Addin called 

Write Limits to a Data Table from a Limits Table.  The assumed format of the input limits data table is different than your specified structure, however, you could easily either change your structure, or modify the JSL from the addin

 
Jim