584,800 active members*
4,760 visitors online*
Register for free
Login
Results 1 to 5 of 5
  1. #1
    Join Date
    Aug 2005
    Posts
    2

    'IF' problem on MK1

    I've been freaking out for a while.
    Anyone who knows the CNC USB Controller software (ver 2.10), can explain to me why in this program below, when the condition of the if is not verified, the instructions after the endif are not executed, while if the condition is true they are performed? Being after the endif they should not be conditioned, it is as if all the rest of the program after the endif were considered as an integral part of the code to be executed in the event of a verified condition, that is, as if the endif was not there.


    %
    #1=0 (x CENTRO)
    #2=0 (y CENTRO)
    #3=20 (RAGGIO)
    #4=5 (FINITURA)
    #5=0 (profondita iniziale)
    #6=-10 (profondita finale)
    #7=5(profondita passata)
    #8=#5 (profondita attuale)
    G00 Z5
    G00 X#1 Y#2
    G00 Z#5

    O140 do
    #8=[#8-#7]
    G01 x#1 Y#2 Z#8
    G17 G02 X[#1+#3-#4] Y#2 R[[#3-#4]/2]
    G02 X[#1-#3] Y#2 I[[#4/2]-#3]
    G01 X[#1-#3] Y#2
    G02 X[#1-#3] Y#2 I#3
    O140 while [[#8-#6] GE #7]

    O5 if[#8 NE #6]
    G01 x#1 Y#2 Z#6
    G17 G02 X[#1+#3-#4] Y#2 R[[#3-#4]/2]
    G02 X[#1-#3] Y#2 I[[#4/2]-#3]
    G01 X[#1-#3] Y#2
    G02 X[#1-#3] Y#2 I#3
    O5 endif

    G01 X#1 Y#2
    G00 Z#10
    %

  2. #2
    Join Date
    Aug 2011
    Posts
    252

    Re: 'IF' problem on MK1

    Because your #6=-10 (profondita finale)
    And you have O140 while [[#8-#6] GE #7] -> that is 5-(-10)
    Try
    O140 while [[#8+#6] GE #7]
    and I guess it should work
    Best Regards

  3. #3
    Join Date
    Aug 2005
    Posts
    2

    Re: 'IF' problem on MK1

    Quote Originally Posted by adidoro View Post
    Because your #6=-10 (profondita finale)
    And you have O140 while [[#8-#6] GE #7] -> that is 5-(-10)
    Try
    O140 while [[#8+#6] GE #7]
    and I guess it should work
    Best Regards
    The malfunction is not on cicle Do While. This cicle is done correctly. The problem is after. On block o5 and into istruction after IF condition. The cicle do While work and terminate good.

  4. #4
    Join Date
    Aug 2011
    Posts
    252

    Re: 'IF' problem on MK1

    My mistake, I will look closely to code.

  5. #5
    Join Date
    Aug 2011
    Posts
    252

    Re: 'IF' problem on MK1

    Now that I have the new TNG software I run your code in simulation and worked, so the code is fine.
    In older planet CNC software for mk1 did not work.

Similar Threads

  1. Replies: 1
    Last Post: 11-24-2017, 03:56 AM
  2. Fadal Idler problem. Rpm pulse problem
    By complextool in forum Fadal
    Replies: 1
    Last Post: 10-07-2016, 06:28 PM
  3. Tube problem or powersupply problem? Help you to check out
    By Melody-gweike in forum Laser Engraving / Cutting Machine General Topics
    Replies: 0
    Last Post: 10-05-2012, 04:09 AM
  4. daewoo puma 12lb tape format problem/parameter problem
    By robb12877 in forum Daewoo/Doosan
    Replies: 0
    Last Post: 08-25-2011, 06:13 AM
  5. Replies: 5
    Last Post: 08-04-2010, 11:33 PM

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
  •