How to read signal state in g-code program

More
16 Feb 2021 09:25 #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 or Create an account to join the conversation.

More
16 Feb 2021 12:35 #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 or Create an account to join the conversation.

More
24 Feb 2021 12:45 #199972 by andypugh

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)
The following user(s) said Thank You: aleksamc

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

More
24 Feb 2021 20:40 #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 or Create an account to join the conversation.

Time to create page: 0.164 seconds
Powered by Kunena Forum