Page 1 of 1

How to run a before every auto mode?

Posted: Sat Jun 19, 2021 3:43 am
by ashesman
Is there a way to run a macro in the background every time a program is started or mdi opened?

I am guessing no but thought I would ask.

Re: How to run a before every auto mode?

Posted: Sat Jun 19, 2021 8:06 pm
by cncsnw
No, not if it needs to be a CNC macro.

You can make your PLC program perform PLC-controlled tasks when a cycle begins, but you can't run G codes.

Re: How to run a before every auto mode?

Posted: Wed Jun 23, 2021 9:49 am
by martyscncgarage
ashesman wrote: Sat Jun 19, 2021 3:43 am Is there a way to run a macro in the background every time a program is started or mdi opened?

I am guessing no but thought I would ask.
Could you share what you are trying to accomplish?

Re: How to run a before every auto mode?

Posted: Wed Jun 23, 2021 3:44 pm
by ashesman
I want to reset my travel limits. I have to make them unsafe during tool change. If the tool change completes ok then they are made safe again at the end of the tool change macro. But if something happens during tool change or it is stopped, then the limits are left unsafe until next tool change completes.

Re: How to run a before every auto mode?

Posted: Fri Jun 25, 2021 10:24 am
by martyscncgarage
ashesman wrote: Wed Jun 23, 2021 3:44 pm I want to reset my travel limits. I have to make them unsafe during tool change. If the tool change completes ok then they are made safe again at the end of the tool change macro. But if something happens during tool change or it is stopped, then the limits are left unsafe until next tool change completes.
I kind of don't follow.
Travel limits basically address the full travel of each axis minus a bit from the hard stops. Tool changers are generally within the work envelope of the machine, or move INTO the work envelope of the machine.

Re: How to run a before every auto mode?

Posted: Fri Jun 25, 2021 4:08 pm
by ashesman
martyscncgarage wrote: Fri Jun 25, 2021 10:24 am
ashesman wrote: Wed Jun 23, 2021 3:44 pm I want to reset my travel limits. I have to make them unsafe during tool change. If the tool change completes ok then they are made safe again at the end of the tool change macro. But if something happens during tool change or it is stopped, then the limits are left unsafe until next tool change completes.
I kind of don't follow.
Travel limits basically address the full travel of each axis minus a bit from the hard stops. Tool changers are generally within the work envelope of the machine, or move INTO the work envelope of the machine.
Not my tool change. It is fixed in location and the spindle moves into the tool change area. The tool change area is out of bounds during normal operation due to the travel limits. I have to alter the Y travel limit on the fly to move into the tool change area, then set it back when leaving. If something goes wrong during a tool change or it is cancelled, the limit could be left an unsafe state.

So, I want to run a macro or something before auto or mdi at least to always set the Y limit to its default value and move the spindle back out of the tool change area.

This is a video of a similar machine to mine. You can see it fetch the tool in the first few seconds.