586,094 active members*
3,926 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Fanuc > Correct format for conditional expressions
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2008
    Posts
    7

    Correct format for conditional expressions

    Hi,
    I'm trying to implement software to simulate Fanuc macro B. I read many Fanuc documentation however none gave much information about constructing valid conditional expressions in formal way. Can anybody who has access to Fanuc controller check if expressions such are valid?

    IF [#2 - #3 GT 5 * #4] GOTO 1
    IF [#2 - #3 GT 5 ] GOTO 1
    IF [ #3 GT 5 * #4] GOTO 1

    I know that if the 1st expression is written as [[#2 - #3] GT [5 * #4]] it would sure be valid. I'm asking just in attempt to decipher the underlying format rules which Fanuc keeps as top secret!

  2. #2
    Join Date
    Feb 2008
    Posts
    7

    Re: Correct format for conditional expressions

    Anybody can help?

  3. #3
    Join Date
    Dec 2005
    Posts
    504

    Re: Correct format for conditional expressions

    In my limited macro-b experience, Fanuc is very particular on syntax, especially the proper use of brackets. I don't think your non-bracketed examples would be allowed by the control. Personally, if I was writing an interpreter or simulator I'd enforce strict syntax so when the program is moved to the machine it is guaranteed to run.

    Do you have a copy of the book Fanuc CNC Custom Macros by Peter Smid?

  4. #4
    Join Date
    Feb 2008
    Posts
    7

    Re: Correct format for conditional expressions

    Thanks for the response and advice. I have Smid's book and a few others however I can't find a source that documents the syntax precisely like programming languages' docs. Fanuc docs lacks a lot of detail about macro programming. For example how AND, OR, XOR deal with negative arguments or argument that is bigger than can be fit in 32-bit integer..etc

  5. #5
    Join Date
    Feb 2008
    Posts
    7

    Re: Correct format for conditional expressions

    Useless forum indeed or possibly I should have picked more suitable username

Similar Threads

  1. Expressions of Interest for desktop 4 axis milling machine
    By Hoooooter in forum Australia, New Zealand Club House
    Replies: 0
    Last Post: 11-18-2016, 08:27 AM
  2. Need some help with conditional expressions, I'm lost.
    By SlowSL in forum G-Code Programing
    Replies: 7
    Last Post: 05-18-2016, 07:01 PM
  3. Replies: 3
    Last Post: 12-12-2015, 06:52 AM
  4. Fanuc 16i macro format error on conditional logic
    By kbarnett in forum Parametric Programing
    Replies: 2
    Last Post: 06-09-2015, 04:55 AM
  5. Replies: 0
    Last Post: 12-10-2014, 01:11 AM

Tags for this Thread

Posting Permissions

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