VWorks Software User Guide : Creating a protocol: advanced topics : Using JavaScript with the CentrifugeAuto task
Using JavaScript with the CentrifugeAuto task
This topic provides two examples of using JavaScript to modify the implementation of the CentrifugeAuto task. For more information about using the CentrifugeAuto task, see CentrifugeAuto.
Counterweight selection
When using the Auto managed counterweight mode, you can use JavaScript to select the counterweight, for example:
if(place.instance%2 == 1)
{
task.Counterweight = "CW1";
}
else
{
task.Counterweight = "CW2";
}
Reduce number of spins for one plate
When running an odd number of microplates with the CentrifugeAuto task in Use 2 protocol plates mode, the second to last plate is spun twice so that the last microplate is paired. Using JavaScript, you can direct the protocol to switch to Auto managed counterweight mode for the last spin, for example:
if((plate.instance == task.numberOfRuns) && (plate.instance%2 == 1))
{
task.skip();
}
if((plate.instance == task.numberOfRuns) && (plate.instance%2 ==1))
{
task.Counterweight = "CW1"
}
else
{
task.skip();
}
Related information
 
For information about...
See...
CentrfiugeAuto task
Using JavaScript in the VWorks software
VWorks-defined functions
Using JavaScript utilities