macros not triggered with physical button switch

More
18 Aug 2022 18:32 #250029 by Joergm
Hi all,
I'm a completely newby with Linuxcnc but was able to get the basics working.
But sorry for the maybe beginners question.
I use a Mesa 7i76e and my xyz steppers are working perfect.

I created a simple macro file which is also working fine when I execute it with the mouse click in MDI mode.

I connected a physical switch on input-00 which is also working as I can see in "auto mode" (the "Load a new program" h-button.button-0 is executed when I press the external button)

But in MDI mode, the first macro is not getting triggered.

My custom_postgui.hal is:

net macro-switch1 gmoccapy.h-button.button-0 <= hm2_7i76e.0.7i76.0.0.input-00

After searching all docus I understand that a macro can only triggerd by external button by going through the virtuell h-buttons. Is this correct?

Any idea what I can try to get macros triggered by a physical button?

Many thanks & best Regards,
Joerg

Please Log in or Create an account to join the conversation.

More
19 Aug 2022 20:12 #250087 by HansU
I don't know any other method to run a macro by a hardware pin other than via the h-button.button-0.
What is the problem doing it via this pin?

Maybe you can add a VCP and express that what you want to do in a little python script.
What does your macro do?

Please Log in or Create an account to join the conversation.

More
20 Aug 2022 05:42 - 20 Aug 2022 06:57 #250094 by Joergm
Thanks Hans,
when I run Linuxcnc from the terminal, the output shows me that the "Button macro_0 has been clicked".
But the macro_0 is not running and nothing happening.
When I click the same macro_0 with the mouse, the macro_0 is executed and runs his gcode.

The macro_0 is a very simple gcode as attached.

I'm running Linuxcnc version 2.8.1 and gmoccapy 3.0.9.1. (not sure if it's worth downgrading ..)

On the end of the day, I try to get a machine working like a "Rose Engine" for engravings ;-)
Joerg





 
Attachments:
Last edit: 20 Aug 2022 06:57 by Joergm.

Please Log in or Create an account to join the conversation.

More
20 Aug 2022 06:58 - 20 Aug 2022 07:16 #250095 by HansU
You are running a fairly old version of Gmoccapy. 3.1.3.8 is the version in current 2.8.3 release. Maybe it's worth upgrading ;-).

However, your file needs and M2 command at the end. Then it works for me also with gmoccapy.h-button.button-0. (only tried with 3.1.3.10)
 
Last edit: 20 Aug 2022 07:16 by HansU.
The following user(s) said Thank You: Joergm

Please Log in or Create an account to join the conversation.

More
20 Aug 2022 12:16 #250100 by Joergm
It is working now perfectly after upgrading Lcnc to 2.8.3 with Gmoccapy 3.1.3.8! 

I insert the M2 command before, but it was not solving the issue.

Thanks so much Hans! highly appreciate you help!
Joerg

 

Please Log in or Create an account to join the conversation.

Moderators: newbynobiHansU
Time to create page: 0.122 seconds
Powered by Kunena Forum