Results 1 to 9 of 9

Thread: custom macro in yasnac?

  1. #1
    Registered
    Join Date
    Jan 2011
    Location
    usa
    Posts
    5
    Downloads
    0
    Uploads
    0

    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?
    Last edited by lpgoldtop; 04-09-2012 at 01:22 PM. Reason: smiley


  2. #2
    Registered
    Join Date
    Jan 2011
    Location
    usa
    Posts
    5
    Downloads
    0
    Uploads
    0
    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
    Registered fordav11's Avatar
    Join Date
    Aug 2011
    Location
    Fordaville
    Posts
    1,668
    Downloads
    0
    Uploads
    0
    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.


  4. #4
    Registered
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    987
    Downloads
    0
    Uploads
    0
    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
    Registered
    Join Date
    Jan 2011
    Location
    usa
    Posts
    5
    Downloads
    0
    Uploads
    0
    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
    Registered
    Join Date
    Sep 2010
    Location
    Australia
    Posts
    987
    Downloads
    0
    Uploads
    0
    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
    Registered
    Join Date
    Jan 2011
    Location
    usa
    Posts
    5
    Downloads
    0
    Uploads
    0
    still get the alarm


  • #8
    Registered dcoupar's Avatar
    Join Date
    Mar 2003
    Location
    USA
    Posts
    2,502
    Downloads
    0
    Uploads
    0
    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
    Registered
    Join Date
    Jan 2011
    Location
    usa
    Posts
    5
    Downloads
    0
    Uploads
    0
    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, 07:28 AM
    2. Replies: 3
      Last Post: 02-13-2012, 01:20 PM
    3. Custom Macro B
      By rlgx4 in forum Parametric Programing
      Replies: 7
      Last Post: 08-02-2010, 05: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, 04:34 PM
    5. Custom macro!!!!
      By chrisryn in forum G-Code Programing
      Replies: 4
      Last Post: 05-27-2008, 11:13 PM

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.