system.mes.batch.queue.getParameterValueAsString

Sepasoft MES Module Suite

system.mes.batch.queue.getParameterValueAsString(batchQueueEntry, batchId, path)

Retrieves the human-readable value of a batch parameter.

Warning For performance reasons, this function should not be used for continuous polling of batch parameter values.
Note

In version 3.81.12 SP2 and later:

  • Updated to not require a Batch to be running to get the value of a parameter.
    • For parameters that have a Calculation Expression, if the Batch is not active, the last calculated value will be returned, if present, otherwise the Calculation Expression is returned.

  • Can accept either a batchQueueEntry or a BatchID.

Syntax

getParameterValueAsString(batchQueueEntry=None, batchID=None, path)

Parameters

BatchQueueEntry batchQueueEntry - The BatchQueueEntry object to get a batch parameter from.

String path - The path to the batch parameter.

The path must follow the format:

/Procedure/Unit Procedure/Operation:Transition.ParameterName

Example:
/Make Cookies/Mix/Add Flour.Amount Added

Returns

The current batch parameter, returned as a human-readable string.

Scope

All

Accessing Recipe Level Parameter Example

In this batch there is a Recipe, or called Procedure, level parameter that we would like to read.  The parameter is called "MatSerialNum_B".

Python
##Identify or retrieve the Batch ID, typically from a tag, on-screen component, or user selection.
batchID = 'BatchID_12345'

##Define the path to the parameter.  Note carefully the syntax.
path = "/Hot Chocolate Powder.MatSerialNum_B"

##Retrieve the Batch Queue Entry based upon the unique Batch ID.
bqe = system.mes.batch.queue.getEntry(batchID)

##Call the function to the get the parameter value.
val = system.mes.batch.queue.getParameterValueAsString(bqe, path)

Accessing Phase Level Parameter Example

In this batch there is a Unit Procedure with a phase with a parameter that we would like to read.  The parameter is called "LotId_A".

Python
##Identify or retrieve the Batch ID, typically from a tag, on-screen component, or user selection.
batchID = 'BatchID_12345'

##Define the path to the parameter.  Note carefully the syntax.

##Note that the Procedure Level (the "Hot Chocolate Powder" Recipe), then the Unit Procedure ("P2"), then the Phase ("UP2"), 

##then finally the  Parameter ("LotId_A") are listed in the path. Note the colon after the Unit Procedure level.
path = "/Hot Chocolate Powder/P2:UP2.LotId_A"

##Retrieve the Batch Queue Entry based upon the unique Batch ID.
bqe = system.mes.batch.queue.getEntry(batchID)

##Call the function to the get the parameter value.
val = system.mes.batch.queue.getParameterValueAsString(bqe, path)


Sepasoft MES Module Suite