WWW.NNC.IR
Basic Knowledge For Macro Customize
Functions
211
5
Optimizing Scenes (Measurement Flows) (Macro Customize
Functions)
Vision System FH/FZ5 Series
User’s Manual (Z340)
Variable Types and Type Identifiers
Variable types that can be used in macro customize functions are shown below. Use a variable type that
matches your use and purpose.
• Temporary variable
This can handle one datum and is the most basic variable.
Type identifiers that can be used with temporary variables are shown below.
• Array Variable
When you want to handle multiple data items of the same data type as a group, you can assign numbers
to temporary variables. Such temporary variables are called array variables. Macro customize functions
enable the use of up to four dimensions of array variables. The element number of an array starts from 0,
and the number of elements is "element number + 1".
Example
Type identifiers that can be used with array variables are shown below.
Temporary variable data type Type identifier Example
Integer & A& = 1
Double precision real number # A# = 12.34
Character string $ AA$ = ”OMRON”
The type identifier cannot be omitted. Always add a type identifier to the end of the variable name.
Rem One-dimensional array with four elements A&(0), A&(1), A&(2), A&(3)
Dim A&(3)
Rem Two-dimensional array with 11 x 11 = 121 elements
Dim B&(10, 10)
Rem Three-dimensional array with 101 x 101 x 101 = 1030301 elements
Dim C&(100, 100, 100)
Array variable data type Type identifier Example
Integer &() A&(1) = 1
Double precision real number #() A#(2) = 12.34
Character string $() AA$(3) = ”OMRON”
• Even if the name is the same, an array variable name and a regular temporary variable name are distinguished.
Example: The variables below are all distinguished.
A&, A&(10), A#(10), A$, A$(10)
• Even if the number of dimensions is different, two arrays with the same variable name are treated as the same
array. In this case, the array defined last is effective.
Example: The variables below are all distinguished.
A&(10), A&(10,10), A&(10,10,10), A&(10,10,10,10)
IMPORTANT
IMPORTANT