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:
• The number of parameters can vary, because each labeling device has a different number of formats, and each format has a different number of fields. (In the software, the contents of each field are specified in the Field Composer dialog box.)
• The software uses the destination side of the microplate (south, west, north, or east) as a prefix for the parameter names:
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.
Parameter | JavaScript string |
---|
Date | "[DATE:enum1]" Where enum1: 0 – Use System Format 1 – YYYY/MM/DD 2 – DD/MM/YYYY 3 – MM/DD/YYYY 4 – YY/MM/DD 5 – DD/MM/YY 6 – MM/DD/YY Example: task.East_1 = "[DATE:0]" |
Time | "[TIME:enum1]" Where enum1: 0–12 (12-hour time AM/PM) 1–24 (24-hour time) Example: task.East_1 = "[TIME:0]" |
Counter | "[COUNTER:StartAt:IncBy:TotalNumberOfDigits:IncEveryNPlates:enum1]" Where enum1: 0 – Numeric (0–9) 1 – Alphanumeric (0–Z) Example: task.East_1 = "[COUNTER:0:1:3:2:1]" |
File With Lookup | "[FILEWLOOKUP:filename:keyCol:ValueCol]" Example: task.East_1 = "[FILEWLOOKUP:c:/temp.csv:1:1]" |
File Start at row/col and increment row | "[FILE:filename:startRow:startCol]" Example: task.East_1 = "[FILE:c:/temp.csv:1:1]" |
Static Text | "[STATIC:staticText]" Example: var my_string = "hello world"; task.East_1 = "[STATIC:"+ my_string +"]"; |
CopyBarcode from a different side | task.East_1 = "[BARCODE:copyFromSideEnum1]" Where copyFromSideEnum1: 0 – south 1 – west 2 – north 3 – east Example: 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