Chapter 7 Macro TC-32B
2004/01/22 7 - 4 eTCOMNCPR7-1.doc
7
[Example 2] #100 = #[100+10]
This formula specifies that the value stored in variable #110 is
written to #100.
[Example 3] When #1 = 9, #9 = 20, and #20 = 30,
#5 = # [# [#1]] is equal to #5 = 30.
A variable can be used instead of designating a numerical value.
[Example 4] #3=#2+10;
G01X#3Y10;
This formula specifies the X coordinate as the value stored in
variable 2 with 10 added to it.
(If #2 is 40, X#3 is 50.)
When a variable is used as address data as shown in example 4, however, the values
below the significant digits used as address data are rounded off.
Note that an alarm will occur if the value rounded off to the nearest significant digit
exceeds the maximum address command value.
[Example] Assume that the G00X#1; command is used for a machine with a
significant digit setting of 1/1000.
When #1 is 12.345678, the command format will be G00X12.346.
Variable cannot be quoted in address N.
[Example 5] N#20 cannot be used.
7.2.3 Undefined variable
When the value of the variable is not defined, it is called a “NULL” variable.
#0 is always a “NULL” variable. This can be read but cannot be write.
e.g.1 When #1 is <Blank>.
G01X#1Y100. → G01Y100.
G01X [1+10. ]Y100. → G01X10. Y100.
e.g.2 Calculation
#0 + #0 → 0
#0*5 → 0
e.g.3 Condition formula
When #1 is <Blank> When #1 is 0 (zero)
#1 EQ #0 → Established
#1 NE 0 → Established
#1 GE #0 → Established
#1 GT 0 → Not established
#1 EQ #0 → Not established
#1 NE 0 → Not established
#1 GE #0 → Established
#1 GT 0 → Not established
For EQ and NE, <Blank> is considered not equal to 0 (zero).