
Ed. Date Design Description
Date Jan.07.’04 Design. Apprv.
page
-
29/64
FANUC Series 30i-MODEL A
Real time custom macro
A-79350EN
Title
Draw
No.
Condition transition (ZEDGE statement)
After ZEDGE, <conditional-expression> and <real-time-macro-statement> are coded.
// ZEDGE A B (If A becomes true, B is executed.)
//(n) ZEDGE [<conditional-expression>] <real-time-macro-statement>
When <conditional-expression> makes a transition from false to true, an RTM
statement specified after <conditional-expression> is executed.
<conditional-expression> conforms to the custom macro specifications.
With the ZEDGE command, the result of the first evaluation of
<conditional-expression> is always false.
The difference between the ZONCE command and ZEDGE command is that if
<conditional-expression> is false, the RTM statement itself is terminated in the case
of ZONCE, while the evaluation of <conditional-expression> continues until
<conditional-expression> becomes true in the case of ZEDGE. (With a one-shot
real time command, the evaluation of <conditional-expression> continues until the
execution of the NC statement that started operation simultaneously with the
command ends.)
On the rising edge of the G address signal 4.3, the workpiece coordinate on
the third axis is read.
// ZEDGE [#IOG[4,3] EQ 1] #RV[0]=#100103 ;
In the example above, even if the [#IOG[4,3] EQ 1] is true from the beginning,
#RV[0]=#100103 of the RTM statement is not executed. #RV[0]=#100103 is
executed when the result of evaluation of [#IOG[4,3] EQ 1] changes from false to
true.
As in the case of ZONCE, multiple RTM statements can be coded in
<real-time-macro-statement>.
If <conditional-expression-1> specifies an axis control command, be sure to use
ZDO...ZEND even when a single statement is used.
Code the following by using ZDO...ZEND of multi-statement structure:
// ZEDGE [<conditional-expression>] ZDO ;
<real-time-macro-statement-1> ;
<real-time-macro-statement-2> ;
:
ZEND ;