Glade Led in stand alone application Sample Project Zip file Included

More
8 years 10 months ago #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.

Please Log in to join the conversation.

More
8 years 10 months ago #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
Code:
gladevcp -c Gui3 -H Gui3.hal Gui3.glade

That will solve the problem ;-)

Norbert

Please Log in to join the conversation.

More
8 years 10 months ago #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 to join the conversation.

More
8 years 10 months ago #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.

Attachment not found

Please Log in to join the conversation.

Time to create page: 0.084 seconds
Powered by Kunena Forum