Skip to main content
Version: V2 (Ignition 8.1)

system.mes.oee.saveCalculationConfig

Description

Creates or updates an OEE Calculation Configuration. If an id is provided and matches an existing configuration, it is updated; otherwise a new configuration is created.

Permissions

This method requires the OEE.WRITE.SAVE permission.

Syntax

system.mes.oee.saveCalculationConfig(**config)

Parameters

ParameterTypeNullableDescription
idStringTrueULID of an existing configuration to update. Omit to create new.
locationIdStringFalseID of the associated location. Required for new configurations.
locationPathStringTruePath of the associated location. For display purposes only.
periodTypeStringFalsePeriod granularity: "HOUR", "DAY", "WEEK", "MONTH", or "SHIFT".
numRowsPerCycleIntegerTrueMaximum records to generate per job cycle. Default 1.
weekStartDayStringTrueFirst day of the calendar week for WEEK bucketing. One of "MONDAY" through "SUNDAY". Default "MONDAY" (ISO 8601). Only meaningful for WEEK configurations.
numDaysDelayIntegerTrueMinimum number of days a period must end before it is pre-computed. The pre-processed row in the rollup table will always be at least this many days behind the current date. This is to allow for a settling period. Default 1, minimum 1.
latestCalculationTimestampStringTrueISO-8601 timestamp. Sets the backfill starting point.
enabledBooleanTrueWhether this configuration is active. Default True.
notesStringTrueOptional notes.

Returns

A JSON representation of the saved OeeCalculationConfigurationDTO.

NameTypeNullableDescriptionDefault Value
idStringTrueThe ID of the saved configuration (ULID).null
locationIdStringFalseIdentifier for the associated location.null
locationPathStringTruePath for the associated location (display only).null
periodTypeStringFalsePeriod granularity: HOUR, DAY, WEEK, MONTH, or SHIFT.null
numRowsPerCycleIntegerFalseMaximum records to generate per job cycle.1
weekStartDayStringFalseFirst day of the calendar week for WEEK bucketing."MONDAY"
numDaysDelayIntegerFalseMinimum number of days a period must end before it is pre-computed. The pre-processed row in the rollup table will always be at least this many days behind the current date. This is to allow for a settling period.1
latestCalculationTimestampInstantTrueISO-8601 timestamp of the most recently computed period.null
enabledBooleanFalseWhether this configuration is active.true
notesStringTrueOptional notes.null

Code Examples

# Create a new hourly calculation config for a line
config = system.mes.oee.saveCalculationConfig(
locationId = "01JCH3ENEB-SV2X8B3W-NFY8WZNK",
periodType = "HOUR",
numRowsPerCycle = 48
)
print "Created config with id:", config['id']

# Update an existing config
config['numRowsPerCycle'] = 24
updated = system.mes.oee.saveCalculationConfig(**config)
print "Updated rows per cycle:", updated['numRowsPerCycle']