Page 1 of 1

External switch to run macro

PostPosted: Fri Dec 27, 2019 3:36 pm
by Codepuncher
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.

Re: External switch to run macro

PostPosted: Fri Dec 27, 2019 5:41 pm
by ger21
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.

Re: External switch to run macro

PostPosted: Fri Dec 27, 2019 6:20 pm
by Codepuncher
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.

Re: External switch to run macro

PostPosted: Sat Dec 28, 2019 7:25 am
by dezsoe
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.

Re: External switch to run macro

PostPosted: Sat Dec 28, 2019 7:26 am
by dezsoe
The OpenGL error is shown if your video card is too old or you didn't install the drivers.

Re: External switch to run macro

PostPosted: Sat Dec 28, 2019 7:36 am
by Codepuncher
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

Re: External switch to run macro

PostPosted: Sat Dec 28, 2019 8:12 am
by thegreatwaldo
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

Re: External switch to run macro

PostPosted: Sat Dec 28, 2019 11:59 am
by dezsoe
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.