Sepasoft MES Module Suite
executeEntryCommandBlocking(batchQueueEntry, command, timeoutMS=5000, changedBy="operator")
|
New function from version 3.81.12 RC2 and later. |
Runs a batch-level command for a BatchQueueEntry (for example Start, Hold, Reset) and blocks the calling script until the gateway finishes the synchronous command path. This is equivalent to executeEntryCommand with blockingCall=True, but the API always blocks so callers do not pass blockingCall. Use timeoutMS when you issue Hold or Reset and need a bounded wait while the runtime shuts down or unwinds the batch controller.
Syntax
Python |
system.mes.batch.queue.executeEntryCommandBlocking(batchQueueEntry, command) system.mes.batch.queue.executeEntryCommandBlocking( batchQueueEntry, command, timeoutMS=5000, changedBy="operator" ) |
Parameters
Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
batchQueueEntry | Required | — | The queue entry to command. Must exist on the gateway’s batch queue. | |
command | str | Required | — | Batch command to run. Use system.mes.batch.queue.COMMAND_*() (for example COMMAND_RESET()). |
timeoutMS | long / int | Optional | See notes | Milliseconds budget for blocking confirmation waits used with Hold and Reset (for Hold, only when configured remove held from queue behavior triggers a shutdown wait). Product strings describe 5000 ms as the typical default. 0 disables the elapsed-time timeout check during that wait so the call does not fail only because the wait exceeded the budget. Other commands generally ignore this argument. |
changedBy | str | Optional | None | Optional label stored with the change (operator, screen, or script id). |
Return Value
Type | Description |
|---|---|
None | Returns nothing when the call completes without throwing. |
Scope / Availability
Registered on system.mes.batch.queue (Sepasoft Batch / MES).
Gateway: Executes on the gateway that owns the queue entry and process cell.
Designer / Client: Same API; calls go through the production RPC layer to the gateway that owns the equipment (including Enterprise routing when the entry’s process cell is on a peer server).
Excluded / Edge Cases
Same validation and failure modes as executeEntryCommand with blockingCall=True: signatures, wrong server, missing process cell, MES not started, invalid state for the command, unknown command token, and so on.
Start and Abort are entry-level commands; do not use executeStepCommand for them.
Prefer executeEntryCommandAsync when you do not need to wait. Prefer executeEntryCommand when you want to toggle blockingCall and timeoutMS from one call site.
If timeoutMS is omitted for Hold/Reset shutdown waits, the gateway may apply a controller-derived default (for example based on execution interval) in addition to the 5000 ms-style defaults described in product strings—pass timeoutMS explicitly when you need a fixed wall-clock budget.
Example Usage
Minimal example
Python |
entry = system.mes.batch.queue.getEntry("BATCH-2026-0042") system.mes.batch.queue.executeEntryCommandBlocking( entry, system.mes.batch.queue.COMMAND_START() ) |
Complex example
Python |
batch_id = "BATCH-2026-0042" entry = system.mes.batch.queue.getEntry(batch_id) # Blocking reset: wait until the synchronous reset path completes, with a 15s hold budget system.mes.batch.queue.executeEntryCommandBlocking( entry, system.mes.batch.queue.COMMAND_RESET(), timeoutMS=15000, changedBy="cleanupScript" ) # Blocking hold with no timeout-based failure on the shutdown wait system.mes.batch.queue.executeEntryCommandBlocking( entry, system.mes.batch.queue.COMMAND_HOLD(), timeoutMS=0, changedBy="alarmHandler" ) |
Related Functions
system.mes.batch.queue.executeEntryCommand(batchQueueEntry, command, ...) — Same underlying behavior; set blockingCall to choose blocking vs non-blocking.
system.mes.batch.queue.executeEntryCommandAsync(batchQueueEntry, command, ...) — Always non-blocking; no timeoutMS on the script surface.
system.mes.batch.queue.executeStepCommand(batchQueueEntry, stepPath, command, ...) — Step-scoped commands; not for Start / Abort.
system.mes.batch.queue.COMMAND_*() — Canonical command tokens for command.
system.mes.batch.queue.COMMAND_ABORT()
system.mes.batch.queue.COMMAND_HOLD()
system.mes.batch.queue.COMMAND_PAUSE()
system.mes.batch.queue.COMMAND_RESET()
system.mes.batch.queue.COMMAND_RESTART()
system.mes.batch.queue.COMMAND_RESUME()
system.mes.batch.queue.getEntry(batchID) — Obtains the BatchQueueEntry for these calls.
Sepasoft MES Module Suite