How to "press" this button via macro/plugin code ??

If you have a question about the software please ask it here.

How to "press" this button via macro/plugin code ??

Postby beefy » Fri Mar 15, 2019 6:29 am

Hi Balazs,

or anyone else that can answer this.

I'm controlling various screen buttons via macro/plugin code.

My OEM Neuron screenset has Z up/down buttons. You click and >> HOLD << the mouse button so the button is continually on, and the Z jogs up or down while you are keeping the button on with the mouse.

Normal UCCNC XY jogging via plugin code is easy. I just issue one Callbutton() for lets say JogX+ and the axis jogs and keeps going. Then I issue another Callbutton() for JogX+Stop and the axis stops.

However, I have no idea what to do with the OEM Neuron Z jog button, as it doesn't have Jog On & Off button codes. All I can do is issue Callbutton(2711); for Neuron Z up but I'm wondering if all that will do is start it jogging and I won't be able to turn it off.

Is there any way to "hold a button on" via macro/plugin code, just like the mouse keeps the button on.

Keith.
beefy
 
Posts: 285
Joined: Mon Sep 05, 2016 10:34 am

Re: How to "press" this button via macro/plugin code ??

Postby Robertspark » Fri Mar 15, 2019 7:56 am

Kieth how are you calling the macro?

I mean you are not pressing a button on the screen, are you using a pendant, or a hardware input.... ?
Rob
Einstein ― “If you can't explain it to a six year old, you don't understand it yourself”
...working my way through the 1000+ ways things don't work to find the one that does
UC400eth, UC300eth, UCCNC v1.2110, Neuron Lite
UCCNC v1.2110 Macro Manual
Robertspark
 
Posts: 1347
Joined: Sat Sep 03, 2016 4:27 pm
Location: Nr Liverpool, England

Re: How to "press" this button via macro/plugin code ??

Postby beefy » Fri Mar 15, 2019 8:29 am

Hi Rob,

no, not a hardware input. The plan is to use a remote pendant and coms. This way I can have a zillion screen buttons controlled from a remote pendant. If I use trigger inputs I would need a lot of wires to do the same thing.

Currently just using a terminal to send values to a plugin then the plugin does a "Callbutton()" for the appropriate screen button.

But each Callbutton() call is a momentary one-off thing for each "command" received from the terminal.

Even for the built in UCCNC Jog commands you have to do a Callbutton() to start jogging, and a Callbutton() to stop jogging, even though the screen jog buttons are a "mouse click & hold".
But of course for the OEM Neuron buttons there is no Callbutton() for say "Neuron Z up", and a corresponding Callbutton() for "Neuron Z up off".

That's the bit that has me at a standstill and I don't know how to keep a button "continually pressed" via plugin/macro code.

BALAZS,

if nothing exists, would it be a great function addition to be able to hold a button on via macro/plugin code ?? just as if it were being continually held in the "pressed" position on screen.

Keith.
beefy
 
Posts: 285
Joined: Mon Sep 05, 2016 10:34 am

Re: How to "press" this button via macro/plugin code ??

Postby Robertspark » Fri Mar 15, 2019 9:44 am

Keith,

I can't write out the code for you now (at work), but what you basically do is add a

while (pendantbuttonactive)
{
callbutton();
threatsleep (150);
}

that you can do via plugin or macroloop, so that something is monitoring the pendantbuttonmacro

(programmers are like engineers.... 10 engineers .... 10 solutions to the same problem.... just differently)
Rob
Einstein ― “If you can't explain it to a six year old, you don't understand it yourself”
...working my way through the 1000+ ways things don't work to find the one that does
UC400eth, UC300eth, UCCNC v1.2110, Neuron Lite
UCCNC v1.2110 Macro Manual
Robertspark
 
Posts: 1347
Joined: Sat Sep 03, 2016 4:27 pm
Location: Nr Liverpool, England

Re: How to "press" this button via macro/plugin code ??

Postby beefy » Fri Mar 15, 2019 11:23 am

Thanks Rob,

but I'm not sure that works.

What I see there is the Callbutton() function being repeatedly called every 150 milliseconds, not "holding" the button on constantly.

If it could be done that way there wouldn't be 2 seperate Callbutton functions for each jog direction (once to start jog and one to stop jog).

Regarding your code:
Using the jog button as an example, once you have called say the JogX+ callbuton() function one single time, it will not stop jogging just because the JogX+ Callbutton() is no longer called. Mouse clicking and holding the jog button on screen seems to work very differently to controlling the button with Callbutton() functions.

So I'm guessing the Neuron Z jog buttons will be somewhat similar to the UCCNC jog buttons, you can't just repeatedly execute a Callbutton() function and when you stop repeating it the jogging stops, no ?????

You there Balazs ??

Keith
beefy
 
Posts: 285
Joined: Mon Sep 05, 2016 10:34 am

Re: How to "press" this button via macro/plugin code ??

Postby cncdrive » Fri Mar 15, 2019 11:32 am

Keith, I'm on holidays (National holiday today here) so I can't check anything in the UCCNC now, sorry. Will be back on Monday only.
cncdrive
Site Admin
 
Posts: 2766
Joined: Tue Aug 12, 2014 11:17 pm

Re: How to "press" this button via macro/plugin code ??

Postby Dan911 » Fri Mar 15, 2019 11:49 am

Using exec.Callbutton() for a jog button works.
Dan911
 
Posts: 580
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: How to "press" this button via macro/plugin code ??

Postby beefy » Fri Mar 15, 2019 11:49 am

Sorry Balazs,

didn't realise. Enjoy yourself.

Keith.
beefy
 
Posts: 285
Joined: Mon Sep 05, 2016 10:34 am

Re: How to "press" this button via macro/plugin code ??

Postby beefy » Fri Mar 15, 2019 12:02 pm

Dan911 wrote:Using exec.Callbutton() for a jog button works.


Thanks Dan,

but that's not the issue, I've got all that working.

I'm using a plugin so use UC.Callbutton(), same deal though. If I was using a macro / macroloop I'd use exec.Callbutton().

The issue is only with buttons that you keep "held down" with a mouse click (like the aforementioned jogging buttons). Controlling them with plugin or macro code requires TWO DIFFERENT Callbutton() functions, one to go, and one to stop.

The UCCNC X & Y jog buttons have these associated go & stop Callbutton() functions, but I don't have any such Callbutton() functions for the Neuron Z jog buttons

You may need to re-read the prior posts to get an understanding of the issue I'm having.

Keith
beefy
 
Posts: 285
Joined: Mon Sep 05, 2016 10:34 am

Re: How to "press" this button via macro/plugin code ??

Postby Dan911 » Fri Mar 15, 2019 12:16 pm

Hi Keith, title says macro/plugin...regardless, than in plugin UC.Callbutton()

there are 2 buttons for each control on/off, for example Y+ on is button# 149 and Y+ off is button# 229


EDIT ok just reread your post, no nothing about Neon screen
Dan911
 
Posts: 580
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Next

Return to Ask a question from support here

Who is online

Users browsing this forum: No registered users and 5 guests

cron