NCT Group 2000M, 99M manual Types of Variables, Local Variables #1 through #33

Models: 2000M 99M

1 206
Download 206 pages 27.56 Kb
Page 174
Image 174

20 Custom Macro

Difference between a vacant variable and a 0 - value one in a conditional expression will be

if #1=<vacant>

if #1=0

#1 EQ #0

#1 EQ #0

*

 

*

fulfilled

not fulfilled

#1 NE

0

#1 NE 0

*

 

*

fulfilled

not fulfilled

#1 GE #0

#1 GE #0

*

 

*

fulfilled

not fulfilled

#1 GT 0

#1 GT 0

*

 

*

fulfilled

not fulfilled

20.12 Types of Variables

With reference to the ways of their uses and their properties, the variables are classified into local, common and system variables. The number of the variables tells the particular category to which it pertains.

20.12.1 Local Variables (#1 through #33)

The local variable is a variable used by the macro program locally. If macro A calls B, and reference is made to local variable #i in each of macros A and B, the value of local variable #i at the level macro A will not be lost and will not be re-written after macro B has been called - despite the fact that reference is made to #i in macro B as well. The local variables are used for the transfer of arguments. The matches between the addresses of arguments and the local variables are contained in the Table in the Section describing the procedure of a simple macro call (G65).

The local variable whose address has not been involved in the argument assignment, is a vacant one that can be used optionally.

20.12.2 Common Variables (#100 through #199, #500 through #599)

Unlike the local variables, the common variables are identical throughout the entire program (not only at the given levels of program calls) - regardless of whether they are in the main program, a subprogram or in a macro, or at whatever level of the macro. If accordingly, #i has been used in a macro, e.g. a value has been assigned to it, #i will have the same value in another macro, too, until it is re-written. The common variables can be used absolutely freely in the system, they have no distinguished functions at all.

The common variables from #100 to #199 will be deleted upon a power-off.

The values of common variables #500 through #599 will be preserved even after a power-off. The macro variables #500 through #599 can be made "write-protected" by the use of parameters WRPROT1 and WRPROT2. The number of the first and the last element of the block to be

174

Page 174
Image 174
NCT Group 2000M Types of Variables, Local Variables #1 through #33, Common Variables #100 through #199, #500 through #599