(Solved) Probe Basic - HAL pins not being created

More
2 months 5 days ago #349068 by spumco
Now that I've got the user tabs, ATB buttons, and user DRO showing up, the next snag is creating hal pins.

I added some hal LED indicators to my custom DRO panel, but they aren't being created when LCNC/PB is started.  At least they don't appear in halshow.

Dragged & dropped a HalLedIndicator in the panel
edited the object name
edited the pinBaseName

Just trying to get an on-screen indicator of an "is-homed" status.

I remember running in to this issue a few years ago - that time I was missing the lines in custom_config.yml:
Code:
exportedhal:     provider: qtpyvcp.plugins.exported_hal:ExportedHal

I added the above under data_plugins: but still no joy.

Do I need to add this:
Code:
from qtpyvcp import hal # create a new component and add some pins comp = hal.getComponent("loop-back") comp.addPin("in", "float", "in") comp.addPin("out", "float", "out") # mark the component as 'ready' comp.ready() # define a function to call when the input pin changes def onInChanged(new_value): # loop the out pin to the in pin value comp.getPin('out').value = new_value # connect the listener to the input pin comp.addListener('in', onInChanged)

To the dros_user.py file somewhere?
 

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

More
2 months 4 days ago #349084 by spumco
After a bit more digging, I'm guessing the "# create a new component..." stuff is for creating a new component and not for just linking qtpyvcp hal widgets to hal.

Reviewing the terminal output during PB startup, it looks like 'exported hal' is working, or at least not throwing a warning:

 

Not sure what this warning is:

 

Attached the full terminal output during startup, halshow showing no pin being created, as well as a screenshot of the hal led indicator I'm trying to connect.

 

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

More
2 months 3 days ago #349130 by spumco
Still can't get halpins to show up, but I used the widget rules to cook up a workaround...

DRO is now sorted.  Red = unhomed, black = homed

Personal preference is not to have anything that can zero out my DRO with one click.  And since I've got a physical 'home-all' button and no need for a 'go-to-zero' function, those could leave the chat, too.

 

I can keep going for now, but I'd still like to figure out the missing hal pins if anyone's got an idea.

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

More
1 month 4 weeks ago - 1 month 4 weeks ago #349218 by Lcvette
did you add the halpins to the postgui hal file?  you can use the blue led on the touch probe graphic as an example for wiring it up.
Last edit: 1 month 4 weeks ago by Lcvette.
The following user(s) said Thank You: spumco

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

More
1 month 4 weeks ago #349230 by spumco
I did not add the pins to post-gui.hal.  I was under the impression that qtpyvcp created the halpins outside of the user-config HAL process.

I see pins like qtpyvcp.probe-in and qtpyvcp.timerhours.in in the demo post-gui hal file but there is no loadrt or addf statements present.

I hadn't bothered trying to connect the new qtpyvcp pins until I could see them in halshow.  All the 'standard' probe basic or qtpyvcp pins are present in halshow... just not the new ones I'm trying to create.

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

More
1 month 4 weeks ago #349243 by Lcvette
the user tabs get loaded after so they may need to be loaded through post gui hal so they get initialized during startup otherwise they may be created after the initial ui loads but before the child ui is loaded. but just guessing as i have not tried what you are doing before with halpins,. if you have them listed in the main hal file i would move them to the post gui and retest.
The following user(s) said Thank You: spumco

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

Moderators: KCJ, Lcvette
Time to create page: 0.181 seconds
Powered by Kunena Forum