Setting a hal pin from Gcode

More
17 Mar 2015 23:23 #56952 by mariusl
Hi
I am trying to set a hal pin from gcode. I can read a pin but I am having trouble setting one.
This is my attempt
o<test> sub
  (DEBUG, #<_hal[hurcotc.position-req]>)
  
  #<_hal[hurcotc.move-done]> = 0
  G0 A#<_hal[hurcotc.position-req]>
  o101 while [#<_hal[motion.in-position]> NE 1]
        #1 = [#1+1] (increment the test counter)
        (debug, #1)
  o101 endwhile
  #<_hal[hurcotc.move-done]> = 1
o<test> endsub
m2

the error is " Internal error: could not assign #<_hal[hurcotc.move-done]>"

Regards
Marius


www.bluearccnc.com

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

More
18 Mar 2015 00:47 #56954 by ArcEye
Replied by ArcEye on topic Setting a hal pin from Gcode
Hi

They are read only.

The FEATURES=12 or whatever gives you access to the values, but you cannot change them, that would be the Holy Grail.

If the pin can be written to, you can do it from a user M code

halcmd setp <pinname> value type thing

Whether it is linked and what type of pin it is is going to determine if it can be written

regards

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

More
18 Mar 2015 02:53 #56961 by mariusl

They are read only.


Damn that sucks. I will have to rethink. maybe use a timer to set a pin.

Regards
Marius


www.bluearccnc.com

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

More
18 Mar 2015 12:24 #56972 by mariusl
There was a way to wait for a signal in a user M code that uses a shell script. I cannot remember however how to do that. Any suggestions

Regards
Marius


www.bluearccnc.com

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

More
18 Mar 2015 21:36 #56985 by andypugh

There was a way to wait for a signal in a user M code that uses a shell script.


www.linuxcnc.org/docs/html/gcode/m-code.html#sec:M100-to-M199

But to set a HAL pin value from G-code the simpler way is to use:
www.linuxcnc.org/docs/html/gcode/m-code.html#sec:M62-M65
and net the HAL pin to motion.digital-out-00 (or whatever)

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

More
22 Mar 2015 13:11 #57087 by mariusl
Thanks Andy

Sorry I took so long to answer but I dont get any notifications from the forum any more.

Regards
Marius


www.bluearccnc.com

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

Time to create page: 0.081 seconds
Powered by Kunena Forum