PROGRAMMING15. CUSTOM MACRO
B–63604EN/01
264
S The solution ranges from 180° to 0°.
S When #j is beyond the range of –1 to 1, P/S alarm No. 111 is issued.
S A constant can be used instead of the #j variable.
S Specify the lengths of two sides, separated by a slash (/).
S The solution ranges are as follows:
When the NAT bit (bit 0 of parameter 6004) is set to 0: 0° to 360°
Example:
When #1 = ATAN[–1]/[–1]; is specified, #1 is 225.0
When the NAT bit (bit 0 of parameter 6004) is set to 1: –180° to
180°
Example:
When #1 = ATAN[–1]/[–1]; is specified, #1 is –135.0.
S A constant can be used instead of the #j variable.
S Note that the relative error may become 10
–8
or greater.
S When the antilogarithm (#j) is zero or smaller, P/S alarm No. 111 is
issued.
S A constant can be used instead of the #j variable.
S Note that the relative error may become 10
–8
or greater.
S When the result of the operation exceeds 3.65 10
47
(j is about 110),
an overflow occurs and P/S alarm No. 111 is issued.
S A constant can be used instead of the #j variable.
S When the ROUND function is included in an arithmetic or logic
operation command, IF statement, or WHILE statement, the ROUND
function rounds off at the first decimal place.
Example:
When #1=ROUND[#2]; is executed where #2 holds 1.2345, the
value of variable #1 is 1.0.
S When the ROUND function is used in NC statement addresses, the
ROUND function rounds off the specified value according to the least
input increment of the address.
Example:
Creation of a drilling program that cuts according to the values
of variables #1 and #2, then returns to the original position
Suppose that the increment system is 1/1000 mm, variable #1
holds 1.2345, and variable #2 holds 2.3456. Then,
G00 G91 X–#1; Moves 1.235 mm.
G01 X–#2 F300; Moves 2.346 mm.
G00 X[#1+#2];
Since 1.2345 + 2.3456 = 3.5801, the travel distance is 3.580,
which does not return the tool to the original position.
This difference comes from whether addition is performed before
or after rounding off. G00X–[ROUND[#1]+ROUND[#2]] must be
specified to return the tool to the original position.
D ARCCOS #i = ACOS[#j];
D ARCTAN
#i = ATAN[#j]/[#k];
D Natural logarithm
#i = LN[#j];
D Exponential function
#i = EXP[#j];
D ROUND function