Overrides Hal example

More
18 Apr 2016 10:02 #73516 by andypugh
Replied by andypugh on topic Overrides Hal example
Can I suggest:

With LinuxCNC not running type the following in a terminal:
halrun
loadrt mux_generic config="ff32"
show pin
exit

This will print out the actual pin-names created by the ff32 mux_generic. The pin names in the HAL need to match exactly. Pay special attention to underscores and dashes, and how many digits there are in numbers.
The following user(s) said Thank You: ts14

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

More
19 Apr 2016 00:05 #73573 by Mtndrew77
Replied by Mtndrew77 on topic Overrides Hal example
So I did that, but now I'm really at a loss because the pin names are exactly the same as in my hal file.
I even copied the setp line from my hal file directly in to terminal and it set the value correctly. Then i went through
and set all the in pins to a value in terminal, and toggled the sel pins randomly to see if the out pin would change.
No matter how I toggled the sel pins the out pin always returned 0.

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

More
19 Apr 2016 00:18 #73574 by andypugh
Replied by andypugh on topic Overrides Hal example
Nothing will happen to a HAL component in the terminal unless you "run" it.
But that is a slightly complicated thing with a realtime component, you have to create a thread, add the component to the thread, then start the thread.

So, something a bit like this, but not exactly because this is from memory... You can use tab-completion to do most of the typing for you.
loadrt threads
loadrt mux_generic config="ff32"
addf mux-gen.0 thread1
start
setp mux-gen.0.sel-1 1
setp mux-gen.0.in-float-00 10 
etc. Note the loadrt threads, the addf and the start command.

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

More
19 Apr 2016 22:45 #73621 by Mtndrew77
Replied by Mtndrew77 on topic Overrides Hal example
So after I ran it in terminal this way it started working when I launched Linuxcnc. I have no idea why because I didn't make any changes to my hal file. So hopefully it keeps working Thanks Andy

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

Time to create page: 0.099 seconds
Powered by Kunena Forum