insert fixed M-Code before every toolchange command - Fanuc 0MD

insert fixed M-Code before every toolchange command - Fanuc 0MD

meXtec-marcus
Contributor Contributor
512 Views
1 Reply
Message 1 of 2

insert fixed M-Code before every toolchange command - Fanuc 0MD

meXtec-marcus
Contributor
Contributor

Hello,

while editing everything was german .. so I thougt it will land in a german forum.

Here again in english:

my Fanuc-0MD forces me to move to toolchange position before changing the tool.
The preowner used a short program linked to function M90 to do that.
Therefore I would like to insert the line "M90" before the tool change line T01 M06.

from:
T1 M6

 

to:

M90
T1 M6

 

I am using a modified forum post - original is Fanuc generic (Fanuc for Arnold - post attached)

 

What do I have to change to make this happen?

 

Thanks in advance

Best regards
Marcus

0 Likes
Accepted solutions (1)
513 Views
1 Reply
Reply (1)
Message 2 of 2

djowen40
Advocate
Advocate
Accepted solution

Adding the following line of code before line 680 should do it.

 

 

writeBlock(mFormat.format(90));

 

 

the surrounding segment should look like this after the edit

 

 

if (tool.number > 99) {
      warning(localize("Tool number exceeds maximum value."));
    }
    writeBlock(mFormat.format(90)); // This line had been added 
    writeBlock(mFormat.format(6), "T" + toolFormat.format(tool.number));
    if (tool.comment) {
      writeComment(tool.comment);
    }