BookmarkSubscribeRSS Feed
Choose Language Hide Translation Bar
Highlighted
Tom_P
Community Trekker

Mailing alarm script failed test

After i run a query to create a data table (named 'tbl'), I plot a control chart and of Data1 vs. TEST_DATE. I reviewed the JMP scripting guide alarm script information & posts: LINK1 & LINK2, but i can't figure out how to connect the dots.  1) I'd like the script to email me when a failed test occurs with the chart col parameter name and which test it failed for today's date (or just the graph .jpg which i already know how to do).  I'd be running this script once or twice a day.  2) Can i also output this failed test # to a cell in a new column of the failed data row of the current table ('tbl')?  Any help would be greatly appreciated.

 

 

cc3 = tbl << Control Chart(
	Sample Label( :TEST_DATE ),
	Group Size( 1 ),
	KSigma( 3 ),
	Chart Col(
		:Data1,
		Individual Measurement(
			Show Zones( 1 ),
			Shade Zones( 1 ),
			Test 1( 1 ),
			Test 2( 1 ),
			Test 3( 1 ),
			Test 4( 1 ),
			Test 5( 1 ),
			Test 6( 1 ),
			Test 7( 1 ),
			Test 8( 1 ),
			Sigma( 0.45 ),
			Avg( 0.02296 ),
			LCL( -1.347 ),
			UCL( 1.39 )
		)
	), 
//copied this section from another user's post & tried a few different variations
	Alarm Script(
		Write(
			QC_Test,
			",",
			QC_Col,
			",",
			QC_Sample,
			",",
			QC_FirstRow,
			",",
			QC_LastRow,
			",",
			fldid,
			",",
			tmppartno,
			",",
			SessionID,
			"\!N"
		)
	)
//end of copied section
,
	SendToReport(
		Dispatch(
			{"Individual Measurement of Data1"},
			"2",
			ScaleBox,
			{Format( "Fixed Dec", 10, 3 ), Min( -2 ), Max( 2 ), Inc( 0.5 ), Minor Ticks( 1 )}
		),
		Dispatch(
			{"Individual Measurement of Data1"},
			"1",
			ScaleBox,
			{Label Row( Label Orientation( "Angled" ) )}
		),
		Dispatch(
			{"Individual Measurement of Data1"},
			"IR Chart of IM",
			FrameBox,
			{Frame Size( 537, 431 ), Marker Size( 4 ), Grid Line Order( 7 ),
			Reference Line Order( 8 ), Row Legend(
				Sample_Name,
				Color( 1 ),
				Color Theme( "JMP Default" ),
				Marker( 0 ),
				Marker Theme( "" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		)
	)
);

Report( cc3 ) << save picture( "G:\My Drive\spc\picture.jpg" );

For Each Row(
	Date = If( :TEST_Date = Today(),
		If( :Name( "QC_Test" ) > 0,
			Mail(
				"bob@bob.com",
				"SPC - Out Of Control",
				"Chart has failed SPC test ",
				"G:\My Drive\spc\picture.jpg"
			)
		)
	)
);

 

0 Kudos