586,308 active members*
3,737 visitors online*
Register for free
Login
Results 1 to 9 of 9
  1. #1
    Join Date
    Jan 2011
    Posts
    9

    custom macro in yasnac?

    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?

  2. #2
    Join Date
    Jan 2011
    Posts
    9
    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...

  3. #3
    Join Date
    Aug 2011
    Posts
    2517
    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.

  4. #4
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by lpgoldtop View Post
    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...
    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

  5. #5
    Join Date
    Jan 2011
    Posts
    9
    Quote Originally Posted by angelw View Post
    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.

  6. #6
    Join Date
    Sep 2010
    Posts
    1230
    Quote Originally Posted by lpgoldtop View Post
    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.
    Try the following:
    IF [#501 GT 9] THEN #501=#501+1

    Regards,

    Bill

  7. #7
    Join Date
    Jan 2011
    Posts
    9
    still get the alarm

  8. #8
    Join Date
    Mar 2003
    Posts
    2932
    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.

  9. #9
    Join Date
    Jan 2011
    Posts
    9
    Quote Originally Posted by dcoupar View Post
    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.
    that worked! Seems for this control I omit the THEN. Weird...

Similar Threads

  1. Replies: 2
    Last Post: 12-19-2012, 01:28 PM
  2. Replies: 3
    Last Post: 02-13-2012, 07:20 PM
  3. Custom Macro B
    By rlgx4 in forum Parametric Programing
    Replies: 7
    Last Post: 08-02-2010, 10:05 PM
  4. "difference between Custom Macro A and Custom Macro B"
    By arulthambi in forum Parametric Programing
    Replies: 4
    Last Post: 10-05-2009, 09:34 PM
  5. Custom macro!!!!
    By chrisryn in forum G-Code Programing
    Replies: 4
    Last Post: 05-28-2008, 04:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •