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
%