Skip to main content

system.mes.oee.saveConfig

Description

Creates or updates an OEE Configuration record in the system. To create a new configuration, first generate a new object with system.mes.oee.newConfig.

Permissions

This method requires the OEE.WRITE.SAVE permission.

Syntax

system.mes.oee.saveConfig(**configData)

Parameters

An unpacked dictionary of OeeConfigurationDTO fields.

ParameterTypeNullableDescriptionDefault Value
idStringTrueThe id of the OEE Configurationnull
locationIdStringFalseIdentifier for the associated locationnull
locationPathStringTruePath for the associated location. For display purposes onlynull
maxRecordDurationIntegerFalseMaximum duration for an OEE production record in seconds600
maxTimeBetweenExecutionsIntegerTrueMaximum # of seconds between executions5
maxFlushIntervalIntegerTrueFlush interval in seconds30
pruneDaysIntegerTrueNumber of days to retain OEE production recordsnull
modeExpressionStringTrueIgnition expression used to determine the OEE modenull
enableAvailabilityBooleanFalseFlag to enable or disable OEE availability calculationstrue
stateExpressionStringTrueIgnition expression for determining the machine statusnull
availabilityReasonSourceOeeAvailabilityReasonSourceTrueSpecifies how the system determines the availability reason codeMANUAL
availabilityReasonExpressionStringTrueIgnition expression that returns an integer code corresponding to a availability reasonnull
holdFirstNonRunningStateBooleanFalseFlag to enable or disable cutover between non running statestrue
primaryAlarmResolutionStrategyPrimaryAlarmResolutionStrategyFalsePrimary Alarm Resolution Strategy for this OEE ConfigurationEARLIEST
enablePerformanceBooleanFalseFlag to enable or disable OEE performance calculationstrue
productionCountUnitOfMeasureIdStringFalseIdentifier for the unit of measure used in production and quality countsnull
productionCountUnitOfMeasureNameStringTrueName for the unit of measure used in production and quality countsnull
productionCountUnitOfMeasureSymbolStringTrueSymbol for the unit of measure used in production and quality countsnull
productionCountExpressionStringTrueIgnition expression used to calculate the machine's production countnull
productionCountCalcTypeCountCalcTypeFalseCalculation type for the production countDELTA
productionCountOverflowValueDoubleTrueOverflow value used for production count calculationsnull
standardRateSourceOeeTargetSourceFalseSource for determining the standard rate of productionSTATIC
standardRateDoubleTrueStandard rate of production for this configuration per second0.0
standardRateExpressionStringTrueIgnition expression used to provide the standard production ratenull
productionRateTimeUnitsTimeUnitFalseUnit of measure for the machine production rate & standard rateMINUTES
enableQualityBooleanFalseFlag to enable or disable OEE quality calculationstrue
qualityCountCalcTypeCountCalcTypeFalseCalculation type for the quality countDELTA
qualityStrategyOeeQualityStrategyFalseQuality Strategy for this OEE ConfigurationWASTE_COUNT
qualityCountExpressionStringTrueIgnition expression used to determine the quality count for productionnull
qualityCountOverflowValueDoubleTrueOverflow value used for quality count calculationsnull
productionOrderSourceOeeProductionOrderSourceFalseSource for the production order resolutionNONE
productionOrderExpressionStringTrueExpression to provide the production order (id or name) for the current oee production recordnull
notesStringTrueNotes associated with the confignull
enabledbooleanTrueIndicates whether the config is enabledtrue
spare1StringTrueExtra field 1null
spare2StringTrueExtra field 2null
spare3StringTrueExtra field 3null

Returns

A JSON representation of the saved OeeConfigurationDTO object.

Code Examples

# Create a new OEE configuration object
newConfig = system.mes.oee.newConfig()

# Set attributes for the new configuration
newConfig['locationId'] = '01JCH3ENEB-SV2X8B3W-NFY8WZNK'
newConfig['enabled'] = True
newConfig['productionCountExpression'] = '[default]Path/To/Prod/Count'

# Save the new configuration to the system
savedConfig = system.mes.oee.saveConfig(**newConfig)

print "Saved OEE Configuration with ID:", savedConfig['id']

# To update an existing configuration, include its ID
# updatedConfigData = system.mes.oee.getConfig(savedConfig['id'])
# updatedConfigData['enabled'] = False
# system.mes.oee.saveConfig(**updatedConfigData)