Page 1 of 2 12 LastLast
Results 1 to 12 of 16

Thread: LOOPING? with Camsoft??

  1. #1
    Registered nelZ's Avatar
    Join Date
    Jun 2008
    Location
    US
    Posts
    173
    Downloads
    0
    Uploads
    0

    LOOPING? with Camsoft??

    Okay, I've had progress. Nobody got squshed in the runaways and the tool it threw at me missed (bad programming on that knuckleball).

    I had a Bandit. It could loop subs etc. I have an Anilam which does as well.

    I have to either, run a subroutine, or loop back in the program a counted number of times.

    I don't see in the literature how this works in Camsoft.

    Any ideas?

    Hey ! Everyone ! Thanks for the help. I can move the machine now. Camsoft sent me 6.4 because it has better logfile info but I have scarily quiet people around me and must go for now with what I've got.

    nelZ
    i build the braces that keep american teeth straight......tick tick tick


  2. #2
    Moderator HuFlungDung's Avatar
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    4826
    Downloads
    0
    Uploads
    0
    Are you running CNCLite, or what package?

    Look in the manual for help on the JUMP command and GOSUB command. Those respective commands are typically used in an M97 and M98 code respectively, and the call is made in Fanuc fashion:
    M97 N_ _ _ R_ _ _
    where N is the line number for the start of the sub and R is the repeats. However, in Camsoft, those letters could possibly be altered to other alphabetic characters, depending on what you want.

    M99 ends the sub and returns to the main program.
    Check the RETURN command for help on this.
    First you get good, then you get fast. Then grouchiness sets in.

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  3. #3
    Registered nelZ's Avatar
    Join Date
    Jun 2008
    Location
    US
    Posts
    173
    Downloads
    0
    Uploads
    0
    There is no GOSUB in the manual for Lite and Plus.

    On page 5-27 it has JUMP listed. It does not seem to work in the following.

    N1 G0X1Y1Z-1
    N2 X0Y0Z0
    N3 JUMP N1

    I'm in MDI when I try. It just does N1, N2 then stops without changing to the "RED Light".

    The book says M98 only comes with the "plus" package.

    nelZ
    i build the braces that keep american teeth straight......tick tick tick


  4. #4
    Moderator HuFlungDung's Avatar
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    4826
    Downloads
    0
    Uploads
    0
    You cannot use the Camsoft Logic commands directly in the gcode window. They would have to be incorporated into the particular Mcode or Gcode.

    I don't recall if it was possible to add some code to the mcodes in CNCLite. You could always try it and see, I guess.

    Take the precaution of not creating a never ending logic loop. You should not reference a line number that occurs before the sub call itself. The sub line number should be unique, and the code for the sub should be placed after the M30 in your program.

    Main program
    code, blah, blah;
    M97 N1000 R1;
    some more gcode in main program;
    M30;
    N1000 (place code for sub after this);
    M99 (end sub, return to main program);

    Edit: note: you'll have to come up with the correct characters to possibly replace N and R if your version uses something different.
    First you get good, then you get fast. Then grouchiness sets in.

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  • #5
    Registered nelZ's Avatar
    Join Date
    Jun 2008
    Location
    US
    Posts
    173
    Downloads
    0
    Uploads
    0
    JUMP
    This command enables the user to jump or switch the execution of the G-code program to a specified G-code line that contains a match for the parameter after the JUMP command. The parameter may be a line number, an axis position, etc of any identical match that can be found in a G-code line. etc.

    You're most likely correct but the above highlights the confusing nature of the manual layouts.

    Thanks,
    nelZ
    i build the braces that keep american teeth straight......tick tick tick


  • #6
    Moderator HuFlungDung's Avatar
    Join Date
    Mar 2003
    Location
    Canada
    Posts
    4826
    Downloads
    0
    Uploads
    0
    I have a very old CNC Lite manual, and it does indicate that you must have a "Bonus Pac" installed to use M98. The question is called: "How do we call Subroutines". The code format is laid out for you in the answer, so I would think you must stick with their variable names "P" which references a subroutine that starts with "O" (the letter not the number) and that repeats would be: "L" and not "R".

    I believe that the way they have written it, the sub program call is actually a subroutine call, as it must still follow the main program M30 as I pointed out above. In a 'real' cnc, a sub program exists elsewhere in memory, but in Camsoft, it would have to be retrieved by calling it with the correct windows path.
    First you get good, then you get fast. Then grouchiness sets in.

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  • #7
    Registered Karl_T's Avatar
    Join Date
    Mar 2004
    Location
    Dassel,MN,USA
    Posts
    1363
    Downloads
    0
    Uploads
    0
    You found,IMHO, the greatest weakness in Camsoft. It doesn't do parametric programming. I wrote a number of special M codes as a work around for looping in Gcode. Here's a clip, the message statements explain how to set up your Gcode to loop.


    MESSAGE
    MESSAGE To use M93 put statement
    MESSAGE {LOOPM93=5} <on its own line>
    MESSAGE N100 <space after this and on its own line>
    MESSAGE <lines of code>
    MESSAGE M93 N100
    MESSAGE the 5 can be any number
    MESSAGE the 100 can be any number
    MESSAGE
    \93=1
    LOADING \55:IF\55=0THENEXIT
    {LOOPM93=LOOPM93-1}
    IF{LOOPM93}>0THENJUMP Nn
    -----M93

    MESSAGE
    MESSAGE To use M94 put statement
    MESSAGE {LOOPM94=5} <on its own line>
    MESSAGE N200 <space after this and on its own line>
    MESSAGE <lines of code>
    MESSAGE M94 N200
    MESSAGE the 5 can be any number
    MESSAGE the 200 can be any number
    MESSAGE
    \93=1
    LOADING \55:IF\55=0THENEXIT
    {LOOPM94=LOOPM94-1}
    IF{LOOPM94}>0THENJUMP Nn
    -----M94

    MESSAGE
    MESSAGE To use M95 put statement
    MESSAGE {LOOPM95=5} <on its own line>
    MESSAGE N300 <space after this and on its own line>
    MESSAGE <lines of code>
    MESSAGE M95 N300
    MESSAGE the 5 can be any number
    MESSAGE the 300 can be any number
    MESSAGE
    \93=1
    LOADING \55:IF\55=0THENEXIT
    {LOOPM95=LOOPM95-1}
    IF{LOOPM95}>0THENJUMP Nn
    -----M95

    MESSAGE
    MESSAGE To use M96 put statement
    MESSAGE {LOOPM96=5} <on its own line>
    MESSAGE N400 <space after this and on its own line>
    MESSAGE <lines of code>
    MESSAGE M96 N100
    MESSAGE the 5 can be any number
    MESSAGE the 400 can be any number
    MESSAGE
    \93=1
    LOADING \55:IF\55=0THENEXIT
    {LOOPM96=LOOPM96-1}
    IF{LOOPM96}>0THENJUMP Nn
    -----M96

    JUMP Nn 'to use write M98 N100 to goto N100, ENDLESS LOOP!!
    -----M97


  • #8
    Registered
    Join Date
    Apr 2003
    Location
    United States
    Posts
    290
    Downloads
    0
    Uploads
    0
    Karl, that was a clever use of IF THEN JUMP to make multiple jumping loops in multiple M codes

    And there's even more methods to do parametric programming and looping, depending if someone has the Lite,Plus or Professional versions.

    First check the CamSoft Corporation Feature Comparison Chart for your version under the titles of:

    Parametric logic language for conditional routines: User prompting
    IF THEN statements to direct program flow & Advanced Math
    Parametric splines, NURBS & 3D offsets a 3D splined profile
    M98 and subroutine calls and return

    In the manual under the title:
    Example of macro variables used in G code program
    Notice the parameters at the top of the G code file example

    Page 8-59 for CNC Professional
    Page 8-25 for CNC Lite/Plus

    Under the Logic Command section see:

    REWIND
    GOTO
    JUMP
    IF THEN
    ISTHERE
    MIDPROGRAM
    GOSUB / RETURN which are the logic equivalents to:

    M98 L# P#
    L#=number of loops
    P#=program number or line number

    The logic commands can be called from G or M codes to customize the system to taste.


    Tech Support
    CamSoft Corp.
    support@camsoftcorp.com
    PH 951-674-8100
    Fax 951-674-3110
    www.cnccontrols.com
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  • #9
    Registered nelZ's Avatar
    Join Date
    Jun 2008
    Location
    US
    Posts
    173
    Downloads
    0
    Uploads
    0
    Thanks Karl!

    Your clip of code stops before M98 & M99 (sub call and return?). I don't know what M93 thru M97 are for.

    nelZ
    i build the braces that keep american teeth straight......tick tick tick


  • #10
    Registered nelZ's Avatar
    Join Date
    Jun 2008
    Location
    US
    Posts
    173
    Downloads
    0
    Uploads
    0
    Karl,

    In each of your M codes you set /93=1. What is this variable? Don't all those M codes do the same thing?



    Camsoft, is there a variable list somewhere in my literature?

    Thanks to one and all.

    nelZ
    i build the braces that keep american teeth straight......tick tick tick


  • #11
    Registered
    Join Date
    Apr 2003
    Location
    United States
    Posts
    290
    Downloads
    0
    Uploads
    0
    nelZ,

    Yes, there are 2 buttons on the face of the main SETUP screen called
    Variable Descriptions and Variable Search
    The descriptions are user defined.


    Tech Support
    CamSoft Corp.
    support@camsoftcorp.com
    PH 951-674-8100
    Fax 951-674-3110
    www.cnccontrols.com
    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)


  • #12
    Registered nelZ's Avatar
    Join Date
    Jun 2008
    Location
    US
    Posts
    173
    Downloads
    0
    Uploads
    0
    Thanks Camsoft. It detects when I use a new variable.

    Karl, the LOADING command saves the program state to the variable \55

    my book describes only values of 1,2,3,4,5 and 6

    your routine EXITs when it is 0

    Camsoft, is a 0 to mean the program is being loaded?
    i build the braces that keep american teeth straight......tick tick tick


  • Page 1 of 2 12 LastLast

    Similar Threads

    1. Need Help!- Fanuc O-T looping cycle
      By Billet Sean in forum General Metalwork Discussion
      Replies: 5
      Last Post: 04-28-2008, 03:11 PM
    2. Program Looping
      By Bohemund in forum CamSoft Products
      Replies: 7
      Last Post: 05-26-2007, 12:08 PM
    3. Sub Looping
      By murphyspost in forum Daewoo/Doosan
      Replies: 8
      Last Post: 12-27-2006, 11:28 AM
    4. E-Stop Looping Errors in CamSoft
      By DA Dave in forum CamSoft Products
      Replies: 1
      Last Post: 05-17-2006, 01:05 PM
    5. Cutting at multiple depths.. looping ??
      By esmiller in forum Mach Software (ArtSoft software)
      Replies: 9
      Last Post: 01-31-2006, 06:48 AM

    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.