699
12
12 Subprogram
12.4 Application of a Subprogram with Parameters
5) Indicating incorrect variable names
●
AutoShop marks in red and underlines incorrect variable names.
6) Variable type
Variable Type Description
IN
To transmit a value to a subprogram, create a variable in the variable table
of the subprogram and specify the variable type as IN.
OUT
To return a value established in a subprogram to the calling program, create
a variable in the variable table of the subprogram and specify the variable
type as OUT.
IN_OUT
The value specifying the parameter position is transmitted to a subprogram,
and the result is returned from the subprogram to the same address.
• A maximum of 16 IN, OUT, and IN_OUT parameters are dened.
7) Data type
BOOL data, 16-bit integers, 32-bit integers, and oating-point numbers are supported.
12.4.3 Calling a Subprogram with Parameter
Enter
CALL
and press
Space
. The
Call Subprogram
window is displayed. Select the desired subprogram
with parameters. As parameter names have been entered, the subprogram alias is displayed. Enter
parameters to be input and output.
• Red text indicates invalid syntax.
• A variable name must not start with a
digit.
• A variable name must not be a keyword.
• A variable name must not be reused.