VWorks User Guide : Creating a protocol: advanced topics : About scripting the Print and Apply task

About scripting the Print and Apply task
Print and Apply task parameter exceptions
Unlike other tasks, the Print and Apply task parameters have the following exceptions:
In the following example, MyFormat is specified for the south and west sides of a microplate for fields 1 and 2. The software will append a prefix to each field name to indicate the side. The new field names will be South_1, South_2, West_1, and West_2.
 
Scripting what to print (label content)
When scripting the task parameters for the Print and Apply task, the field parameter must be assigned to a string that encodes what is to be printed. The following table lists the task parameters and the corresponding string options.
Note: When in doubt about available task parameters, add the following script into the task and run: for(x in task){print(x + "::" + task[x])} This script prints all the current task parameters.
 
Where enum1:
Where enum1:
task.East_1 = "[TIME:0]"
Where enum1:
task.East_1 = "[COUNTER:0:1:3:2:1]"
task.East_1 = "[FILE:c:/temp.csv:1:1]"
task.East_1 = "[STATIC:"+ my_string +"]";
Where copyFromSideEnum1:
task.East_1 = "[BARCODE:2]"
Guidelines for scripting where to print the barcode label
About scripting which field to print to
To print on a single side or more than one side, use the following syntax:
task.East_1
where, East is the side of the labware and 1 is field 1.
About scripting the format
Although it is possible to script the format, you must ensure that the scripted format has the same number of fields as the format specified in the protocol.
task.West_Format=3
//script the format
task.West_3 = "[FILEWLOOKUP:C:\\bcf.csv:1:3]"
//script field 3 of format 3
Note: To read and write the field task parameters, the values used are pre-evaluation. For example, to print the current time, you would set the task parameter for field 1 to [TIME:0]. If you print this from JavaScript using print(task.East_1), the result will be [TIME:0], not as the actual time.
Related information