gladevcp error: Asking for a HAL component using a name that already exists.

More
16 Jan 2023 12:06 - 16 Jan 2023 12:27 #262117 by JetForMe
I'm trying to get a sort of "hello world" example going with HAL, Python, and .ui files. I copied the manual-example.ui file to a directory, renamed it to "mypanel.ui", and then added an empty mypanel.hal file. I also copied hitcounter.py as mypanel.py. Then I run it all with

gladevcp -d -H mypanel.hal -u mypanel.py mypanel.ui

So far, so good. But then I tried enabling the containers, because the docs talk about how the HAL containers are disabled by default. It says "To just activate a container, execute the HAL command setp gladevcp.<container-name> 1"

I'm not sure how to execute a HAL command so that the running gladevcp will see the change, but I tried putting it in mypanel.hal: "setp gladevcp.settings 1", which matches the Glade ID of one of the HAL_Table widgets, and ran gladevcp again. But then I get:

camsync.hal:1: parameter or pin 'gladevcp.settings' not found
'halcmd -f camsync.hal' exited with 1

And now if I just run again, I get

HAL: ERROR: duplicate component name 'mypanel'
*** GLADE VCP ERROR:    Asking for a HAL component using a name that already exists.

I assume this is because halcmd exited with that error about the missing pin. But I can't figure out where the state is kept that keeps that HAL component in existence. In any case, I figured out that `halcmd show` seems to clear it out, and I can run again (fyi, `halcmd list` does not clear the state).

Note that this doesn't happen when I run axis, just gladevcp.

So, a few questions:
  1. How do I issue hal commands while gladevcp is running, so I can test my VCP? Is that even possible?
  2. How do I enable a container in my VCP?
  3. For completeness, why does it think there's already a HAL component with that name, even though nothing appears to be running?
Last edit: 16 Jan 2023 12:27 by JetForMe.

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

More
16 Jan 2023 23:46 #262193 by andypugh

How do I issue hal commands while gladevcp is running, so I can test my VCP?


One way is to open a new HAL session in a terminal window with "halcmd -kf"

why does it think there's already a HAL component with that name, even though nothing appears to be running?


"halcmd show funct" might answer the question. (or just "show funct" if you have done the "-kf" above.

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

More
17 Jan 2023 01:35 #262202 by JetForMe
Thanks for -kf, that's great, and works as expected. 'show funct` didn't show anything, but it does reset the HAL so I can launch gladevcp again. Go figure.

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

More
17 Jan 2023 19:11 #262262 by HansU

So far, so good. But then I tried enabling the containers, because the docs talk about how the HAL containers are disabled by default

Only the LinuxCNC specific containers are disabled by default: linuxcnc.org/docs/2.9/html/gui/gladevcp.html#gladevcp:hal-table
If you are using Gtk containers, they don't have to be enabled explicitly.

I never tested GladeVCPs stand-alone, so I don't know how far gladevcp can interact with HAL when both are just started separately.
Maybe it's the easiest if testing the GladeVCP in a sample config.

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

More
18 Jan 2023 00:45 #262292 by JetForMe
I think I figured it out. By default, gladevcp creates the HAL component based off the name of the .ui file passed to it. The example for VCPs in Axis expressly names it 'gladevcp', which is why it would work in Axis but not in GladeVCP.

And halcmd does in fact seem to work as expected, once you get the component name right ;)

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

Moderators: mhaberlerHansU
Time to create page: 0.212 seconds
Powered by Kunena Forum