Hi there,
I'm struggling with an alarm script, like in the below. This CuSum chart is generating 7 alarms, and therefore should be generating the log file, however it is not, or not every time the script is run, which is strange. Any ideas on what's going on? I'm using version 17.2 pro.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Quality Control/Oil1 Cusum.jmp" );
obj = dt << CUSUM Control Chart(
Y( :weight ),
H( 2 ),
Lower Side( 1 ),
Target( 8.1 ),
K( 0.025 ),
Sigma( 0.02 ),
Head Start( 0.05 ),
Alarm Script(
contents = Substitute( "^QCTEST in column ^QCCOL in sample ^QCSAMPLE.",
"^QCTEST", Choose( qc_test,
"One point beyond the control limits" ),
"^QCCOL", qc_col,
"^QCSAMPLE", char( qc_sample ));
filename = Convert File Path("$TEMP/test log.txt", absolute);
if (File Exists( filename ), Save Text File( filename, contents, Mode("Append") ), Save Text File( filename, contents) );
),
);
// Turn on Test 1
obj << Test 1(1);