Loading the first tool after program is finished

Loading the first tool after program is finished

sales
Enthusiast Enthusiast
466 Views
3 Replies
Message 1 of 4

Loading the first tool after program is finished

sales
Enthusiast
Enthusiast
Hello,
I'm trying to call the first tool after the program is complete.
Post standard Siemens-840D mill.
Thank you.
Mike
0 Likes
Accepted solutions (1)
467 Views
3 Replies
Replies (3)
Message 2 of 4

George-Roberts
Collaborator
Collaborator
Accepted solution
I would probably just set a collected state variable equal to the tool number on the first section. For example, see below:-

Add a variable to collected state ( I will call the Variable finalToolCall for this example)

// collected state
var sequenceNumber;
var currentWorkOffset;
var optionalSection = false;
var forceSpindleSpeed = false;
var activeMovements; // do not use by default
var currentFeedId;
var finalToolCall;



in onSection, set its value to equal the tool number if it is the first section:

function onSection() {

if (isFirstSection()) {
finalToolCall = tool.number;
}


Call the command where needed, probably onClose?

writeBlock("T" + toolFormat.format(finalToolCall), mFormat.format(6));



0 Likes
Message 3 of 4

sales
Enthusiast
Enthusiast
Hi George,
It worked, Thank you!
Mike
0 Likes
Message 4 of 4

George-Roberts
Collaborator
Collaborator
Awesome 🙂
0 Likes