update:
I can get IF/GOTO to work, but not IF/THEN. I could make it work with GOTOs, but it'd be a lot simpler and use less lines to use THEN...
I'm trying to use a macro I wrote for serial#'s that worked in a fanuc31i and 18i. I'm not sure the exact contoller, but its a yasnac on a 1997 matsurra mc-800vf (says matssura i80 on the side?). I can get basic addition functions to work, but it I use GOTO or IF, AND, THEN, I get an 0101 adress/data alarm. if I clear the variable or set them so the logic is NOT satisfied, it runs through fine. EX: [with #501 set to 2 and #502 set to 1] IF #501 LT #502....But #501=#501+1 works fine. Is there some parameter I need to switch? Could this control ust not support logic that intense?
Last edited by lpgoldtop; 04-09-2012 at 01:22 PM. Reason: smiley
update:
I can get IF/GOTO to work, but not IF/THEN. I could make it work with GOTOs, but it'd be a lot simpler and use less lines to use THEN...
there aren't any standard Fanuc parameters that would make it work differently. You would need to consult the Yasnac manuals to know for sure.
Last edited by fordav11; 04-11-2012 at 07:16 AM.
THEN is legal tender in both Fanuc and Yasnac User Macro language, but its used in the following format. Any other Operator (NE, GT, LT, etc), or Logical Function (OR, AND, XOR) can be used in the comparison. The abbreviation TH can also be used in place of THEN.
IF [#1 EQ #2] THEN#3=0
Regards,
Bill
that's exactlly what I was trying to do, but it dididn't like it.
IF #501 GT 9 THEN #501=#501+1
(this controller dosen't need the brackets for some reason)
this gives me an alarm, but the following works
IF #501 GT 9 GOTO1
N1 #501=#501+1
changing the variable #'s still gives alarms, as dose trying EQ or LT. But they all work fine if I use GOTO and put my result on another block.
still get the alarm
According to the I-80 manual, you can use the following:
IF #501 GT 9
#501=#501+1 (macro statement, one block only)
In this example if the test is true, it will execute the following block, otherwise it will skip it and continue execution in the block after.