Sepasoft MES Module Suite
getParameterValue(...)
Reads the current value of a batch control recipe parameter for a queue entry, identified either by a BatchQueueEntry or by batch ID. When the batch execution controller is active and the entry is loaded, the value comes from live execution state; otherwise it is read from persisted control logic on the gateway. Warning against calling this in a tight loop for performance reasons.
|
In version 3.81.12 SP2 and later: In MES 3.81.12 SP3, MES 4.83.1 SP3, and later, the batch does not have to be running. Pass a batch ID or a While the batch is loaded and the execution controller is active, the value is the live value. When the batch is not active, the value is the last value stored on the control logic. A parameter with a calculation returns that stored calculated value, or the calculation expression if none is stored. If the recording type does not save to the object, a batch that is not active returns the value from recipe creation or from creating the queue entry. Those recording types are All to History, Last to History, and Changes Not Saved. |
Syntax
Python |
system.mes.batch.queue.getParameterValue(batchQueueEntry, path) system.mes.batch.queue.getParameterValue(batchID, path) |
Parameters
Parameter | Type | Required | Description |
|---|---|---|---|
batchQueueEntry | Required (one overload) | The queue entry whose parameter should be read. Must refer to an entry present on the gateway batch queue. | |
batchID | String | Required (one overload) | The batch ID string; the gateway resolves it to a BatchQueueEntry. Must not be blank. |
path | String | Required | Full parameter path in batch path notation (procedure, unit procedure, operation, step, and parameter). See Location / Paths. |
Return Value
Type | Description |
|---|---|
Object | The parameter’s configured datatype (raw, not necessarily human-readable). For parameters with a calculation when the controller is not active and the entry is not loaded: returns the stored calculated value if present, otherwise the calculation expression string. |
Location / Paths
Paths follow the /Procedure/Unit_Procedure/Operation:Step.Parameter pattern.
The procedure segment may be abbreviated as {}
For example:
/{}.Parameter
/{}:Step.Parameter, /{}/Unit_Procedure.Parameter
/{}/Unit_Procedure:Step.Parameter
/{}/Unit_Procedure/Operation.Parameter
/{}/Unit_Procedure/Operation:Step.Parameter)
The path must be a valid parameter path; invalid paths cause an IllegalArgumentException.
Scope / Availability
Registered on system.mes.batch.queue (Sepasoft Batch / MES).
Gateway: Executes locally against the batch execution manager.
Designer / Client: BatchClientQueueScript delegates to the production RPC proxy (same behavior against the connected gateway).
Excluded / Edge Cases
MES runtime — checkMESSystemStarted() runs first; if the MES system is not started, the call fails.
Missing queue entry — BatchQueueEntry is null → IllegalArgumentException. batchID blank → IllegalArgumentException. Unknown batch ID → BatchQueueEntryNotFoundException. Entry not on the gateway queue (control recipe UUID not found) → BatchQueueEntryNotFoundException.
Invalid parameter path — Not a valid parameter path → IllegalArgumentException with the path in the message.
Idle vs running — If the queue entry is not loaded or the execution controller is not active, values are read from BatchControlLogic via the control recipe (including calculated-parameter behavior above). If the controller is active and the entry is loaded, the value is resolved through friendlyPathToUUIDPath and the active batchExecutionController (live execution semantics).
- Polling — Repeated continuous reads are discouraged for performance (see bundled script description).
Example Usage
Minimal example
Python |
entry = system.mes.batch.queue.getEntry("BATCH-001") temp = system.mes.batch.queue.getParameterValue(entry, "/{}/MyUnitProc:Heat.Phase.Temperature") |
Complex example
Python |
batchID = "BATCH-2026-0142" statePath = "/{}:Mixing.State" # friendly names must match the control recipe try: rawState = system.mes.batch.queue.getParameterValue(batchID, statePath) displayState = system.mes.batch.queue.getParameterValueAsString(batchID, statePath) system.util.getLogger("BatchMonitor").info( "Batch %s state raw=%r display=%s" % (batchID, rawState, displayState) ) except Exception, ex: system.util.getLogger("BatchMonitor").error("Failed to read state: %s" % ex) |
Related Functions
system.mes.batch.queue.getParameterValueAsString(batchQueueEntry, path) / (..., batchID, path) — Same lookup, returns a human-readable String.
system.mes.batch.queue.setParameterValue(...) — Writes a parameter value (with changedBy); use when the batch allows programmatic updates.
system.mes.batch.queue.getEntry(batchID) — Returns the BatchQueueEntry used with the object overload.
system.mes.batch.queue.getParameterOptions(...) — Lists valid linked-object options for parameters driven by MES links.
Sepasoft MES Module Suite