Need help with a macro

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

Re: Need help with a macro

Postby dezsoe » Tue Nov 14, 2017 12:13 pm

1JUMPER10,

I didn't find in your posts that what kind of card do you use for this output. It is important, because if your card has a charge pump driven output on pin 1, than you cannot turn it on with a high (or low) level signal. For charge pump it has to be a square signal. So, what card do you have there?
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Need help with a macro

Postby cncdrive » Tue Nov 14, 2017 1:08 pm

I think what Dezsoe ment is that if your breakout board needs a charge pump signal as an enable signal then this method will not work, because the charge pump signal will still be missing, so the output the plugin or macroloop will output will be there on the output on the motion controller, but your breakout board will not throughput and use the signal, because the charge pump safety signal is missing when the UCCNC is in reset.
However you could change/reconfigure the method of how the charge pump signal acts, change it to always on and then the charge pump will not be removed on reset, only when the UCCNC is not running and then the plugin/macro method will work, because the charge pump will be always on when you running the UCCNC and so your breakout board will use the output signal.
However it is then a question if changing how the charge pump acts will cause any other problems for your system if the charge pump is always on, but this depends on how your system is wired and configured and what the charge pump signal does in your system....
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: Need help with a macro

Postby 1JUMPER10 » Tue Nov 14, 2017 1:44 pm

I am using a UC300ETH and UB1. My charge pump signal is configured to be always on. I'm away from home at the moment but I think my charge pump signal is on pin 14, port 1 or 2. I know its not on port 1 pin 1.

On the UB1 I remember there is a setting that disables outputs on power up without a charge pump signal and I think it was controlled by a solder bridge. I'll have to double check. But I'm not sure this would affect the macro/plugin anyway if my charge pump is always on. I will double check and report back. If its an issue with the UB1 that would explain why I cant make it work on the machine.
1JUMPER10
 
Posts: 76
Joined: Tue Oct 04, 2016 1:54 am

Re: Need help with a macro

Postby ger21 » Tue Nov 14, 2017 1:50 pm

CP on UB1 = Port 2, Pin 14
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2663
Joined: Sat Sep 03, 2016 2:17 am

Re: Need help with a macro

Postby dezsoe » Tue Nov 14, 2017 2:05 pm

I checked the manual for UB1 and port 1 pin 1 is the K1 relay. Then it has to work. When you get home try to set anything on that pin (e.g. laser output), apply settings, set it active low, apply again. It has to click when you apply settings.
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Need help with a macro

Postby Dan911 » Tue Nov 14, 2017 8:06 pm

Hi Chris,
What will keep my plugin from appearing that it's not working if Led is not 0 or 1. Possibly got changed with your testing. Not sure if it would cause you problems with Dezsoe solution, but it will with plugin I uploaded.

OUTPUT TRIGGER-Pin 1, Port 1, Function 0

Dan
Dan911
 
Posts: 613
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Need help with a macro

Postby 1JUMPER10 » Tue Nov 14, 2017 10:45 pm

dezsoe wrote:I checked the manual for UB1 and port 1 pin 1 is the K1 relay. Then it has to work. When you get home try to set anything on that pin (e.g. laser output), apply settings, set it active low, apply again. It has to click when you apply settings.

Two things:. To test the output of port 1 pin 1 I assigned the M7 button to Port 1 pin 1 and it worked as expected. Then I started the macro. And applied settings, set it active low, and applied settings again and it did not click. But then, with these settings, I pushed the M7 button and the button toggles on but no output on port 1, pin 1. However, it briefly trips the output of port 1 pin 1 when I toggle the M7 button off. Does this make any sense?
1JUMPER10
 
Posts: 76
Joined: Tue Oct 04, 2016 1:54 am

Re: Need help with a macro

Postby 1JUMPER10 » Tue Nov 14, 2017 10:51 pm

I tried setting up an output trigger, port 1, pin 1 LED 400. I pushed my button and no result. But I changed the output to active low, applied settings and the output began to rapidly oscillate on and off.
1JUMPER10
 
Posts: 76
Joined: Tue Oct 04, 2016 1:54 am

Re: Need help with a macro

Postby cncdrive » Tue Nov 14, 2017 11:12 pm

Be careful how you configure outputs. If you configure more than one thing to a single output that will cause a conflict.
I mean you can't configure an M7 and also a button to the same output, because then both will try to force it's state on the output which will cause unexpected results.
Imagine what if one function tells the output to be 1 and the other tells it to be 0 then what output state do you expect to happen?

Mostly the hardware type functions like step signals have priority over software type functions like Setoutput function calls, so in that case the step signal will override the Setoutput function calls.
But there can be cases when the result will be even unpredictible, the case is when you configure signals on the same priority level. E.g. 2. macros trying to switch the same output.
And as I remember M7 has priority over Setoutpin function calls...
cncdrive
Site Admin
 
Posts: 4695
Joined: Tue Aug 12, 2014 11:17 pm

Re: Need help with a macro

Postby dezsoe » Tue Nov 14, 2017 11:23 pm

OK, there were too much tests. Could you upload your profile file for me to check? I think - as Balázs (CNCdrive) wrote - there are some conflicts in your setup.
dezsoe
 
Posts: 2049
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

PreviousNext

Return to Macros

Who is online

Users browsing this forum: No registered users and 4 guests