585,604 active members*
3,264 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > IF and GOTO gcode statements Syntec controller "syntax error"
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2016
    Posts
    3

    IF and GOTO gcode statements Syntec controller "syntax error"

    Hi, wondering if anyone can help with my Syntec FC60WA controller (same as Syntec 6MB)

    If I try and do an IF statement I get a syntax error no matter what I try.
    The reasoning for the IF statement in my code is I want to not turn spindle on for a particular tool. My post processor doesn't allow condition loops (Vetric Aspire) so I'm trying to handle it in gcode.
    So my code would be something like this

    Code:
    #100 = 1 (1 is the tool number)
    N10 M06
    N20 T1
    IF [#100EQ1]GOTO40
    N30 M3 S8000
    N40...
    N50..
    But it throws a syntax error for the line containing the IF loop. If I remove the IF loop and have the GOTO only, it works without error. Can anyone help? Maybe there is another way to do this?
    Thanks

  2. #2
    Join Date
    Jan 2016
    Posts
    3

    Re: IF and GOTO gcode statements Syntec controller "syntax error"

    I have received an email from Syntec they say I need to use a macro, so I am looking into that now.

  3. #3
    Join Date
    Dec 2008
    Posts
    3109
    Quote Originally Posted by jabtronic View Post
    Hi, wondering if anyone can help with my Syntec FC60WA controller (same as Syntec 6MB)

    If I try and do an IF statement I get a syntax error no matter what I try.
    The reasoning for the IF statement in my code is I want to not turn spindle on for a particular tool. My post processor doesn't allow condition loops (Vetric Aspire) so I'm trying to handle it in gcode.
    So my code would be something like this

    Code:
    #100 = 1 (1 is the tool number)
    N10 M06
    N20 T1
    IF [#100EQ1]GOTO40
    N30 M3 S8000
    N40...
    N50..
    But it throws a syntax error for the line containing the IF loop. If I remove the IF loop and have the GOTO only, it works without error. Can anyone help? Maybe there is another way to do this?
    Thanks
    Try using letter O instead of number zero in GOTO

    Sometimes, a space may be needed between addresses
    ie. #100 EQ 1 verses #100EQ1

  4. #4
    Join Date
    Jan 2016
    Posts
    3

    Re: IF and GOTO gcode statements Syntec controller "syntax error"

    What the Syntec guy said in his email was that I can do this using "macro" instead of your standard ISO gcode, to me it appears to be similar code but the main exception is there needs to be %@MACRO header line at the beginning of the file, and every line of code needs to end with ;
    He gave an example:

    Code:
    %@MACRO
    #100 = 1;
    IF #100 = 1 THEN
       GOTO 200;
    END_IF;
    M30;
    I did a quick test and it appears to work, I will need to rewrite the post processor to format the file the way that is is required.

  5. #5
    Join Date
    Jan 2005
    Posts
    304

    Re: IF and GOTO gcode statements Syntec controller "syntax error"

    I have found that on some controls I need to use brackets around the variable number.

    IF[[#100]EQ1]GOTO40

    Try that to see.

Similar Threads

  1. Problem with "GOTO ZERO" & returning to where I started
    By originalsigns in forum UCCNC Control Software
    Replies: 5
    Last Post: 09-27-2019, 08:52 AM
  2. Replies: 1
    Last Post: 11-16-2017, 06:33 PM
  3. K2 with kmotionCNC "G Code Error GCode Aborted"
    By Dimebag_cnc in forum Dynomotion/Kflop/Kanalog
    Replies: 4
    Last Post: 09-28-2015, 08:59 PM
  4. Replies: 0
    Last Post: 05-22-2015, 09:00 AM
  5. Replies: 5
    Last Post: 09-22-2014, 04:05 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
  •