WWW.NNC.IR
Basic Knowledge For Macro Customize Functions
208
Vision System FH/FZ5 Series
User’s Manual (Z340)
Constant
Among the values and character strings used in programming, a constant is a value that never changes and has
a unique assigned name.
Use constants for fixed numeric values and character strings that you want to use repeatedly in a program.
How to Use Constants
Constants are used as shown below.
(Example)
Constant Data Types
Constants that can be used in macro customize functions are shown below.
Integer constants can be written in several bases, including decimal. Base notations that can be used in
macro customize functions are shown below.
A& = 255
AA& = &h7f
B# = 3.14
C$ = "TEST STRING"
Constant type Description Data range Number of bytes per data item
Integer Used for signed integer values.
-2147483648 to
2147483647
4 bytes
Double precision
real number
Used for double precision type
real numbers.
-1.0E30 to 1.0E30 8 bytes
Character string Used for character strings. Up to 255 characters Max. 256 bytes
Base Notation method Example Mathematical notation
Decimal Not required 100, 3456 100, 3456
Hexadecimal &h &hff, &h7fff (ff)
16
, (7fff)
16
Octal &o &o77, &o3447 (77)
8
, (3447)
8
Binary &b &b1111, &b01100111 (1111)
2
, (01100111)
2
When a program that uses hexadecimal constants is displayed using the List function, the hexadecimal notation is
converted to decimal notation.
Example: When a program with "A& = &hff" is displayed using the List function, this is shown as "A& = 255".