- User Interfaces
- GladeVCP
- gladevcp error: Asking for a HAL component using a name that already exists.
gladevcp error: Asking for a HAL component using a name that already exists.
16 Jan 2023 12:06 - 16 Jan 2023 12:27 #262117
by JetForMe
gladevcp error: Asking for a HAL component using a name that already exists. was created 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
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:
And now if I just run again, I get
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:
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:
- How do I issue hal commands while gladevcp is running, so I can test my VCP? Is that even possible?
- How do I enable a container in my VCP?
- 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.
16 Jan 2023 23:46 #262193
by andypugh
One way is to open a new HAL session in a terminal window with "halcmd -kf"
"halcmd show funct" might answer the question. (or just "show funct" if you have done the "-kf" above.
Replied by andypugh on topic gladevcp error: Asking for a HAL component using a name that already exists.
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.
17 Jan 2023 01:35 #262202
by JetForMe
Replied by JetForMe on topic gladevcp error: Asking for a HAL component using a name that already exists.
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.
17 Jan 2023 19:11 #262262
by HansU
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.
Replied by HansU on topic gladevcp error: Asking for a HAL component using a name that already exists.
Only the LinuxCNC specific containers are disabled by default: linuxcnc.org/docs/2.9/html/gui/gladevcp.html#gladevcp:hal-tableSo far, so good. But then I tried enabling the containers, because the docs talk about how the HAL containers are disabled by default
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.
18 Jan 2023 00:45 #262292
by JetForMe
Replied by JetForMe on topic gladevcp error: Asking for a HAL component using a name that already exists.
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
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: HansU
- User Interfaces
- GladeVCP
- gladevcp error: Asking for a HAL component using a name that already exists.
Time to create page: 0.097 seconds