Thanks for the quick reply Rick! I had a look at that subroutine and although it doesn't take into account tool changes it did however spark an idea!!! I tried it out on my post processor and isolated that my current problem is that I create an O-word (O501) with every operation and it freezes EMC2 whenever I use more than one operation! So my question is.... how do I reset or over-write the O-word with multiple operations? The section of my post processor that I need to modify is shown.
@loop /// this is called at the start of every operation
local integer var_num
var_num = loop_level + 20
{nb, '#', var_num, ' = 0'}
{nb, '#<loop_level> = ', loop_level}
{nb, '#<loop_count> = ', loop_count}
{nb, 'O501 WHILE [#', var_num, ' LT ', loop_count, ']'} <
in gcode this comes out as O501 WHILE[#21 LT 2] ///where #21=0
endp
;
@end_loop ///this is called at the end of every operation
local integer var_num
var_num = loop_level + 20
{nb '#', var_num, ' = [#', var_num, ' + 1]'}
{nb 'G'home_number}
{nb 'O501 ENDWHILE'}
*************************************** <
what do i add here in order to Over-write/reset the O-word?
endp
;