How to read signal state in g-code program

More
5 years 8 months ago #199030 by aleksamc
If I want to read value of the pin from G-code, I type
#<_hal[pinname]>

But when I want to read signal name (not pin), when I type
(debug, #<_hal[signal_name>]>) and signal is true or false, I get ####

How to read binary signal name in G-code?

Please Log in to join the conversation.

More
5 years 8 months ago #199058 by aleksamc
Ok, it seems that signal value gets the same as pin value, I made only simple mistake in writing [].

Please Log in to join the conversation.

More
5 years 8 months ago #199972 by andypugh

aleksamc wrote: If I want to read value of the pin from G-code, I type
#<_hal[pinname]>


Note that this will (generally) return the value on the HAL pin at the moment that the G-code started.

To read live status it is a bad choice, far better then to use the G-code analogue input pins and M65 (etc)

Please Log in to join the conversation.

More
5 years 8 months ago #200022 by aleksamc
Thank you very much for good advice, Andypugh.
I also wondered why I didn't get change in g-code if I change values.

Please Log in to join the conversation.

Time to create page: 0.700 seconds
Powered by Kunena Forum