For the latest version of JMP Help, visit JMP.com/help.


Publication date: 11/10/2021

Control Charts

Using JSL, you can create control charts, customize tests, run alarm scripts, and more.

Reference Lines in Control Chart Builder

If you add a custom reference line to a Control Chart Builder chart through JSL, the reference line label must be something other than “LSL”, “USL”, or “AVG”. These names are keywords used by the Control Chart Builder platform.

The following example creates custom reference lines with unique labels.

dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
obj = dt << Control Chart Builder(
	Variables( Y( :height ) ),
	SendToReport(
		Dispatch(
			{},
			"height",
			ScaleBox,
			{Add Ref Line( 70, "Solid", "Black", "Upper Limit", 1 ),
			Add Ref Line( 55, "Solid", "Black", "Lower Limit", 1 )}
		)
	)
);

Customize Tests in Control Chart Builder

You can design custom tests and select or deselect multiple tests at once using the Customize Tests function. You specify the description, desired number, and label. This option is available only for Variables and Attribute chart types.

The following example creates a custom test called Test 1 and turns it on.

dt = Open( "$SAMPLE_DATA/Quality Control/Diameter.jmp" );
dt << Control Chart Builder(
	Variables( Subgroup( :DAY ), Y( :DIAMETER ) ),
	Customize Tests( Test 1( 2, "1" ) ), // test number, n, label
	Chart( Position( 1 ), Warnings( Test 1( 1 ) ) ), // turn Test 1 on
	Chart( Position( 2 ) )
);

Run Alarm Scripts

An alarm script alerts you when the data fail one or more tests. As an Alarm Script is invoked, the following variables are available, both in the issued script and in subsequent JSL scripts:

qc_col is the name of the column

qc_test is the test that failed

qc_sample is the sample number

qc_phase is the label of the phase during which the failure occurred

qc_firstRow is the first row in the sample

qc_lastRow is the last row in the sample

Example 1: Automatically Writing to a Log

One way to generate automatic alarms is to make a script and store it with the data table as a data table script or column property named QC Alarm Script.

The following example automatically writes a message to the log whenever a test fails:

dt = Open( "$SAMPLE_DATA/Quality Control/Coating.jmp" );
obj = dt << Control Chart(
	Sample Size( :Sample ),
	KSigma( 3 ),
	Chart Col( :Weight, XBar, R ),
	Alarm Script(
		Write(
			"Out of Control for test ",
			qc_test,
			" in column ",
			qc_col,
			" in sample ",
			qc_sample
		)
	)
);
obj << Test 1( 1 );

Example 2: Running a Chart with Spoken Tests

You can create a control chart with tests that are spoken aloud using the Speak function. Try the following example:

dt = Open( "$SAMPLE_DATA/Quality Control/Coating.jmp" );
dt << Control Chart(
	Alarm Script(
		Speak(
			Match( QC_Test,
				1, "One point beyond Zone A",
				QC_Test, 2,
				"Nine points in a row in zone C or beyond", QC_Test,
				5,
					"Two out of three points in a row in Zone A
					or beyond"
			)
		)
	),
	Sample Size( :Sample ),
	Ksigma( 3 ),
	Chart Col( :Weight, Xbar( Test 1( 1 ), Test 2( 1 ), Test 5( 1 ) ), R )
);

You can have either of these scripts use any of the JSL alert commands, such as Speak, Write, or Mail.

Set Phase Limits

A phase is a group of consecutive observations in the data table. For example, phases might correspond to time periods during which a new process is brought into production and then put through successive changes. Phases generate, for each level of the specified Phase variable, a new sigma, set of limits, zones, and resulting tests.

The following example illustrates setting the limits for the different phases of Diameter.jmp:

dt = Open( "$SAMPLE_DATA/Quality Control/Diameter.jmp" );
dt << Control Chart(
	Phase( :Phase ),
	Sample Size( :DAY ),
	KSigma( 3 ),
	Chart Col(
		:DIAMETER,
		XBar(
			Phase Level(
				"1",
				Sigma( .29 ),
				Avg( 4.3 ),
				LCL( 3.99 ),
				UCL( 4.72 )
			),
			Phase Level(
				"2",
				Sigma( .21 ),
				Avg( 4.29 ),
				LCL( 4 ),
				UCL( 4.5 )
			)
		),
		R( Phase Level( "1" ), Phase Level( "2" ) )
	)
);
Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).