Results 1 to 4 of 4

Thread: Repeat Program

  1. #1
    Join Date
    Apr 2005
    Posts
    47

    Default Repeat Program

    If I had a program for a part that looked like this

    MS,1.7,0.5
    JZ,1.000
    J2,0.000,0.000
    J3,12.000,12.000,0.250
    M3,12.000,12.000,-1.000
    M3,24.000,12.000,-1.000
    M3,24.000,24.000,-1.000
    M3,12.000,24.000,-1.000
    M3,12.000,12.000,-1.000
    J3,12.000,12.000,0.250
    J3,0.000,0.000,1.000
    JZ,1.000
    J2,0.000,0.000

    and I wanted to cut a random amount and then quit, would the program look like this?

    MS,1.7,0.5
    JZ,1.000
    J2,0.000,0.000
    start;
    J3,12.000,12.000,0.250
    M3,12.000,12.000,-1.000
    M3,24.000,12.000,-1.000
    M3,24.000,24.000,-1.000
    M3,12.000,24.000,-1.000
    M3,12.000,12.000,-1.000
    J3,12.000,12.000,0.250
    INPUT{"Do you want to cut another part Y/N"}&x
    IF &x=y THEN GOTO start
    If &x=n THEN GOTO end
    end;
    J3,0.000,0.000,1.000
    JZ,1.000
    J2,0.000,0.000

    Thanks
    Mike

  2. #2
    Join Date
    Jul 2004
    Location
    Valcourt, Québec, Canada
    Posts
    1,887

    Default

    Hi Mike!

    That would be more like:

    MS,1.7,0.5
    JZ,1.000
    J2,0.000,0.000
    start: '--- not ; but :
    J3,12.000,12.000,0.250
    M3,12.000,12.000,-1.000
    M3,24.000,12.000,-1.000
    M3,24.000,24.000,-1.000
    M3,12.000,24.000,-1.000
    M3,12.000,12.000,-1.000
    J3,12.000,12.000,0.250
    INPUT "Do you want to cut another part Y/N" &x '--- no need for {} and you might want to give your variable a more explicit name...
    IF &x=y THEN GOTO start
    If &x=n THEN GOTO end
    end: '--- : instead of ;
    J3,0.000,0.000,1.000
    JZ,1.000
    J2,0.000,0.000
    ' ---will you be repeating the cut on the same position over again?!
    ' ---you may want to implement some more code to check for something else that Y or N...

    Everything that's after a ' is a comments (not read, just displayed) by SB3.

    Does that help?

  3. #3
    Join Date
    Apr 2005
    Posts
    47

    Default

    Thanks Paco,

    Yes that helps,I knew from BASIC programing that I would have the general idea right, but would mess up the exact formating and puncuation.

    Thanks Again
    Mike

  4. #4
    Join Date
    Oct 2000
    Location
    Atlanta GA
    Posts
    1,499

    Default

    You can delete these two lines:

    If &x=n THEN GOTO end
    end:

    since even if &x is not equal to n it will go to the next line anyway.

    However if you want to add error-checking you could use:

    input:
    INPUT "Do you want to cut another part Y/N" &repeat
    IF &repeat=y THEN GOTO start
    If &repeat=n THEN GOTO end
    GOTO input
    end:


    Also, you might want to add a J2 just before the INPUT to move the gantry out of the way to make it easier to change the workpiece

Similar Threads

  1. Step & Repeat
    By Brett Whitman in forum Designing and Creating the sbp cutting file
    Replies: 3
    Last Post: 01-09-2017, 02:14 PM
  2. Repeat cuts
    By mkcfl in forum Techniques for Cutting, Drilling, Machining
    Replies: 5
    Last Post: 06-11-2016, 10:14 PM
  3. Repeat a Part
    By mnrite in forum Part Wizard
    Replies: 2
    Last Post: 03-12-2007, 02:21 PM
  4. Need Help on 3d program
    By stockbub in forum Archives2006
    Replies: 8
    Last Post: 12-26-2006, 10:03 PM
  5. HELP WITH A PROGRAM
    By kachina321 in forum Archives2005
    Replies: 2
    Last Post: 05-07-2005, 08:01 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
  •