Need a little help tweaking a HAL file

More
08 Jul 2024 17:51 - 08 Jul 2024 17:54 #304684 by slowpoke
I have really minimal expeirience tweaking HAL files, I hope someone can help.

I have an Arduino board communicating with HAL via the USB port.

Details if interested can be found here: forum.linuxcnc.org/10-advanced-configura...oard?start=10#304669
When I stimulate an Arduino input the target in HAL watch changes, when I change the status of an output from within HAL watch using the set and clear buttons, the output on the Arduino  changes as commanded by HAL.

I'm now thinking about the data I need to transfer and how I would go about that using HAL. If I can do the following I can probably figure out everything else I need to do.

Questions:
1) At the moment I need to execute "loadusr arduino-connector" in HALshow to start the python program that receives the serial data and then passes it to HAL, How would I do this automatically every time LinuxCNC starts?

2) I would like to run a single bit loop timing test, and see how fast or slow a round-trip message takes. So assume I will activate Arduino input 7 and then I want HAL to activate Arduino output 8 when and while input 7 is active. I will then scope the response.

3) How would I activate output 9 when
a) machine power is on
b) when say the MDI screen is selected

Much appreciated

Jeff
 
Attachments:
Last edit: 08 Jul 2024 17:54 by slowpoke.

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

More
08 Jul 2024 19:31 #304688 by tommylight
1 if it is a component that has been compiled, then in hal:
loadrt arduino-connector
-if it is a userspace component with no compiling
loadusr arduino-connector
In this case i would assume the second is correct, although might need add -W, no idea why but i see this used a lot, so if the above does not work
loadusr -W arduino-connector

2 to complicated and not the right sequence, so
-use the hal scope to monitor output 8 and input 7, set it to single trigger on output
-set the output true in hal show
-check the scope for how long it took from triggering the output to when the input was sensed

3
a : net halui.machine.is-on ==> arduino.pin.number
or net x-enable ==> arduino.pin.number
also y-enable and z-enable work
or net e-stop.out ==> arduino.pin.number
The last one works if e-stop is in use and when it is not pressed, not when machine is enabled with F2

b : net halui.mode.mdi ==> arduino.pin.number
The following user(s) said Thank You: slowpoke

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

Time to create page: 0.082 seconds
Powered by Kunena Forum