External switch to run macro

Forum for Discussing Mach3/4 related issues

External switch to run macro

Postby Codepuncher » Fri Dec 27, 2019 3:36 pm

Hi Guys
I have a new AXBB-E controller setup but am having a few issues.
I have an external switch I want to trigger a macro to execute a bit of Gcode.
I have tried using a Brain and an OEMtrigger but neither are working.

My Brain is - Input#2 - NOP - Execute Button Script
Using Input 2 set to port 2 pin 12. emulated key 1
With Machscreen I have dropped a button on the main page with the following,
Function - Execute Basic Script
Standard code- 34
Hotkey - 1
Execute code - "G0X-20"

If I trigger the external switch I can see the light on the AXBB box and the AXBB monitor window turn ON but macro does not run.
If I use the emulate key 1, the light in mach3 diagnostic turns on but the AXBB box does not but the code runs ok.

Using OEMTrigger
OEMtrigger #1 port 2 pin 12 emulated Key 1
General Config Init string has M334
System Hotkeys - Trigger #1 has 301

My 334 macro has SetTriggerMacro(333)
My 333 macro has Code "G0X-20"
Again it works with the emulated key 1 but not from the external switch.

All help appreciated.
Thanks.
Codepuncher
 
Posts: 5
Joined: Fri Dec 27, 2019 2:40 pm

Re: External switch to run macro

Postby ger21 » Fri Dec 27, 2019 5:41 pm

The easiest way is to use the macropump.m1s macro to monitor for the button press.
The OEM Triggers , which would be the easiest way, have never worked for this afaik.

This is a good example of one area where UCCNC is for superior to Mach3. In UCCNC, it's as simple as specifying the port, pin, and macro.
Gerry
UCCNC 2017 Screenset - http://www.thecncwoodworker.com/2017.html
ger21
 
Posts: 1756
Joined: Sat Sep 03, 2016 2:17 am

Re: External switch to run macro

Postby Codepuncher » Fri Dec 27, 2019 6:20 pm

What should I put into the macropump.m1s ? can I put the direct execute code

I tried to install UCCNC but the prog froze on startup with an exception I think related to Open GL, not sure how to overcome that.
Codepuncher
 
Posts: 5
Joined: Fri Dec 27, 2019 2:40 pm

Re: External switch to run macro

Postby dezsoe » Sat Dec 28, 2019 7:25 am

I have a new AXBB-E controller

Using Input 2 set to port 2 pin 12.


The AXBB does not have pin #12 on port #2. In most cases I2 is read as 12, but if you check all the I/Os, you'll see that outputs start with O and inputs with I. Your pin 12 is port #2 pin #2.
dezsoe
 
Posts: 1035
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: External switch to run macro

Postby dezsoe » Sat Dec 28, 2019 7:26 am

The OpenGL error is shown if your video card is too old or you didn't install the drivers.
dezsoe
 
Posts: 1035
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: External switch to run macro

Postby Codepuncher » Sat Dec 28, 2019 7:36 am

thanks for the info dezsoe.
I have managed to install UCCNC on another machine. I have imported my mach3 xml and ports and pins settings look fine but if I make the external
switch I can see it light up on the control box but does not show up in diagnostics page so i need to figure that out.
I am looking online to buy a licence as CNCdrive Kft are away for the holidays. The ones I have seen are for the UC400ETH not sure if that lic covers the AXBB
Codepuncher
 
Posts: 5
Joined: Fri Dec 27, 2019 2:40 pm

Re: External switch to run macro

Postby thegreatwaldo » Sat Dec 28, 2019 8:12 am

I think you'll need an extra license for your axbb as the licenses are hardware specific. (i might be wrong about that but I don't think so)
Cheers
Andrew
thegreatwaldo
 
Posts: 118
Joined: Tue Sep 06, 2016 8:28 pm

Re: External switch to run macro

Postby dezsoe » Sat Dec 28, 2019 11:59 am

As Andrew wrote the license is tied to the controller hardware. In demo mode you'll not see any input states, because the program does not communicate with the controller.
dezsoe
 
Posts: 1035
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary


Return to Mach3/4 Discussions

Who is online

Users browsing this forum: No registered users and 1 guest