Newbie Looping


Results 1 to 8 of 8

Thread: Looping

  1. #1
    Registered
    Join Date
    Feb 2018
    Location
    United Kingdom
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default Looping

    Hi All,

    I'm completely new to G code and I'm using it to control the positioning and firing of a laser for my master's project. I've written the code to make it fire and it works fine, but once I put my code into a loop to fire more than 3 times, some of the laser pulses are missed out. I've written the code out without any loops and it works fine but it's ridiculously long and messy code as any kind of loop - For, While, even using an If - causes some shots to be missed out. I've included the code I have below, any help would be greatly appreciated.

    PSOF,1
    DW 1
    PSOF,0
    DWELL 1000

    Copying and pasting this 15 times works great, but:

    LOOP 15
    PSOF,1
    DW 1
    PSOF,0
    DWELL 1000
    NEXT

    misses out a couple of shots.

    Many thanks for any help.

    Mike

    Similar Threads:


  2. #2
    Member
    Join Date
    Feb 2013
    Location
    Brazil
    Posts
    33
    Downloads
    0
    Uploads
    0

    Default Re: Looping

    Which control software are you using or running this?



  3. #3
    Registered
    Join Date
    Feb 2018
    Location
    United Kingdom
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by cebaldocchi View Post
    Which control software are you using or running this?
    Hi,

    I'm using Unidex 500 MMI W32 version 5.10.

    Thanks for your help.

    Mike



  4. #4
    Member
    Join Date
    Nov 2007
    Location
    Canada and Nothern ireland
    Posts
    351
    Downloads
    0
    Uploads
    0

    Default Re: Looping

    This looks like "Basic" not G code for CNC
    If it is Basic or Visual

    For i= 1 to 15
    PSOF,1
    DW 1
    PSOF,0
    DWELL 1000
    NEXT i



    If its for G code then use DO while Statements



  5. #5
    Member
    Join Date
    Mar 2016
    Location
    United States
    Posts
    59
    Downloads
    0
    Uploads
    0

    Default Re: Looping

    Quote Originally Posted by lshingleton View Post
    This looks like "Basic" not G code for CNC
    If it is Basic or Visual

    For i= 1 to 15
    PSOF,1
    DW 1
    PSOF,0
    DWELL 1000
    NEXT i



    If its for G code then use DO while Statements
    +1

    This is what G code looks like:

    N0002 G90
    N0003 G70
    N0005 M145 D0
    N0006 AL0.0
    N0007 G04
    N0008 G41
    N0009 M145 D0
    N0010 M63
    N0011 G160 P1
    N0012 G00 X0.709 Y-0.630
    N0013 M177
    N0014 M65
    N0015 AL-15.0
    N0016 G01 X0.906 Y-0.630
    N0017 M35
    N0018 G01 X1.102 Y-0.630
    N0019 G01 X3.465 Y-0.630
    N0020 AL-30.0
    N0021 G01 X4.252 Y-0.630
    N0022 G01 X6.614 Y-0.630
    N0023 AL-45.0
    N0024 G01 X7.402 Y-0.630
    N0025 G01 X9.764 Y-0.630
    N0026 AL0.0
    N0027 G01 X10.551 Y-0.630
    N0029 G01 X13.701 Y-0.630
    N0030 G01 X13.701 Y-3.630
    N0030 G01 X13.701 Y-4.500
    N0030 G01 X13.701 Y-3.630
    N0031 G01 X10.551 Y-3.630
    N0032 M176
    N0033 AL-45.0
    N0034 G01 X9.764 Y-3.630
    N0035 G01 X7.402 Y-3.630
    N0036 AL-30.0
    N0037 G01 X6.614 Y-3.630
    N0038 G01 X4.252 Y-3.630
    N0039 AL-15.0
    N0040 G01 X3.661 Y-3.630
    N0041 M57
    N0043 AL-15.0
    N0044 G01 X3.465 Y-3.630
    N0045 G01 X1.102 Y-3.630
    N0046 G01 X0.315 Y-3.630
    N0047 M35
    N0048 AL0.0
    N0049 G01 X1.102 Y-4.418
    N0050 G01 X1.102 Y-3.630
    N0051 G01 X1.102 Y-1.960
    N0052 M58
    N0053 G01 X1.102 Y-1.024
    N0054 M57
    N0055 G01 X1.102 Y-0.630
    N0056 G01 X1.102 Y-0.315
    N0057 M66

    This is what ESSI code looks like:

    145+0
    5
    +50+1650
    6
    76
    51
    29
    53
    122+150
    +200+
    +600+
    122+300
    +200+
    +600+
    122+450
    +200+
    +600+
    122+0
    +200+
    +300+
    77
    +



  6. #6
    Registered
    Join Date
    Feb 2018
    Location
    United Kingdom
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by lshingleton View Post
    This looks like "Basic" not G code for CNC
    If it is Basic or Visual

    For i= 1 to 15
    PSOF,1
    DW 1
    PSOF,0
    DWELL 1000
    NEXT i



    If its for G code then use DO while Statements
    Hi,

    These are the commands that the user manual state so tjey are the ones I've used. I will try the above approach of a Do while though not in the lab until next week but I'll message and let you know how it goes.

    Thanks,

    Mike



  7. #7
    Member
    Join Date
    Mar 2016
    Location
    United States
    Posts
    59
    Downloads
    0
    Uploads
    0

    Default Re: Looping

    I think you've missed the point.
    What your manual is telling you to use is not "G" code. Hence, asking for G code help will get you no where. Even trying the D0 statement at the beginning will be useless because the machine post processor isn't interpreting G code, but something else.
    Your best line of support is going to be the manufacturer - the folks who wrote the software.
    Best of luck



  8. #8
    Registered
    Join Date
    Feb 2018
    Location
    United Kingdom
    Posts
    4
    Downloads
    0
    Uploads
    0

    Default

    Quote Originally Posted by bytor View Post
    I think you've missed the point.
    What your manual is telling you to use is not "G" code. Hence, asking for G code help will get you no where. Even trying the D0 statement at the beginning will be useless because the machine post processor isn't interpreting G code, but something else.
    Your best line of support is going to be the manufacturer - the folks who wrote the software.
    Best of luck
    Hi,

    Thanks for the advice. I'll look to contact the software manufacturer.

    Regards,

    Mike



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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Looping

Looping