Switching HAL pin in subroutine (macro)

More
1 year 8 months ago #322190 by JuFu
I want to set / reset a HAL pin by using G-codes (switching a pneumatic valve on/off).
In the documentation G-code Overview | 4. HAL pins and INI values is written: " ... the only way to set HAL pins from G-code remains M62-M65, M67, M68 and custom M100-M199 codes."
I wrote the below subroutine (macro):

   o<test> sub
   (MSG, Spannzange öffnen)
   M62 #<_hal[hm2_7i76e.0.7i76.0.0.output-00]
   o<test> endsub
   M2

When I run the macro, the response is: "Benannter Parameter nicht beendet"
(Using gmoccapy Ver 3.4.9 in German language)

Is there a better way to control HAL pins?
If not, what do I need to do?

Juergen
 

Please Log in to join the conversation.

More
1 year 8 months ago #322193 by JuFu
Issue solved by using M100

Please Log in to join the conversation.

More
1 year 6 months ago #326249 by Soccer Kid
You should use the M100 to call python programs to do this, see the following example....... linuxcnc.org/docs/stable/html/gcode/m-code.html#mcode:m100-m199 .

Please Log in to join the conversation.

Time to create page: 1.037 seconds
Powered by Kunena Forum