Process Control
Description
The Process Control task () is used to initiate a specific process within the same protocol based on an upstream condition or the type of labware entering the process.
 
Task is available for...
Task is available in...
Any device
Main Protocol
When to use Process Control instead of Spawn Process 
The Process Control task extends the functions of a Spawn Process task with simplified implementation in a protocol. Instead of adding multiple Spawn Process tasks in one process, you can simplify the protocol by adding a single Process Control task.
For example, suppose you have two devices in a device pool. You want to design the protocol such that if the first device is busy, the system will use the second device.
You can write the protocol in one of two ways:
Add two Spawn Process tasks, one for using each device. The required JavaScript will be distributed across the two Spawn Process tasks and a separate JavaScript task, thus making debugging and future updates difficult.
 
Add a single Process Control task that controls the use of both devices. The required JavaScript is consolidated in the Process Control task, thus facilitating debugging and future updates.
 
Task parameters 
After adding the Process Control task at the desired point in the protocol, set the following parameters in the Task Parameters area:
 
 
Parameter
Description
Process to trigger option 1—9
One of the processes that will be initiated when the run reaches the Process Control task.
Select the process that you want to initiate. For example, if you have two potential processes to initiate, Destination1 and Destination2, select Destination1 for Process to trigger option 1 and Destination2 for Process to trigger option 2.
One of the following options determine which process will be initiated:
If the Process variable name is blank, the Process selection value determines which process will be initiated.
If the Process variable name specifies a name, the Process selection value is not used, and instead the first Process to trigger option with a process name that matches the Process variable name determines which process to spawn.
Process as subroutine
The option to run the initiated process as a subroutine (or subprocess) of the current process.
Select the check box if you have data, such as barcode information, from the current process that you want to pass to the initiated process.
Clear the check box if the two processes can run in parallel when the current process reaches the Process Control task. In this case, the task will use the Spawn parameter property if it is specified.
Process selection value
The value that determines which process to initiate if the Process variable name is blank. For example, if you specify 5, then the process you selected for Process to trigger option 5 will initiate.
You can also specify a variable. During the protocol, the value of the variable (1, 2, 3,..., or 9) is passed to the Process Control task from an upstream task or from the Process Control task JavaScript. The value determines which process to run. If the value is 1, the specified process for Process to trigger option 1 will initiate; if the value is 2, the specified process for Process to trigger option 2 will initiate; and so on.
Process variable name
The name of the process to initiate. Do one of the following:
Leave this property blank if you want the Process selection value to determine which process to initiate.
For example, in the preceding Task Parameters figure:
Process selection value =processoption
In this example, the process to be launched will be determined by the processoption JavaScript variable's numeric value. If processoption is 1, the Destination Plate 1 process will be spawned. If processoption is 2, the Destination Plate 2 process will be spawned.
Specify a name that matches the name of the process in the Process to trigger option that will determine which process to spawn.
Use this option if you want to specify the process to spawn by its name, rather than by its number. For example, suppose you had a JavaScript variable named procNameToSpawn, which through scripting contains a string that contains another process name, such as Destination Plate 1. In this case, you could set the following:
Process variable name =procNameToSpawn
In this case, the Process selection value will be ignored, and the process spawned will be:
Destination Plate 1 (Process to trigger option 1) if procNameToSpawn is Destination Plate 1, or
Destination Plate 2 (Process to trigger option 2) if procNameToSpawn is Destination Plate 2
Note: If procNameToSpawn is set to any string other than the name of a process that appears in the Process to trigger option list, the task will instead use the Process selection value to determine which process to spawn.
Spawn parameter
The option to enter a string, used by a script, to identify which process spawned a given spawned process. In the spawned process or processes, plate.spawnParameter will be set to whatever value appears in the Spawn parameter property. This property can be set to a scripted value or set in the task's script.
Note: If Spawn a subroutine is selected, Spawn parameter is not used.
Example 
Goal
Downstack microplates from the Labware Stacker, scan the microplate barcode, read the microplate using an available Envision Reader, and then upstack the microplate to an available Labware Stacker.
Use the pool of two Envision Readers during the protocol run:
If the first reader is busy, use the second reader.
If the second reader is busy, use the first reader.
If both readers are busy, wait 2 seconds and check each reader again.
Set variables for the following purposes:
Determine which Envision Reader to use. In the example, the variable used for this purpose is procoption.
Determine the state of the first Envision Reader. Valid values are true (busy) and false (available for use). In the example, the variable used for this purpose is bEnvision1Busy.
Determine the state of the second Envision Reader. Valid values are true (busy) and false (available for use). In the example, the variable used for this purpose is bEnvision2Busy.
Implementation
Create a protocol as shown.
Note: The barcode reader is attached to the platepad, so a Place Plate task is added to scan the microplate barcode at the platepad.
 
In the Protocol Options Startup Script, add JavaScript to reset all relevant variables at the start of the run. Set the Envision Reader busy state (bEnvision1Busy and bEnvision2Busy) to false, and set the procoption to 0.
 
Before setting the task parameters, add JavaScript to the Process Control task to determine which Envision Reader to use. (The script is run before the Process Control task is performed.) The script logic is as follows:
The system checks to see if the first Envision Reader is available. If it is, procoption is set to 1.
If the first Envision Reader is busy, the system checks the second Envision Reader. If it is available, procoption is set to 2.
If both devices are busy, the system will wait 2 seconds before checking the devices again.
 
Set the Process Control Task Parameters as shown.
Notice that the process selection variable is procoption. This variable determines which process to initiate. The value of this variable is passed from the Process Control JavaScript. If procoption = 1, the task will initiate option 1: Envision 1. If procoption = 2, the task will initiate option 2: Envision 2.
Select Process as subroutine. The microplate barcode information is retained during the Envision processes.
 
Add the JavaScript as shown in each Envision Reader process to set the Envision Reader busy state to false. After the microplate-reading is finished, the devices are available for other labware.
 
Related information
 
For information about...
See...
Adding devices
Device user guide
Adding tasks in a protocol
Wait For task
Liquid-handling tasks
Microplate-handling tasks
Microplate-storage tasks