hi, i use something like this when machining many parts from a bar :
presetting program
Code:
NOEX V28 = 0 ( counter )
NOEX V29 = 30 ( parts )
M02
main program
Code:
G50 S1234
NN01 CALL OS01 ( tool description, operation, etc ) ( P comp quadrant ) LINK = turret_post
NN02 CALL OS02 ( tool description, operation, etc ) ( P comp quadrant ) LINK = turret_post
NN03 CALL OS03 ( tool description, operation, etc ) ( P comp quadrant ) LINK = turret_post
IF [ VRSTT NE 0 ] NN99
NOEX V29 = V29 + 1
NN99 IF [ V29 EQ V28 ] NJUMP / NEXIT
IF [ V29 LT V28 ] NN01
NJUMP / NEXIT G00 safe_position
M02
i hope you find it useful do you wish a simpler code, or can you spot what you need ? it is there looook
now your code : replace this " IF[VRSTT NE 0] N101N100 V1=V1+1N101 V1=V1 " with :
Code:
IF [ VRSTT NE 0 ] NJUMP
NOEX V1 = V1 + 1
NJUMP NOEX
take it easy, get a beer
ps : read your book ! or at least read the beer label ...