Am I doing this right? GVCP Buttons UI and PythonScrip (Arduino)

More
29 Jun 2021 03:19 #213208 by CNC4Life
Hello guys and gals. I'm looking for a little help, I'm slowly working through a machine upgrade and I'm struggling with HAL a bit.

Ok, my first issue is I'm trying to link pins from usrload (user space) with a python script for my ATC to some GVCP buttons.
All the tutorials lead me to believe I should just be able to go
net ButtonName user.Python <= gvcp.Button  in post_gui_call_list.hal

But instead, it is more like 
arduino.hal
net pythonSig user.Python

GVCP.hal
net gvcpBtn  gvcp.Button

post_gui_call_list.hal
unlinkp user.Python
unlinkp gvcp.Buttom
net ButtonName  user.Python <= gvcp.Buttom
​​​​​
Also, is there a way to net a bunch of things together. Like map machine-enabled, or e-stop to a bunch of different pins? I know I can use "and" but that also seems like I'm doing it wrong.

I've attached the files in question, I appreciate any help in advance. It works but seems like this can't be the best way.
 
Attachments:

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

More
29 Jun 2021 22:43 #213284 by andypugh
Signal names and pin names are valid in all HAL files, so to connect pins in different HAL files, just use the same signal name.

Your example will work, but it makes no sense to link to two signals, then unlink and relink differently.

You could just have

net ButtonName user.Python in one file and net ButtonName gvcp.Button in the other.

And a net can consist of one signal name, one output "writer" pin and as many input ("reader") pins as you need.

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

More
30 Jun 2021 20:39 - 30 Jun 2021 20:40 #213368 by CNC4Life
Oh, I see! I'll give it a try! I knew it didn't seem right.

Before I was doing user.Python <= gvcp.Button this would cause an already mapped error. I tried to pythonSig <= gvcpBtn and that gave an unknown pin pythonSig or gvcpBtn.

Thanks a bunch.
Last edit: 30 Jun 2021 20:40 by CNC4Life.

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

More
02 Jul 2021 23:52 #213520 by andypugh
HAL takes us all a little while to grasp. But before you know where you are you will be jumping out of bed with an an idea and looking for pen and paper to write the idea down.
(Happened to me when I realised that LinuxCNC could do gear hobbing on a a milling machine)

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

More
03 Jul 2021 10:01 #213548 by tommylight

HAL takes us all a little while to grasp. But before you know where you are you will be jumping out of bed with an an idea and looking for pen and paper to write the idea down.
(Happened to me when I realised that LinuxCNC could do gear hobbing on a a milling machine)

Happened to me a lot, hal is magnificent! :)

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

More
03 Jul 2021 12:25 #213553 by bevins
I had a HAL of a time trying to figure it out and still struggle with it everyday......

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

More
03 Jul 2021 13:30 #213560 by BigJohnT

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

Time to create page: 0.076 seconds
Powered by Kunena Forum