Delay required in IO trigger

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Delay required in IO trigger

Postby trendsetter » Fri Feb 08, 2019 5:11 am

Dear all,
Im having newly an ATC spindle and just started to adaped it on my machine. For the tool change procedure (still manual with button) I am using the trigger functions to control the cone cleaning & release of the tool holder. Unfortunatly, the cone cleaning air prevents to bring in the new tool very smoothly. Is there any chance to create such a sequence with manual triggered button:
1. Botton on:
2. Release old tool
3. delay of 0.5-1s
4. cone cleaning is switched on
5. put in new tool manually & switch button off
6. stop cone cleaning
7. delay of 0.5s
8. lock new tool

BR
Michael
trendsetter
 
Posts: 38
Joined: Fri Nov 03, 2017 5:20 am

Re: Delay required in IO trigger

Postby Robertspark » Fri Feb 08, 2019 1:36 pm

Yes there is ,very easily to do.

Your macro / macrobutton would need to know what inputs and what outputs you require

At the moment, what you have (which won't work) would be something like this:

Code: Select all
//1. Button on:
// Save the macro as M20000 to M21999.txt and create a screenset button with the same number i.e. 20000 and it will call the macro

//2. Release old tool
exec.Setoutpin(1, 2); // port 1, pin 2

//3. delay of 0.5-1s
exec.Wait(1000); // wait 1000 mSec before continuing code

//4. cone cleaning is switched on
exec.Setoutpin(1, 2); // port 1, pin 3

//5. put in new tool manually & switch button off
exec.Stop();  // stop await manual tool change

//6. stop cone cleaning
exec.Clroutpin(1, 3); // port 1, pin 3

//7. delay of 0.5s
exec.Wait(500); // wait 500 mSec before continuing code

//8. lock new tool
exec.Clroutpin(1, 2); // port 1, pin 2
exec.Wait(500); // wait 500 mSec before continuing code


I would suggest putting in some bits of code to move the cutter head to a suitable location to change the tool and then reset it back to where it left off before handing back to the g-code programme. .... but then you'd probably run this via the M6 macro and not so much a button code....
Robertspark
 
Posts: 1892
Joined: Sat Sep 03, 2016 4:27 pm

Re: Delay required in IO trigger

Postby trendsetter » Fri Feb 08, 2019 5:21 pm

Dear Robert

thanks a lot. I will have a try.
I still have one question: The Button is a physical button going to an IN pin of the breakoutboard. Means can I execute an Macro based on I/O trigger?

Very good support in this form.

BR
Michael
trendsetter
 
Posts: 38
Joined: Fri Nov 03, 2017 5:20 am

Re: Delay required in IO trigger

Postby ger21 » Fri Feb 08, 2019 6:01 pm

Yes,
You just enter the macro number under Function for the IO Trigger.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am


Return to Macros

Who is online

Users browsing this forum: No registered users and 3 guests