
Ed. Date Design Description
Date Jan.07.’04 Design. Apprv.
page
-
31/64
FANUC Series 30i-MODEL A
Real time custom macro
A-79350EN
Title
Draw
No.
Explanation
While <conditional-expression> is true, the command or commands between ZDO
and ZEND after ZWHILE are executed.
If <conditional-expression> is not satisfied, the command after ZEND is processed.
The same conditional expression and operators as for the ZONCE statement are
used.
While the F address 234.1 signal is 1, an incremental movement on the
U-axis is repeatedly performed, and #RV[0] is incremented by 1 each
time.
//1 ZWHILE [#IOF[234,1] EQ 1] ZDO ;
G91 G00 U10. ;
#RV[0] = #RV[0]+1 ;
ZEND ;
Multi-statement (ZDO...ZEND statement)
//(n) ZDO ;
<real-time-macro-statement-1> <real-time-macro-statement-2> <real-time-macro-statement-3> …
ZEND ;
One or multiple statements enclosed in ZDO...ZEND are regarded as a one RTM
statement (multiple-statement structure).
The maximum number of RTM statements in one multi-statement (between
ZDO...ZEND) is subject to change (Because it depends on the contents of RTM
statements).
ZDO...ZEND is used in the following cases:
・When multiple real time statements are handled as a series of commands
When condition is false
ZWHILE
[conditional-expression]
ZDO ;
ZEND ;
Real time macro
statement
When
condition
is true
* When the real time macro statement is a single statement and is not
an axis control statement, ZDO and ZEND are not required.
* When “conditional-expression” is fulfilled and “Real time macro
statement” is complete,
interpolation cycle time has passed before the next evaluation o
"ZWHILE conditional-expression".