Variable - Omron SYSMAC FH Series User Manual

Vision sensor vision system
Hide thumbs Also See for SYSMAC FH Series:
Table of Contents

Advertisement

Variable

Among the values and character strings used in programming, a variable has a unique assigned name and is
used for data that changes. Use a variable for a numeric value or character string that you want to use
repeatedly in a program, but whose specific value or character string changes.
How to Use Variables
Variables are used as shown below.
(Example)
Rem 1. Declare the variable
Dim POSITION#(1)
Rem 2. Assign a value to the variable
A# = 320.0
B# = 310.0
Rem 3. Reference the variable
POSITION#(0) = A#
POSITION#(1) = B#
C# = POSITION#(0) + POSITION#(1)
1. Declare the variable
By declaring a variable, you allocate the data area required for the variable and enable use of the variable
in the remainder of the program. Declaration is only required for array variables, and the Dim function is
used for this purpose. For variables other than array variables, the data area is automatically allocated
when the program is executed, and thus declaration is not necessary.
2. Assign a value to the variable
Assign a value to a variable. Only values of the same data type as the variable can be assigned. In the
case of a variable other than an array variable, the variable can be used without being declared. Add the
type identifier to the end of the name, and use a variable name that is not used by any other variables.
For details on type identifiers, refer to the "Naming Rules for Variables" section.
Reference:
Naming Rules for Variables (p.210)
3. Reference the variable
Reference the value that is assigned to a variable. You can also pass the variable to a macro function as
an argument.
Vision System FH/FZ5 Series
User's Manual (Z340)
Basic Knowledge For Macro Customize
WWW.NNC.IR
5
209
Functions

Advertisement

Table of Contents
loading

Table of Contents