hello again there are 3 codes in this post ; each one requires to change the insert at 9 parts, and handles the tool wear in a specific way
... 1st code requires the operator to input the wear
... 2nd code uses a common variable to store the wear value :
...... 1 - 5 wear = 0
...... 6 - 9 wear <> 0
......... it is up to you to input this variable into the program coordinates
... 3rd code updates the wear field of the wear interface, so no more need to change the program
...... this one is the most elegant : simply input CALL OSUB3 at the end of your program
- codes run on osp300
- input V1 = 0 before running the code, so to begin the counter from an initial value
- small adjustments may be needed for a real situation / kindly
Code:
OSUB1
NOEX V001 = V001 + 1
NOEX LV01 = MOD [ V001 , 9 ]
IF [ LV01 NE 0 ] NJUMP1
NOEX V001 = 0 ( master reset )
M0 ( change insert @ tool 123 )
NJUMP1 NOEX
IF [ LV01 NE 6 ] NJUMP2
M0 ( input tool wear manually )
NJUMP2 RTS ( . . . . . . . . . . . . . . . . . . . . . )
Code:
OSUB2
NOEX V001 = V001 + 1
NOEX LV01 = MOD [ V001 , 9 ]
IF [ LV01 NE 0 ] NJUMP1
NOEX V001 = 0 ( master reset )
NOEX V002 = 0 ( wear reset )
M0 ( change insert @ tool 123 )
NJUMP1 NOEX
IF [ LV01 NE 6 ] NJUMP2
NOEX V002 = -0.156 ( wear updated )
/ M0 ( tool wear updated )
NJUMP2 RTS ( . . . . . . . . . . . . . . . . . . . . . )
Code:
OSUB3
NOEX V001 = V001 + 1
NOEX LV01 = MOD [ V001 , 9 ]
IF [ LV01 NE 0 ] NJUMP1
NOEX V001 = 0 ( master reset )
NOEX VTWOX [ 07 ] = 0 ( wear reset )
M0 ( change insert @ tool 7 )
NJUMP1 NOEX
IF [ LV01 NE 6 ] NJUMP2
NOEX VTWOX [ 07 ] = -0.156 ( wear updated )
/ M0 ( tool wear updated )
NJUMP2 RTS ( . . . . . . . . . . . . . . . . . . . . . )