Custom Panel's HAL file cannot load postgui?

More
31 Dec 2022 01:05 #260598 by blazini36
I was having some odd issues (probably CAM related) with a Mill running gmoccapy/LCNC 2.7(I think). It's been setup the same way for over 2 years, with a gladevcp custom panel embedded in  "EMBED_TAB_LOCATION = box_custom_3". I decided to migrate this thing to a new PC and 2.8.4 from the ISO. I started off copying the config.

Originally the HAL connections for the custom panel were made in custom_postgui.hal. This seems to be a problem now for some reason. Reading the Gmoccapy docs it says

If you make any hal connections to you custom glade panel, you need to do that in the hal file specified in the EMBEDDED_TAB_COMMAND line

Since I'm having trouble I did it that way even though it wasn't the case before. The gladevcp panel is named "spindle_control.glade". I copied out the hal connections and put them into a file "spindle_control.hal". My postgui_call_list.hal is:
source HAL_Files/custom_postgui.hal
source HAL_Files/spindle_control.hal

I will get the error:
**** GMOCCAPY INFO : postgui halfile = HAL_Files/postgui_call_list.hal ****:
HAL_Files/spindle_control.hal:6: Pin 'spindle_control.hal_vbarSpinMspeed' does not exist
If I comment out the "source HAL_Files/spindle_control.hal" line, LinuxCNC will start. In halshow I can see that all the pins created in the panel exist (without connections obviously). I can copy a net line from the spindle_control.hal file and make the connection in halshow, so the panel, and it's gladevcp pins are working. It looks like Gmoccapy is loading the panel too late, after it's hal file has tried to load.

I've tried to omit the postgui_call_list.hal from the ini and load both the custom_postgui.hal and spindle_control.hal as POSTGUI_HALFILE's from the ini but it appears that you cannot load 2 postgui hal files from the ini, the 2nd just doesn't load. I've tried TWOPASS=on which does not help. Attaching the config cuz someone will probably ask but I'm fairly certain this is a loading order/timing issue. Any fix or workaround? 

File Attachment:

File Name: PM25MV_7i76e_DMM.zip
File Size:39 KB
Attachments:

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

More
31 Dec 2022 03:44 #260603 by Todd Zuercher
It sounds like you're "spindle_control.hal" file isn't saved in the dir that Linuxcnc is looking for it in.  Is it saved in the same place as the file "custom_postgui.hal" is?  Alternatively you could add the lines from the spindle_control.hal to the custom_postgui.hal and use only that one.

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

More
31 Dec 2022 03:50 #260604 by blazini36
I've been messing with this for a while now. I went back to the manual and noticed the gladevcp -H option. I also spoofed a pncconf gmoccapy config so I can see what it does. I setup a gvcp_call_list command file just like pcnconf does.

So now LinuxCNC sill start, the custom panel and hal file will crash and gmoccapy will print that the pins don't exist, however they do....halshow will show the pins and they've even connected to the signals. There is an analog pin connecting to a Vscale that I can watch dance around in halshow so the pins definately netted. I hope I'm missing something because now I'm really confused.

I checked the gvcp-panel.ui that the pncconf config generated and that is a gtk2 panel just as mine is so that shouldn't be a problem.

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

More
31 Dec 2022 04:04 - 31 Dec 2022 04:14 #260605 by blazini36

It sounds like you're "spindle_control.hal" file isn't saved in the dir that Linuxcnc is looking for it in.  Is it saved in the same place as the file "custom_postgui.hal" is?  Alternatively you could add the lines from the spindle_control.hal to the custom_postgui.hal and use only that one.
 

 
The error I posted in code tags is from the hal file trying to make a connection to a pin that does not exist. It does not exist because the gladevcp panel has not loaded it yet. If the hal file didn't load, there would be no error as I mentioned as a test I commented out the line to load the hal file. Obviously in that case there are no pin connections either. Also as I mentioned the original config I migrated from was just 1 file, it was all in "custom_postgui.hal". Something has changed where this is not possible anymore, I've seen it mentioned while searching.

As I mentioned in the 2nd post I made. Using the gladevcp -H option still throws console errors....and the panel crashes, but all gladevcp pins created and netted if not for the fact that.....well the panel is not visable, it would be working. Forgot to mention in the last post, this is what I'm launching the tab with now...
EMBED_TAB_NAME = spindle_control
EMBED_TAB_LOCATION = box_custom_3
EMBED_TAB_COMMAND = gladevcp -c spindle_control -H HAL_Files/gvcp_call_list.hal -x {XID} GUI_Panels/spindle_control.glade
 
Last edit: 31 Dec 2022 04:14 by blazini36.

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

More
31 Dec 2022 13:21 - 31 Dec 2022 13:23 #260637 by HansU
I cannot run your configuration (I don't have your mesa card), but I extended a gmoccapy sim configuration by this:
EMBED_TAB_NAME = spindle_control 
EMBED_TAB_LOCATION = box_custom_3 
EMBED_TAB_COMMAND = gladevcp -H spindle_control.hal -x {XID} spindle_control.glade

spindle_control.glade is your file but in spindle_control.hal I only tried to connect one signal as I don't have your signals from the main HAL file.
So this file consists only of this line:
net spindle-abs => spindle_control.hal_vbarSpinCur
and it works.
Prerequisite is the line
net spindle-abs  abs_spindle_feedback.out  =>  gmoccapy.spindle_feedback_bar
in the postgui.hal file.
Last edit: 31 Dec 2022 13:23 by HansU.

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

More
31 Dec 2022 13:27 #260638 by HansU

Originally the HAL connections for the custom panel were made in custom_postgui.hal. This seems to be a problem now for some reason. Reading the Gmoccapy docs it says

If you make any hal connections to you custom glade panel, you need to do that in the hal file specified in the EMBEDDED_TAB_COMMAND line

Since I'm having trouble I did it that way even though it wasn't the case before.

It seems that the POSTGUI_HAL files are called before the custom widgets are created. Maybe this was different in 2.7-

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

More
31 Dec 2022 16:24 #260656 by blazini36

 

It seems that the POSTGUI_HAL files are called before the custom widgets are created. Maybe this was different in 2.7-

The display program's handler file (the python file) handles calling the postgui file, at least that's always been the case.

So I did manage to get it working by adding connections back to the spindle_control.hal file little by little. It looks like there were a couple of errors that 2.7 didn't seem to care about that 2.8.4 actually does. I can believe that because I know earlier versions of LCNC let you get away with things in postgui files that were technically illegal.

For reference,
net machine-is-on <= spindle_control.HLB_ServoFree-enable
was bad because the glade file didn't have the option set to "Create enable pin"

and
net GUI-spindle-drive-enable  => spindle_control.HLB_ServoFree-light
net spindle-drive-enable      => spindle_control.HLB_ServoFree-light

Is an error because 2 output signals are connected to 1 input pin. So it looks like the errors it was giving me about "pin xxx does not exist" is because the panel/halfile crashed with the errors before those pins were created. So it looks like you just have to be careful messing with postgui files in 2.8.4 as it will catch the errors but the reporting is likely to be off.

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

More
31 Dec 2022 18:26 #260669 by HansU
Ok interesting. So did it work now again with your initial config where you connect the pins of the custom panel in the postgui HAL file?

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

More
31 Dec 2022 22:41 #260680 by blazini36
I'm not sure, I just kept working on the separate hal file. Since I already started down the rabbit hole I started making a better functioning panel with new logic since that one was pretty well thrown together. This one is much better.

 
Attachments:
The following user(s) said Thank You: besriworld

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

Moderators: newbynobiHansU
Time to create page: 0.234 seconds
Powered by Kunena Forum