Index Manuals FANUC Series 30i/300i/300is-MODEL A. Machining Center System. User's manual (B-63944EN/03)
|
|
|
16.CUSTOM MACRO PROGRAMMING B-63944EN/03
- 508 - Example: When an attempt is made to assign the following values to variables #1
#1=9876543210123.456
#2=9876543277777.777
the values of the variables become:
#1=9876543200000.000
#2=9876543300000.000
In this case, when #3=#2-#1; is calculated, #3=100000.000 results. (The • Also be aware of errors that can result from conditional expressions using EQ, NE, GE, GT, LE, and LT. Example: IF[#1 EQ #2] is effected by errors in both #1 and #2, possibly resulting in Therefore, instead find the difference between the two variables with IF[ABS[#1-#2]LT0.001]. Then, assume that the values of the two variables are equal when the difference does not exceed an allowable limit (0.001 in this case). • Also, be careful when rounding down a value. Example: When #2=#1*1000; is calculated where #1=0.002;, the resulting value of
Here, when #3=FIX[#2]; is specified, the resulting value of variable #3 is
In this case, round down the value after correcting the error so that the
#3=FIX[#2+0.001]
#3=ROUND[#2]
- Brackets Brackets ([ ]) are used to enclose an expression. - Divisor When a divisor of zero is specified in a division, an alarm PS0112 |