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 1JUMPER10 » Wed Nov 15, 2017 12:28 am

Ok. Its zipped and attached.

Dan911, Dezsoe and Balázs - I truly appreciate the help. If this is overly complicated and is forcing a lot of complex programming I am OK with accomplishing the same thing with a hardwired switch. With that said, your're probably going to find that I've made some simple error. :? Thanks again for your outstanding support.
Attachments
profile transport.zip
(20.96 KiB) Downloaded 37 times
1JUMPER10
 
Posts: 48
Joined: Tue Oct 04, 2016 1:54 am

Re: Need help with a macro

Postby dezsoe » Wed Nov 15, 2017 11:22 pm

1JUMPER10,

I don't know what's happening by you. Using your profile I connected to a UC300Eth-5LPT (I don't have UB1, but the core is the same UC300Eth) and it worked good on port 1 pin 1.

[ Play Quicktime file ] WP_20171115_19_25_33_Pro.mp4 [ 14.14 MiB | Viewed 2235 times ]

dezsoe
 
Posts: 393
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Need help with a macro

Postby 1JUMPER10 » Thu Nov 16, 2017 1:09 am

Ok. I'm glad to know that I had everything right with the plugin-macro-button. I wasn't sure I did. There might be something with the UB1 that disables this type of work around. Regardless, the problem is on my end.

Thank you for the excellent support. I'll use a different method to do this.
1JUMPER10
 
Posts: 48
Joined: Tue Oct 04, 2016 1:54 am

Re: Need help with a macro

Postby dezsoe » Thu Nov 16, 2017 10:16 am

It is a bit annoying when you write a macro, know that it must work, but it does not. I read the UB1 manual and nothing points to why it doesn't switch K1. I really don't understand it... :(
dezsoe
 
Posts: 393
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Need help with a macro

Postby cncdrive » Thu Nov 16, 2017 10:52 am

What I can tell is that the UB1 firmware and API code is the same as the -5LPT firmware and API code, there is only one little difference, that the PWM for analog has a different frequency, so other than that there is no difference to the -5LPT. There is no difference at all in the digital I/Os handling, so by code if the macro works on the -5LPT then it should also work on the -UB1.

So, I think the only thing which can prevent the output to turn on could be external electrical circuitry on the UB1 or something that connects to the UB1, e.g. if for example the output depends on an other signal like an enable output or a charge pump or something like that.
cncdrive
Site Admin
 
Posts: 1796
Joined: Tue Aug 12, 2014 11:17 pm

Re: Need help with a macro

Postby ger21 » Thu Nov 16, 2017 11:54 am

Ok. I'm glad to know that I had everything right with the plugin-macro-button. I wasn't sure I did.


I don't think that the profile alone confirms that you have everything setup correctly? It still could be user error. :D
If I have time this weekend, I'll try to do some testing and see if I can get this to work with the UB1. But I'll have to read this thread a few times to get a good understanding.
Gerry
UCCNC 2017 Screenset - http://www.thecncwoodworker.com/2017.html
ger21
 
Posts: 933
Joined: Sat Sep 03, 2016 2:17 am

Re: Need help with a macro

Postby 1JUMPER10 » Thu Nov 16, 2017 9:47 pm

cncdrive wrote:What I can tell is that the UB1 firmware and API code is the same as the -5LPT firmware and API code, there is only one little difference, that the PWM for analog has a different frequency, so other than that there is no difference to the -5LPT. There is no difference at all in the digital I/Os handling, so by code if the macro works on the -5LPT then it should also work on the -UB1.

So, I think the only thing which can prevent the output to turn on could be external electrical circuitry on the UB1 or something that connects to the UB1, e.g. if for example the output depends on an other signal like an enable output or a charge pump or something like that.


Balázs - I think the reason is the way the OSSD works and I think you were on the right path. The OSSD disables certain outputs and I think Port 1 pin 1 is one of them. On page 11 of the UB1 manual it says this about the OSSD -"The safety circuit forms an "AND" logic for all of its input signals. This eliminates the need to build a separate safety circuit, hopefully saving the user time and money. The safety circuit is a standalone circuit that works without any control from UC300ETH and software. Therefore, it will disengage the OSSD output regardless of whether the software crashes or malfunctions."

I"ll modify the macro to use a different output, I'm thinking port 1 pin 14, K2 relay and see if it works.
Again, thank you for the help.

Gerry if you try to bench test this with your UB1, I have soldered bridges 7, 8, and 12. Bridge 7 is outputs Y302-307, 316 and 317.
1JUMPER10
 
Posts: 48
Joined: Tue Oct 04, 2016 1:54 am

Re: Need help with a macro

Postby 1JUMPER10 » Thu Nov 16, 2017 11:53 pm

Well, that doesn't appear to be the problem. I can't trigger the output even when the OSSD is normal.

It will trigger if I try it with a hotkey so, my electric circuit is good.
1JUMPER10
 
Posts: 48
Joined: Tue Oct 04, 2016 1:54 am

Re: Need help with a macro

Postby ger21 » Sun Nov 19, 2017 6:38 pm

I tested the plugin and macroloop, and it works as expected, activating the K1 relay with the button, while UCCNC was in Reset. I have some video I can upload later.

Now, I'm not using the OSSD circuit on my UB1, and I'm not going to start soldering my board to test this.

Chris, if you want to test it like I did, change this line in the macroloop from 471 to 500.
Code: Select all
const int buttonLED = 500;                                                      // LED to store required state


And change these lines from port 2 and pin 2 to 1 and 1.

Code: Select all
const int relayPort = 1;                                                        // Port number of relay
const int relayPin = 1;                                                         // Pin number of relay


Then make your button number 5500.

When you click the button, the LED should light up, and the relay will activate.
Be sure to enable the plugin, and the macropump, and restart UCCNC.
Gerry
UCCNC 2017 Screenset - http://www.thecncwoodworker.com/2017.html
ger21
 
Posts: 933
Joined: Sat Sep 03, 2016 2:17 am

Re: Need help with a macro

Postby Dan911 » Sun Nov 19, 2017 7:06 pm

Hi Gerry,
I know you confirmed plugin I uploaded worked in demo mode but did it work connected to UBI?

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

PreviousNext

Return to Macros

Who is online

Users browsing this forum: No registered users and 1 guest