Passing Variables To and From BASIC Scripts

From PC-DMIS code, you can only pass variables to BASIC scripts and not from BASIC scripts.

The only variable types that you can pass into BASIC scripts from PC-DMIS are:

Variables are passed as comma-separated values (known as arguments). You define these in the FUNCTION/ statement within the SCRIPT/FILENAME code block. The FUNCTION/ statement specifies not only the arguments, but also the subroutine within the script that takes the passed values. By default, this line initially reads:

FUNCTION/Main,SHOW=YES,,

This means that the subroutine named "Main" takes the arguments. SHOW=YES shows or hides the closing ENDSCRIPT/ statement for the command block.

Notice the two commas following SHOW=YES above. These indicate a field where you may define your first argument. Type the value in the field and press the Tab key on your keyboard. PC-DMIS automatically adds "ARG1=" before the first value to indicate that it's the first argument. An additional comma is also added to allow for additional arguments. Any additional arguments have "ARG2=" and "ARG3=" and so on added as prefixes once you define the values.

Consider the examples below.

PC-DMIS variables only hold values during measurement routine execution; at learn time, PC-DMIS variables always have a value of zero.

More:

Example 1: Using the Function Line to Pass Variables

Example 2: Using the GetVariableValue and SetVariableValueMethods to Pass Variables