UCO run-time deployment and execution
- Last UpdatedFeb 10, 2025
- 3 minute read
Once deployed, all objects within System Platform IDE go through states of Startup, On Scan, Execute, and Off Scan. With the UCO, the following functionality happens during these states.
Startup
-
The first MES application object (UCO, OCO, or SRO) to startup will create a stateful client session to the MES middleware. All subsequent objects will retrieve a reference to the session.
-
All raw reason code expressions will be compiled.
-
If the ProdAttrs.StartJobOnDeploy attribute is set to True, the values of all production attributes will be used and a call to PrepareProductionAttributes method will be made to start a new data entry job.
OnScan
-
When the object goes OnScan, the equipment status primitive will go into the default raw reason code. The default raw reason code will appear in the exposed raw reason code attribute. The default raw reason code will be written to the MES database if the Log Utilization Events property is set to True. All attribute references contained in raw reason code expressions will be resolved and set on advise. The quality of the current raw reason code attribute will be set to initializing.
-
If the object is starting from a check-pointed raw reason code, it will resume with last known raw reason code until a new raw reason code is determined.
-
The input references for production attributes will be resolved and set on advised.
-
The quality of the raw reason code attribute represents an aggregation of the object’s ability to calculate the raw reason code expressions. There is no recording of the quality into the MES database.
Execute
-
During each execution cycle, the equipment status primitive will evaluate each expression associated with a raw reason code to determine if a raw reason code transition has occurred. During evaluation, if any expression encounters an error, the evaluation will stop if ResumeOnError is False and the object will go into an error state. If ResumeOnError is True, the expression with an error will evaluate False and the object will continue with the next expression. Independent of the ResumeOnError setting, the object will reset expression errors and re-evaluate on the next scan cycle.
-
When a raw reason code transition occurs, the published attributes for the entity are:
-
The new raw reason code.
-
The raw reason code description.
-
The raw reason code default reason.
-
The time that the raw reason code was entered. Time entered represents the time that the expression was evaluated as True (not the time any configured delay has expired).
-
The length of time the raw reason code has been active. The time in raw reason code attribute will be updated to reflect the elapsed time since the last raw reason code transition.
-
The configured minimum activation time.
-
The previous raw reason code.
-
If the Log Util Events attribute is True, the new raw reason code is logged to the MES database as a new utilization event. Depending on the setting of the system parameter How to handle raw reason codes when merging utilization events, the Util_Log table might have a new event or might modify the existing event.
-
-
When a raw reason code becomes active (its expression is True, its delay has expired, and it is the highest priority of all RRCs), its delay timer will be reset. All other potential raw reason code delay timers will continue.
-
Production attributes will be logged (set) if the ProdAttrs.StartJobCmd Trigger attribute is set (True).
-
All jobs will be completed if the ProdAttrs.EndJobCmd trigger attribute is set (True).
-
Though the time entered is stored in as a UTC value in the attribute, some clients such as Object Viewer convert the time value to local time for display purposes.
Note: Utilization events are logged in the MES database to the nearest second. If two or more events are logged within the same second, only the final event will remain in the database. Note that the application engine scan rate defaults to 500 ms and can be set even lower.
OffScan
-
The final MES object to go off scan will end the stateful session to the MES middleware
-
All attribute references that were put on Advise during OnScan will be Unadvised. The raw reason code attribute will retain its last known raw reason code, and the quality of the raw reason code attribute will be set to Bad.
-
The quality of the raw reason code attribute represents an aggregation of the object’s ability to calculate the raw reason code expressions. There is no feedback of the quality into the MES database.