Skip to main content
Version: V3 (Ignition 8.3)

system.mes.operation.stopOperation

Description

Stops an Operations object.

Optionally sets the end time. Provide either endDate (a Date) or endDateMillis (epoch milliseconds); if both are given, the millis value takes precedence. If neither is provided, the operation stops now.

Permissions

This method requires the OPERATION.EXECUTE permission.

Syntax

The only required argument is operationId. All arguments may be passed positionally or as keyword arguments.

# Stop now
system.mes.operation.stopOperation(operationId)

# Stop at a specific time (as a Date)
system.mes.operation.stopOperation(operationId, endDate=endDate)

# Stop at a specific time (as epoch milliseconds)
system.mes.operation.stopOperation(operationId, endDateMillis=endDateMillis)

Parameters

ParameterTypeNullableDescription
operationIdString (ULID)FalseThe ID of the operation to stop.
endDateDateTrueThe stop date of the operation. Provide either this or endDateMillis.
endDateMillisLongTrueThe stop date of the operation in epoch milliseconds. Takes precedence over endDate if both are provided.

Returns

Returns a JSON object of the operation execution result for the end of the operation.

Example Usage

# Stop the operation
stoppedOperationResult = system.mes.operation.stopOperation('01JPBCPKSR-972W3V0Y-H00NNSKQ')

# Output the operation execution result of the stopped operation
print(stoppedOperationResult)