Creating a macro to activate Port 4 / Pin 17

Post anything you want to discuss with others about the software.

Creating a macro to activate Port 4 / Pin 17

Postby bhdavis » Thu May 09, 2024 10:32 pm

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
bhdavis
 
Posts: 141
Joined: Tue Mar 23, 2021 7:36 pm

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

Postby dezsoe » Fri May 10, 2024 4:26 am

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.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

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

Postby bhdavis » Fri May 10, 2024 9:12 am

Thank you. I'll give it a try first thing this AM.
BH
bhdavis
 
Posts: 141
Joined: Tue Mar 23, 2021 7:36 pm

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

Postby bhdavis » Fri May 10, 2024 2:57 pm

Worked perfect. As of course you knew it would. Opens a whole new world of possibilities for me. Much appreciated.

BH
bhdavis
 
Posts: 141
Joined: Tue Mar 23, 2021 7:36 pm


Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: No registered users and 14 guests