I am trying to get the text from the PPRINT to come after the tool change and just cant seem to figure it out. I can get the Tool Name to go there (I've gotten the Tool Offset Number there as
well) but I would really like it all there. Here is what I have now in the Cimfil section:
CIMFIL/ON,PPRINT $$ starts on all PPRINT
MESS = TEXT/CLW $$ extract the text of the PPRINT
TESTV=TEXT/'TOOL NAME'$$ Value to test for
RSLT=INDXF(MESS,TESTV)$$ Test if TESTV is in MESS
IF(RSLT.EQ.0) THEN
PPRINT/MESS $$ process the PPRINT
ELSE
OKTOOL=1 $$ flag tool name programmed
TOOLNM=TEXT/MESS $$ store tool name
ENDIF
CIMFIL/OFF $$ end of CIMFIL on PPRINT
CIMFIL/ON,LOADTL $$ starts on all LOADTL
DMY = POSTF(20) $$ save current CL record
IF(FTOOL.EQ.0) THEN $$ check if first tool change
FTOOL=1 $$ reset the flag
SEQNO/OFF $$ stop sequence numbering
SEQNO/10,INCR,10 $$ restart sequence numbering
ENDIF
DMY=POSTF(21) $$ restore saved record (LOADTL)
DMY=POSTF(13) $$ process LOADTL
IF(OKTOOL.EQ.1) THEN
OKTOOL=0 $$ reset the flag
PPRINT/TOOLNM $$ output the message
INSERT/'G57 X0.0 Y0.0;'
ENDIF
CIMFIL / OFF $$ end of CIMFIL on LOADTL
Which results in:
N4510 G0 Z0.25;
N4520 M5;
(TOOL POSITION NUMBER : 9);
( TOOL COMMENTS);
(90 CHAMFER TOOL);
(TOOL OFFSET NUMBER : 9);
N4530 M9;
N4540 G28G91Z0.0;
N4550 G28G91Y0.0;
N4560 G90G00;
N4570 G20;
N4580 T9 M6;
N4590 T7;
N4600 M01;
(TOOL NAME : 45-CARB-CHAMFER-T9-H9);
N4610 G57 X0.0 Y0.0;
N4620 S4000 M3;
N4630 G0 X0.0911 Y-1.0783;
N4640 G43 Z0.25 H9 M8;
If I add the section (below) to remove the TOOL COMMENTS line,
CIMFIL/ON,PPRINT
$$ macro to remove PPRINT with the word COMMENTS
MESS=TEXT/CLW $$ Extract text of PPRINT
TEST=TEXT/'COMMENTS'
OK=INDXF(MESS,TEST)
IF (OK.EQ.0) THEN
$$ PPRINT text does not include COMMENTS
XX=POSTF(13) $$ Process CL rec.
ENDIF
CIMFIL/OFF
I get results with none of the text being below the tool change.
N4490 G0 Z0.25;
N4500 M5;
(TOOL NAME : 45-CARB-CHAMFER-T9-H9);
(TOOL POSITION NUMBER : 9);
(90 CHAMFER TOOL);
(TOOL OFFSET NUMBER : 9);
N4510 M9;
N4520 G28G91Z0.0;
N4530 G28G91Y0.0;
N4540 G90G00;
N4550 G20;
N4560 T9 M6;
N4570 T7;
N4580 M01;
N4590 S4000 M3;
N4600 G0 X0.0911 Y-1.0783;
N4610 G43 Z0.25 H9 M8;
What I would really like to achieve is this (below) so the tool can change and stop at the M01 and, the operator can see the tool information before it scrolls up too far. Without having to copy and paste.
N4500 G0 Z0.25;
N4510 M5;
N4520 M9;
N4530 G28G91Z0.0;
N4540 G28G91Y0.0;
N4550 G90G00;
N4560 G20;
N4570 T9 M6;
N4580 T7;
N4590 M01;
(TOOL NAME : 45-CARB-CHAMFER-T9-H9);
(TOOL POSITION NUMBER : 9);
(90 CHAMFER TOOL);
(TOOL OFFSET NUMBER : 9);
N4600 S4000 M3;
N4610 G0 X0.0911 Y-1.0783;
N4620 G43 Z0.25 H9 M8;
Any help would be greatly appreciated. I have many hours working on this and I just cant seem to figure it out. Thanks.