Python command: Standard SPC

The Standard SPC commands in Python allow you to read or write SPC standards and set various attributes for it.

See Python commands for other commands you can use with GainSeeker.

Syntax

Example

Description/Remarks

stdspc.cntrllimitcannotbelessthanzero  

stdspc.cntrllimitcannotbelessthanzero = False

This example would tell GainSeeker that the control limit for this standard can be less than zero.

Gets/Sets if the lower control limit cannot be less than zero. Setting this affects the stdspc.vflags value.

False: Control limit can be less than zero.

True: Control limit cannot be less than zero.

stdspc.deconstant

stdspc.deconstant = ".7"

Gets/Sets the data entry constant for the standard.

Character length is maximum 10 characters. Characters over that amount are truncated.

stdspc.description

stdspc.description = "My Description"

Gets/Sets the description for the standard.

Character length is maximum 14 characters. Characters over that amount are truncated.

stdspc.dmspart

stdspc.dmspart = "A-50 INSERT"

Gets/Sets the DMS part number associated with the standard. This value is not stored unless stdspc.dmsprocess is also set.

Character length is maximum 30 characters. Characters over that amount are truncated.

stdspc.dmsprocess

stdspc.dmsprocess = "M-CUT OFF"

Gets/Sets the DMS process associated with this standard. This value is not stored unless stdspc.dmspart is also set.

Character length is maximum 14 characters. Characters over that amount are truncated.

stdspc.exists(stdname)

if stdspc.exists("1250 TEMP"):
    print "That standard exists."

Returns True is a standard exists with the specified name. Otherwise it returns False.

stdspc.exponent

stdspc.exponent = 7

Gets/Sets the exponent used with this standard (used with exponential notation).

Values between -100 and 100 are valid.

Values outside this range cause an exception and the script halts.

stdspc.loadstd(stdname)

if stdspc.exists("1250 TEMP"):
    spc.loadstd("1250 TEMP")

Loads all information for the specified standard. This resets all previously set values.

stdspc.lowergate

stdspc.lowergate = 49.5

Gets/Sets the lower gate for the standard.

This value can be cleared using stdspc.lowergate = None

stdspc.lowerindlimit

stdspc.lowerindlimit = 49.2

Gets/Sets the lower individual limit for the standard.

This value can be cleared using stdspc.lowerindlimit = None

stdspc.lowerrangegate

stdspc.lowerrangegate = 0

Gets/Sets the lower range gate for the standard.

This value can be cleared using stdspc.lowerrangegate = None

stdspc.lowerreaslimit

stdspc.lowerreaslimit = 45

Gets/Sets the lower reasonable limit for the standard.

This value can be cleared using stdspc.lowerreaslimit = None

stdspc.lowerspec

stdspc.lowerspec = 49

Gets/Sets the lower spec for the standard.

This value can be cleared using stdspc.lowerspec = None

stdspc.measureunit

stdspc.measureunit = "Inch"

Gets/Sets the measure unit for the standard.

Character length is maximum 10 characters. Characters over that amount are truncated.

stdspc.metric

stdspc.metric = False

Gets/Sets the measurement system for the standard. Acceptable values are:

False: English / Imperial

True: Metric

stdspc.monitorsetting

stdspc.monitorsetting = 2

Gets/Sets the monitor setting for this standard. Setting this affects the stdspc.vflags value. Acceptable values are:

0: Never

1: Without Failures

2: With Failures

3: All Data

Values outside this range cause an exception and the script halts.

stdspc.numdecimals

stdspc.numdecimals = 3

Gets/Sets the number of decimals displayed for the data. Values between 0 and 10 are valid.

Values outside this range cause an exception and the script halts.

stdspc.rangechart

stdspc.rangechart = 0

Gets/Sets the range chart mode for the standard. Acceptable values are:

0: Range Chart

1: Moving Range Chart

2: Sigma Chart

Values outside this range cause an exception and the script halts.

stdspc.reset()

stdspc.reset()

Clears all information for the current standard. This does not affect any database records.

Note: This also clears the standard name.

stdspc.rtcheck

stdspc.rtcheck = 3087

This example sets the standard to check: x-bar above control, x-bar below control, range above control, range below control, x above spec, and x below spec.

Gets/Sets the integer representation of the real-time checks to perform during data entry for the standard.

stdspc.rtchecklist

print stdspc.rtchecklist

Returns a list of all real-time checks that are performed with the standard.

stdspc.scalehigh

stdspc.scalehigh = 100

Gets/Sets the high scale for the standard. This is the high value that appears on charts for this standard. This value can be cleared using stdspc.scalehigh = None

stdspc.scalelow

stdspc.scalelow = 0

Gets/Sets the low scale for the standard. This is the low value that appears on charts for this standard. This value can be cleared using stdspc.scalelow = None

stdspc.scalerange

stdspc.scalerange = 10

Gets/Sets the scale range for the standard. This value can be cleared using stdspc.scalerange = None

stdspc.shortrunindex

stdspc.shortrunindex = 4

Gets/Sets the short run traceability field key associated with the standard. Acceptable values are:

0: Part number (no short run)

1 to 6: Short run traceability field index

Values outside this range cause an exception and the script halts.

stdspc.shortrunmethod

stdspc.shortrunmethod = 1

Gets/Sets the short run method for the standard. Acceptable values are:

0: None

1: Target Nominal

2: Range short run

3: Standardized

4: Uncoded

Values outside this range cause an exception and the script halts.

stdspc.stdname

stdspc.loadstd("1250 TEMP")
stdspc.stdname = "1250 NEW STANDARD"
stdspc.storestd()

In this example, you load all information for a specified standard and then create a new standard with a different name. This allows for easy copying of standards.

Gets/Sets the name of the standard.

Character length is maximum 30 characters. Characters over that amount are truncated.

stdspc.stdvar1

stdspc.stdvar1 = "pressure.csv"

Gets/Sets Standard Variable 1 for the standard.

Character length is maximum 30 characters. Characters over that amount are truncated.

stdspc.stdvar2

see: stdspc.stdvar1

Gets/Sets Standard Variable 2 for the standard.

Character length is maximum 30 characters. Characters over that amount are truncated.

stdspc.stdvar3

see: stdspc.stdvar1

Gets/Sets Standard Variable 3 for the standard.

Character length is maximum 30 characters. Characters over that amount are truncated.

stdspc.stdvar4

see: stdspc.stdvar1

Gets/Sets Standard Variable 4 for the standard.

Character length is maximum 30 characters. Characters over that amount are truncated.

stdspc.storestd()

stdspc.loadstd("1250 TEMP")
stdspc.stdname = "1250 NEW STANDARD"
stdspc.storestd()

In this example, you load all information for a specified standard and then create a new standard with a different name. This allows for easy copying of standards.

Inserts or updates the current part number and all associated properties in the GainSeeker database. Returns True if the store is successful. Otherwise returns False.

stdspc.subgroupsize

stdspc.subgroupsize = 5

Gets/Sets the subgroup size for the standard. Values between 1 and 72 are valid.

Values outside this range cause an exception and the script halts.

stdspc.targetr

stdspc.targetr = .2

Gets/Sets the range target for the standard. This value can be cleared using stdspc.targetr= None

stdspc.targetx

stdspc.targetx = 50

Gets/Sets the x target for the standard. This value can be cleared using stdspc.targetx= None

stdspc.uppergate

stdspc.uppergate = 49.8

Gets/Sets the upper gate for the standard.

This value can be cleared using stdspc.uppergate = None

stdspc.upperindlimit

stdspc.upperindlimit = 50

Gets/Sets the upper individual limit for the standard.

This value can be cleared using stdspc.upperindlimit = None

stdspc.upperrangegate

stdspc.upperrangegate = .45

Gets/Sets the upper range gate for the standard.

This value can be cleared using stdspc.upperrangegate = None

stdspc.upperreaslimit

stdspc.upperreaslimit = 55

Gets/Sets the upper reasonable limit for the standard.

This value can be cleared using stdspc.upperreaslimit = None

stdspc.upperspec

stdspc.upperspec = 51

Gets/Sets the upper spec for the standard.

This value can be cleared using stdspc.upperspec = None

stdspc.useexponent

stdspc.useexponent = True

Gets/Sets if exponential notation is used in the standard.

True: Use exponential notation.

False: Do not use exponential notation.

stdspc.vflags

stdspc.vflags = 0

Gets/Sets when records are written to the monitor and if the lower control limit cannot be less than zero.

This value typically should not be directly set, rather set using the stdspc.cntrllimitcannotbelessthanzero and stdspc.monitorsetting commands.