Skip to main content

system.mes.oee.newOeeMode

Description

Generates an empty, non-persisted OEE Mode object. This object provides the structure required to save a new mode record using system.mes.oee.saveMode.

Permissions

This method does not require any permissions.

Syntax

system.mes.oee.newOeeMode()

Parameters

This method does not take any parameters.

Returns

A JSON representation of an OeeModeDTO object with default values, ready to be populated and saved.

NameTypeNullableDescriptionDefault Value
idStringTrueThe id of the OEE Modenull
locationIdStringFalseIdentifier of the associated locationnull
locationPathStringTruePath to the associated locationnull
codeIntegerFalseInteger value representing the modenull
nameStringFalseName of the modenull
calculationTypeOeeModeCalculationTypeFalseSpecifies how this mode should be factored into OEE calculationsSCHEDULED_PRODUCTION
expectedDurationSourceOeeModeExpectedDurationSourceFalseDefines the source used to determine the expected duration of a scheduled downtime eventSTATIC
expectedDurationExpressionStringTrueIgnition expression to dynamically calculate the expected duration of the mode in secondsnull
expectedDurationDoubleTrueExpected duration of the mode in seconds0.0
colorStringFalseHex color code representing the mode visually"#000000"
notesStringTrueNotes associated with the OEE Modenull
enabledbooleanTrueIndicates whether the OEE Mode is enabledtrue
spare1StringTrueExtra field 1null
spare2StringTrueExtra field 2null
spare3StringTrueExtra field 3null

Code Examples

# Create a new OEE mode object
newMode = system.mes.oee.newOeeMode()

# Now you can set properties on the new_mode object
newMode['locationId'] = 'some-location-id'
newMode['name'] = 'Running'
newMode['calculationType'] = 'SCHEDULED_PRODUCTION'

# To persist the mode, pass it to the saveMode function
# savedMode = system.mes.oee.saveMode(**newMode)