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 » Mon Nov 13, 2017 12:53 pm

1JUMPER10,

I will check on machine again in the evening, now I have no hardware with me.

Dan,

The two methods are not the same. My plugin only switches an LED and a button on/off even in reset mode. It is independent from the output switching, and is made a long time ago when I first had to toggle an LED with a switch in reset mode. Its only job is to inform somehow the macroloop. The real solution for the problem is in the macroloop, which can also run in reset mode, and you can change outputs in it.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Need help with a macro

Postby Dan911 » Mon Nov 13, 2017 1:44 pm

Hi Dezsoe,

Sorry, I just assumed based on your post. I did post.... "To put it simply"

dezsoe wrote:Hi Dan, The linked plugin also uses button event to turn switch and LED on/off.


I hope I'm not coming off like an arrogant know it all because that couldn't be further from my intentions or the truth. I am very aware there's a lot I can learn from your post and already did.

I stumbled on a back door to UCCNC Estop and just tried to share with the use for 1JUMPER10's problem.

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

Re: Need help with a macro

Postby dezsoe » Mon Nov 13, 2017 2:08 pm

Dan,

There's really no problem, I just wanted to clarify for later readers, that the plugin can be used generally for anything that needs to be toggled, and the macroloop is able to switch outputs in reset mode depending on some conditions.

As I see, I'm not the only one who is aware of using macroloops. I'm an old programmer and I also program microcontrollers where these loops can eat up the resources, but I made a lot of tests and I had to realize, that on today computers it takes no time for them to run. I have 6 to 8 macroloops running, some of them is more complex, but there is no difference in CPU usage if I stop them on my i7 and on my older i3 laptop which is to control my machines it makes 0.1% difference.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Need help with a macro

Postby dezsoe » Mon Nov 13, 2017 8:54 pm

Hello 1JUMPER10,

I've just finished testing on UC400Eth and it works well. So, if you can't get it work, I'll help you to find the problem. First of all, check that your button number -5000 equals to buttonLED. Next, check in macroloops window that the macro is running.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Need help with a macro

Postby Dan911 » Mon Nov 13, 2017 10:05 pm

Like I mentioned in previous post..
Whether you take the long road or short cut the plugin is going to make the switch for on/off. :D

If 1 solution not working most likely neither will the other. Would start looking at a fresh .pro, possibly got corrupt with all the testing.

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

Re: Need help with a macro

Postby cncdrive » Mon Nov 13, 2017 10:13 pm

Would start looking at a fresh .pro, possibly got corrupt with all the testing.


Hi Dan,

The UCCNC is not Mach3. :)
I mean I've never seen anyone so far who corrupted a UCCNC profile file.
Also to corrupt a file the only way to do that is to get the file half written, but then the UCCNC will still be able to correct most of the errors.
So, it is not like how it is with xmls like in Mach3 where a branch of the xml if broken then the whole remaining xml data can't be read anymore, because the structure is then broken.
We selected simple sections and keys writting in the UCCNC on purpose, because it will basicly never get corrupted.
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm

Re: Need help with a macro

Postby Dan911 » Mon Nov 13, 2017 10:25 pm

Corrupt was the wrong word. But I seen values get changed or left empty and was ignored. I have and others tried plugin I uploaded and worked as it should, I guess it's leaving me guessing of other possible causes.

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

Re: Need help with a macro

Postby cncdrive » Tue Nov 14, 2017 12:23 am

OK, I understand what you saying, but left empty key is only possible if empty value was written or if the writting was interrupted at exactly after the name of the key before the value of the key,
which is a very unlikely to happen event and could be easily observed, because if the writting was interrupted there then there will be no more text at all after that key, the file then would be ended there.
Which is still a very unlikely to happen event, because then the file is not closed properly, so the file would probably end up unreadable instead of no more data after that key and that could be even more easily observed.
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm

Re: Need help with a macro

Postby Dan911 » Tue Nov 14, 2017 1:13 am

With your explanations it seems unlikely that it's what I suggested to check, the .pro.

I'm clueless why neither 1 of the methods that were provided to him here are working. It just seemed possible jumping back and forth testing 2 different plugins and a macroloop trying to do same thing something might of conflicted.

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:59 am

Dezsoe and Dan911 - I tested Dezsoe's method on the machine last night and though it worked in simulation, it didnt work on the machine. My button number is 5400?? (Is the button LED a different number?) In the macroloops window I started macro 5400, set it to auto run also and got the green indicator which tells me it was running. I feel like I'm doing something wrong thats probably simple to correct. Thanks to you both for your efforts.
1JUMPER10
 
Posts: 76
Joined: Tue Oct 04, 2016 1:54 am

PreviousNext

Return to Macros

Who is online

Users browsing this forum: No registered users and 3 guests