Glade Led in stand alone application Sample Project Zip file Included

More
19 Dec 2017 18:52 - 23 Dec 2017 00:44 #103351 by Grotius
Hi,

I have a problem with turning on a simple Led in my stand alone Linuxcnc application. I have ask this before on this forum,
but i see my old topic is gone with the wind.

The connection is to see the hardware input pin 10-15 to a glade led 1-5 on the screen.

1. I have a ladderdiagram working and i see the input's coming in. That is all working nice.
2. I also see in the signal list that the Glade led pin's are connected to Linuxcnc , They are called "Gui3.input_led1" for example.

In the hal file I connect the signal's and it is not working. At startup Linuxcnc i see the message : Gui3.input_led1 is not present.
So i am sure i do the hal script connection the good way.

I also have invest much time in how the Axis, Gmocappy and the Gscreen interfacing's are working with led signals.
The Gmocappy and Gscreen don't connect them directly to the hardware port pin's.

Why is this simple led thing not working in a stand alone Linuxcnc application?

Does anyone know's a simple solution? Because i think if there is no simple solution i must use widget's code's to get the led's working. And that make thing's more complicated.
Last edit: 23 Dec 2017 00:44 by Grotius.

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

More
19 Dec 2017 20:02 - 19 Dec 2017 20:02 #103357 by newbynobi
Replied by newbynobi on topic Glade Led will not work
If on start the glade led is not present, the hal connections can not be made, so they will never work!

You have to connect the hal pin after the GUI is loaded. So use either a postgui.hal file to connect them or even better use a dedicated hal file in the line you load the glade file.

Like
gladevcp -c Gui3 -H Gui3.hal Gui3.glade

That will solve the problem ;-)

Norbert
Last edit: 19 Dec 2017 20:02 by newbynobi.

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

More
19 Dec 2017 20:34 #103361 by Todd Zuercher
The hal pins created by your GladeVCP have to be connected in the postgui hal file, because they are not pressent until after the gui has started. If you try to use those pin in a regular hal file you will get the pin not found error because the regular hal files are read before the gui starts.

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

More
23 Dec 2017 00:52 #103468 by Grotius
Dear Norbert and Todd,

Many many thanks for your help.

I started a new tiny project ( gnipsel.com/linuxcnc/gui/gui06e.html ) just to ged a led in a stand alone application working. Finally it is working now. Now i can say it's not difficult. HIHI. But it was a hard problem for me to solve.

Attached is a stand alone project to see a working led.
The zip is included with a readme file for installation guide.

File Attachment:

File Name: gui6.tar_2...12-22.gz
File Size:7 KB
Attachments:

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

Time to create page: 0.065 seconds
Powered by Kunena Forum