bouton + relay + macro

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

bouton + relay + macro

Postby gilles974 » Wed Feb 12, 2025 8:59 am

bonjour
hi

I'm new to uccnc and I would like to add a button that controls the cable relay on pin 9 port 3
my button is in place on a new page

Image

Image

my button has the ID 20100
the macro is called M20100.txt
and I have set in I/O TRIGGER pin 9 port 3 low 94

what to put in the macros?? I ordered a book on c# to learn it

thanks in advance
gilles
à moi les copeaux

gilles
User avatar
gilles974
 
Posts: 14
Joined: Mon Aug 22, 2022 8:01 am
Location: reunion

Re: bouton + relay + macro

Postby cncdrive » Wed Feb 12, 2025 5:06 pm

Hi Gilles,

You can check the UCCNC/Documentation folder, there is a macro programming help file.
Also there is a document which a forum member Robertspark wrote, I'm attaching this for you.

You could use this code:

Code: Select all
if(AS3.Getbuttonstate(20100))
{
   exec.Setoutpin(3,9);
}
else
{
   exec.Clroutpin(3,9);
}


Place the code into your M20100.txt macro file.
Attachments
UCCNC MACROS - 1-2110.pdf
(891.4 KiB) Downloaded 63 times
cncdrive
Site Admin
 
Posts: 5054
Joined: Tue Aug 12, 2014 11:17 pm

Re: bouton + relay + macro

Postby gilles974 » Thu Feb 13, 2025 11:12 am

hello

thank you, I was able to use UCCNC MACRO, to develop my macro. it is functional, not easy for a first approach
++
gilles
à moi les copeaux

gilles
User avatar
gilles974
 
Posts: 14
Joined: Mon Aug 22, 2022 8:01 am
Location: reunion


Return to Macros

Who is online

Users browsing this forum: No registered users and 10 guests