Codes for Real-time Checks and Failures

 

Contents  [Hide]

 

Commands that reference the Codes for Real-time Checks and Failures

Some commands use these codes to identify which real-time check(s) should be performed for a particular SPC standard:

Other commands use these codes to identify which real-time failure(s) occurred in one SPC data record:

Table of Codes for Real-time Checks and Failures

Each real-time check / real-time failure has a numeric value:

1

X-bar above control limit

2

X-bar below control limit

4

R above control limit

8

R below control limit

16

X-bar above gate

32

X-bar below gate

64

R above gate

128

R below gate

256

X above individual limit

512

X below individual limit

1024

X above specification

2048

X below specification

4096

X-bar run above mean

8192

X-bar run below mean

16384

R run above mean

32768

R run below mean

65536

X-bar trend increasing

131072

X-bar trend decreasing

262144

R trend increasing

524288

R trend decreasing

1048576

2 of 3 above 2 SD

2097152

2 of 3 below 2 SD

4194304

4 of 5 above 1 SD

8388608

4 of 5 below 1 SD

16777216

CuSum above limit

33554432

Cusum below limit

Creating one number to represent multiple real-time failure codes

Multiple real-time checks - or multiple real-time failures for one data record - are represented by adding the individual failure codes together. 

Example 1:

To set up real-time checking for both "X-bar above control limit" (1) and "R above control limit (4)", you should specify the number 5 (1+4).

Example 2:

To set up real-time checking only for control limits and specification limits, you would calculate the final value like this:

Combined failure number = (X-bar above control) + (X-bar below control) + (Range above control) + (Range below control) + (X above spec) + (X below spec)

Combined failure number = 1 + 2 + 4 + 8 + 1024 + 2048 = 3087

Bitwise "or"

When summing values to produce a Combined failure number, you can use a "Bitwise or" in your Python code or Template code to ensure that each value only gets added one time. The symbol | is used to perform this operation.

For example:

Python code to add the number 1024 ("X above spec") to a variable sum_failures (that contains an intermediate sum of failure codes) could be written like this:

sum_failures = 1024 | sum_failures

The result:

If 1024 had already been added to the sum_failures variable, then the value of sum_failures would not change.

If 1024 had not yet been added to the sum_failures variable, then sum_failures would be updated to equal its original value + 1024.

Looking for one real-time failure code in a Combined failure number

The easiest way to determine whether a Combined failure number contains a specific failure code is to use a "Bitwise and".

Bitwise "and"

When querying a Combined failure number for a specific failure code, you can use a "Bitwise and" in your Python code or Template code to find out whether that failure code was added to the Combined failure number. The symbol & is used to perform this operation.

For example:

Python code to check for the number 1024 ("X above spec") in the variable sum_failures (that contains the sum of the failure codes) could be written like this:

if (1024 & sum_failures) == 1024:

print "Data failed the test for X Above Spec"

else:

print "Data did not fail the test for X Above Spec"

The result:

If 1024 had been added to the sum_failures variable, then the operation 1024 & sum_failures would return the number 1024.

If 1024 had not been added to the sum_failures variable, then the operation 1024 & sum_failures would return the number 0.