VWorks User Guide : Creating a protocol: advanced topics : task object

task object
About the task object
The VWorks JavaScript interpreter provides the following objects that can be accessed by a script.
This topic describes the task object properties and methods.
task refers to the currently running task. It allows the properties of the task to be accessed using a standard syntax. Depending on which task is running, a different set of properties might be available.
Properties
The properties available for a task correspond to its task parameters in the Task Parameters area.
To see the properties of a task:
1
2
3
In the Advanced Settings area, type task. in the Script to be executed before task box. The software automatically displays the list of available properties for the task object.
In the following example, the properties for the Aspirate (Bravo) task is shown in the Advanced Settings area. Notice that they correspond to the parameters in the Task Parameters area.
 
Instead of displaying the list of task properties in the Advanced Settings area, you can also list them in the Main Log. Doing so allows you to print the log file and retain a hardcopy of the properties for reference.
To list the task properties in the Main Log:
1
2
3
In the Task Parameters area, click Advanced Settings.
4
Type the following in the Script to be executed before task area:
for (x in task) {
print("task.[" + x + "] =" + task[x]);
}
5
The following example shows the properties for the Aspirate (Bravo) task.
 
Task property data types
A task property can be one of the following data types. You can use the default task parameter value to determine the data type.
 
Array data types
In JavaScript, an array is a built-in object that stores a collection of like values called elements. Each element is accessed by an index value that is enclosed in square brackets. Index values must be non-negative integers.
The following example script declares an array with three elements:
var vehicle_type = new Array(3);
vehicle_type[0] = “car”;
vehicle_type[1] = “truck”;
vehicle_type[2] = “van”;
In the VWorks software, the array data type applies to properties that specify:
Sides of a microplate
In properties that specify the sides of a microplate, the array contains four elements, each representing a side of the microplate, for example:
Well selection
In properties that specify well selection, the array identifies the location of wells and quadrants in a microplate. Well locations are represented by a pair of integers that describe its row and column coordinates: [row, column].
 
 
A quadrant is an evenly spaced array of locations that are accessible by the tips on a pipette head. The following table lists the types of pipette heads and the number of accessible quadrants in various microplates.
 
The following diagram demonstrates the concept of quadrants. The diagram shows a portion of a 384-well microplate and highlights the four quadrants (Q1, Q2, Q3, and Q4) that are accessible by the A1 tip of a 96-channel pipette head. Notice that the green color highlights all of the quadrant 1 (Q1) wells across the microplate.
 
 
 
When specifying well selection, you provide both the well location and quadrant location. For example, the designation for the four quadrants highlighted in the previous diagram is:
[[1,1],[1,2],[2,1],[2,2]]
where the Q1 coordinates are [1,1], Q2 coordinates are [1,2], Q3 coordinates are [2,1], and Q4 coordinates are [2,2].
You can also use variables to represent the row and column coordinates, as the following example shows:
task.Wellselection = [[disp_row,disp_col]]
IMPORTANT Quadrant specifications in the Well Selection dialog box will override task.Wellselection values assigned in the Advanced Settings area.
To cycle through the quadrants in a liquid-handling task, you can use a series of if statements as the following example shows.
var Dispense_Loop;
if (Dispense_Loop == undefined) {
Dispense_Loop = 1;
}
if (isNaN(Dispense_Loop)){
Dispense_Loop = 1;
}
if ((Dispense_Loop < 1)||(Dispense_Loop > 4)){
Dispense_Loop = 1;
}
 
if (Dispense_Loop == 1){
task.Wellselection = [[1,1]];
}
if (Dispense_Loop == 2){
task.Wellselection = [[1,2]];
}
if (Dispense_Loop == 3){
task.Wellselection = [[2,1]];
}
if (Dispense_Loop == 4){
task.Wellselection = [[2,2]];
}
Dispense_Loop++;
print("Dispensing to quadrant "+task.Wellselection+" of Destination plate.");
}
Methods
The task object methods, and the properties of the methods, are specific to the selected task. The following table lists some of the shared methods:
 
task.setGlobalData(string name, string value)
Stores value in name in the Global database.
task.Headmode method
Available only for SubProcess (Bravo). The following method enables selection of a subset of the barrels in the pipette head:
task.Headmode(string args)
The string parameter must contain a comma-separated list of the following four interger values:
 
The following examples show how to use task.Headmode.
 
Related information
 
VWorks-defined functions
Other VWorks-defined objects