Appendix A: Available Scripting Procedures

AddPlan(function_name as String)
Adds a plan to the test sequence. The order of adding plans will be the order of execution. The plan's function must be defined as
function function_name()
No parameters are allowed. The function should return one of the following values:
  • StepNext - The next plan in the sequence is executed.
  • StepPrev - The previous plan in the sequence is executed.
  • StepStop - The entire test plan should stop.
  • StepEnd - The entire test plan has ended.
  • StepStop - The user wants the test plan stopped.
  • StepRepeat - The current plan is to be repeated.
  • StepJump(function_name as String) - The plan with the given function name should be executed.
If the function does not return anything, StepNext is assumed.

A function returns the above values by executing the statement:

function_name = StepNext
Some built in functions like ShowMessage(msg as String) return the values StepNext, StepPrev or StepStop, depending on what buttons the operator clicked, so a function could be coded thus:
function_name = ShowMessage("Press Next to Wash")
Blank(runs as Integer, skip as Integer)
Loads the blank values into Ch(). If skip is greater than one, then PrevCh() contains the second latest blank values. Example:
Blank 1, 2
The runs parameter controls the number of pump cycles.

You may want to use this function for sampling instead of Sample() if you do not want the Sample() feature of early completion based on the differential limits.

Sample(runs as Integer, skip as Integer, max_count as Integer)
Repeatedly samples until the last two samples Ch() and PrevCh() are less than Diff(), if skip is more than one. If skip is less than two, sample is not running in differential mode, and max_count should be one. In this case, the latest readings are in Ch(). Example:
Sample 1, 2, 10
The runs parameter controls the number of pump cycles.

This function returns early if the Diff() differential limits are fulfilled. Use Blank() for sampling if you do not want this feature.

Wash(count as Integer)
Washes a maximum of count times. Wash stops earlier if sample is cleaner than Limit(). See Limit().
WriteWorkbook(xlw as Excel.Workbook,sheetname as String, Row as Integer, Col as Integer, Value)
Writes the value to the cell whose position is specified by Row and Col in worksheet named sheetname which is in xlw created with NewWorkbook().

Typically, three default sheets are created in the new workbook, named Sheet1, Sheet2 and Sheet3.