Download MES User Manual - Inductive Automation
Transcript
SPC Quality
264
Line 24 calculates the average of the xBar values, also known as x double bar (XDBar).
Line 25 calculates the average of the range values, also known as range bar (RBar).
The event.getSampleSize() in line 28, returns the number of measurements per sample. This
will be used to determine which a2 value to use from the array in line 5. The a2 is a factor to
calculate the 3 sigma or 3 times standard deviation value and changes based on the number
of measurements in each sample.
Lines 31 through 34 lookup the a2 value that is going to used to calculate the new control limit
value. A quick range check is done to prevent reading a value that is outside of the array limits.
Line 37 calculates the new UCL value.
And finally, the value is saved to pass back the new control limit value in line 40.
Default XBar UCL control limit calculation script:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#XBar UCL Calculation
#Define the A2 factors array.
#The A2 factors correspond to the sample size which starts at 2.
#This is why element 0 and 1 of the array are 0.
a2 = [0.0, 0.0, 1.880, 1.023, 0.729, 0.577, 0.483, 0.419, 0.373, 0.337, 0.308, 0.285, 0.266,
#Get the SPC data that the XBar UCL will be calculated for
ds = event.getData()
#Get the columnn indexes within the SPC data
xBarColNdx = ds.getColumnIndex("XBar")
rangeColNdx = ds.getColumnIndex("Range")
#Initialize xBar and range sums that are need to calculate average xBar and range.
xBarSum = 0.0
rSum = 0.0
#Cycle through each row and add to the sums
for row in range(ds.rowCount):
xBarSum = xBarSum + ds.getValueAt(row, xBarColNdx)
rSum = rSum + ds.getValueAt(row, rangeColNdx)
#Calculate the average xBar and range
xDBar = xBarSum / ds.rowCount
rBar = rSum / ds.rowCount
#Get the sample size.
sampleSize = event.getSampleSize()
#Lookup the A2 value
if sampleSize < len(a2):
a2Value = a2[sampleSize]
else:
a2Value = a2[len(a2) - 1]
#Calculate the xBar UCL
ucl = xDBar + a2Value * rBar
#Return the new xBar UCL back to the SPC module
event.setControlLimitValue(ucl)
Looking at the default control limit calculations along with the Scripting section of this manual
© Inductive Automation
Related documents
MES User Manual - Inductive Automation
MES User Manual - Inductive Automation
User Manual - File Management
3 Overview - Inductive Automation
Magellan Interface Toolkit Manual (Emerald Intelligence)
STANDARD OPERATING PROCEDURE MANUALS
AOC-UG-i4 - Supermicro
FCC4 Fast Clock Controller
How can I build my Collaborative Control Platform
Using the DAQ Adaptor for MATLAB
FactorySQL 4.1 User Manual
Oracle® Crystal Ball, Fusion Edition