This article describes how to use modules with parameters as re-usable script parts that can help to avoid script redundancy.
A Module is a special type of script that can be inserted into other scripts. Modules will be executed as a synchronous subroutine, meaning when a script calls a module, it waits for the called module to finish before execution of further script lines will be continued.
Modules can be useful to store common script parts that can be re-used for multiple scripts. By using modules, one can avoid the need to (re-)create the same script part multiple times for individual scripts. Further, if a module requires a change, it only needs to be implemented at the module to take effect for all scripts which are calling that module.
A script can be defined as a Module by enabling the checkbox ‘Use as module’.
Modules can be found in a separate category at the Controlbar:
A module can then be inserted to another script by dragging the module directly from the Control Bar to the script editor area. The module will then be added into the script the same way as other script lines.
In case you wanted to call a module asynchronously instead (start module and continue main script in parallel), then one could add the module within an asynchronous subroutine.
Example:
Let us assume there are several assay scripts, however each individual assay script shall perform a common script part where the operator loads a tube runner with a variable number of sample tubes to a Fluent ID carrier, the number of loaded tubes will be determined, followed by an optional dilution step with the FCA.
Whether or not the optional dilution step will be performed at runtime and the specific labware to aspirate the diluent from shall be given by a variable of scope Parameter that is mandatory to be assigned to the module at runtime, when it is called by another script.
When that module is added to a script and you expand its script line, there will automatically appear a list of all variables of scope Parameter at the section ‘Transfer values to module’ (as shown below). It is mandatory to assign a value to all variables of scope Parameter.
Further at the section ‘Transfer variable values from module to main script’ it also allows to return variables form the module (subroutine) to the main script.
If there exists a Query text at the Variables declaration section of the module, it will be shown as a tool tip when hovering the mouse over the corresponding Variable in subroutine field.
This way, the same module can be (re-)used across multiple assay scripts and script-specific Parameters will be assigned from the script when calling the module.
Further Help
For further help, please refer to our Helpdesk.
Link to Tecan Product Page:
401815-027