Page 1 of 1

Creating a macro to activate Port 4 / Pin 17

PostPosted: Thu May 09, 2024 10:32 pm
by bhdavis
I haven't created many macros in UCCNC up until now. I have done some editing of existing macros but have created one or two that are calling up G-code commands.

First issue is I need to understand how to activate output Port 4 / Pin 17 from within the macro. I have seen where this port/pin combination relates to LED 119 but to be honest I don't understand what that means. Does LED 119 refer to the indicator for Port 4 / Pin 17 on the DIAGNOSTICS page? If so do I execute a command to turn LED 119 on or off in the macro in order to actually have my relay connected to Port 4 / Pin 17 activate?

I've tried to glean basic beginner information from the MACRO and LED documentation but it all seems to be geared to someone already having a basic understanding of how all this works.

I've also examined a lot of the default macros in the PROFILES folder but these all seem to execute G-code commands and not call up an I/O port/pin not related to a G-code command as set up in the CONFIGURATION settings.

I apologize if this is really basic stuff that I should know but I'm getting nowhere so figured best to post the question.

Thanks,
BH

Re: Creating a macro to activate Port 4 / Pin 17

PostPosted: Fri May 10, 2024 4:26 am
by dezsoe
You can change the outputs using

Code: Select all
exec.Setoutpin(portnumber, pinnumber); // turn on the output
exec.Clroutpin(portnumber, pinnumber); // turn off the output

Using the LEDs you can read the current state of a pin, both input and output.

Re: Creating a macro to activate Port 4 / Pin 17

PostPosted: Fri May 10, 2024 9:12 am
by bhdavis
Thank you. I'll give it a try first thing this AM.
BH

Re: Creating a macro to activate Port 4 / Pin 17

PostPosted: Fri May 10, 2024 2:57 pm
by bhdavis
Worked perfect. As of course you knew it would. Opens a whole new world of possibilities for me. Much appreciated.

BH