Turning output on and off from HAL show?

More
21 Aug 2019 08:43 #142707 by thefabricator03
Hi Guys,

I did try to search for this but couldnt find what I was after,

What is the command to turn a output on and off from the HAL show test command line? I know it will be something simple.

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

More
21 Aug 2019 12:19 - 21 Aug 2019 12:22 #142715 by PCW
You can enter single hal statements in the small text box at the bottom of the hal show
pane labeled "Test HAL Command":

say

setp hm2_7i96.0.ssr.00.out-01 true

However, I find it much easier to open a terminal window and type

halcmd setp hm2_7i96.0.ssr.00.out-01 true

The benefits of doing it from the terminal via halcmd are that

1. You have command history, so you can re-do different commands just using the up/down keys.
2. halcmd is "smart" and has command completion (via the tab key) so you can type partial pin names
for example and have halcmd fill in the blanks (a double tab prints all matches so far)
That is:
halcmd setp hm2_7i96.0.ssr[TAB TAB] prints all pins that start with hm2_7i96.0.ssr as a guide for you to complete the command
Last edit: 21 Aug 2019 12:22 by PCW.
The following user(s) said Thank You: Clive S, thefabricator03

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

More
21 Aug 2019 20:54 #142739 by thefabricator03
Thanks PCW,

I tried typing this: setp hm2_7i76e.0.7i76.0.0.output-05 true in the halshow window but get this error,

setting parameter 'hm2_7i76e.0.7i76.0.0.output-05' to 'true'
pin 'hm2_7i76e.0.7i76.0.0.output-05' is connected to a signal
setting parameter 'hm2_7i76e.0.7i76.0.0.output-05' to 'true'
pin 'hm2_7i76e.0.7i76.0.0.output-05' is connected to a signal
while executing
"hal setp hm2_7i76e.0.7i76.0.0.output-05 true"
("eval" body line 1)
invoked from within
"eval hal $what"
(procedure "showEx" line 2)
invoked from within
"showEx $halcommand"
invoked from within
".main.note.fps.f2.b.execute invoke"
("uplevel" body line 1)
invoked from within
"uplevel #0
    "
    (procedure "tk::ButtonUp" line 22)
    invoked from within
    "tk::ButtonUp .main.note.fps.f2.b.execute"
    (command bound to event)

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

More
21 Aug 2019 21:07 - 21 Aug 2019 21:11 #142740 by PCW
Yes, you cannot the change the state of a pin that's already connected
to a hal signal (what would this mean?)

But you can unlink the pin and then set it

halcmd unlinkp hm2_7i76e.0.7i76.0.0.output-05
halcmd setp hm2_7i76e.0.7i76.0.0.output-05 true
halcmd setp hm2_7i76e.0.7i76.0.0.output-05 false

( and remember that its no longer connected until you restart linuxCNC or issue a net command that reconnects it )
Last edit: 21 Aug 2019 21:11 by PCW. Reason: clarify
The following user(s) said Thank You: thefabricator03

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

More
21 Aug 2019 21:17 - 21 Aug 2019 21:29 #142742 by thefabricator03
Thanks PCW,

I was under the impression that I would be able to toggle the output easily, I guess I was wrong, That is why I could not get it to work before I make this thread. And yes it is already connected in the HAL I just wanted to test turning my air scribe on and off without configuring buttons in AXIS.
Last edit: 21 Aug 2019 21:29 by thefabricator03.

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

More
22 Aug 2019 03:48 #142765 by Todd Zuercher
If you don't yet have the signal you have that pin connected to connected to anything else. You can change the state of the signal (and the pin) with a sets command.

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

More
22 Aug 2019 04:03 #142769 by PCW
And there is one situation where you can change the signal even when driven:
if both connected pins are bi-directional (this is handy for checking index_enable)

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

Time to create page: 0.075 seconds
Powered by Kunena Forum