Button on Linuxcnc interface that switches an output on Mesa 7i76e on and off

More
1 year 3 weeks ago #336197 by DerKlotz
Hello,
I would like to have a header on my Linuxcnc interface that switches Pin17=hm2_7i76e.0.7i76.0.0.output-00 on and off on my Mesa7i76e. So far, I have created an LED and a button in Glade. This already appears on the Linuxcnc interface, but no control content is stored. How do I proceed? I tried to do some preliminary work on the Glade page, but failed. What do I need to do and where?
Thank you

Please Log in to join the conversation.

More
1 year 3 weeks ago #336198 by Aciera
You'll need to make the hal connections in the postgui_hal file. Have a look at the millturn sim confi, (uses an xml instead of a glade file but the setup is the same.
github.com/LinuxCNC/linuxcnc/tree/master...xis/vismach/millturn

Please Log in to join the conversation.

More
1 year 3 weeks ago #336200 by DerKlotz
I only became a Glade user today... so I don't have any experience yet. Please take a look at the attachments. I have the following questions:
Do I have to enter something in Glade -> Light Button -> Signals -> Handler? Do I enter this handler in postgui?
I entered the command in postgui. This does not start linuxcnc. Do I have the correct command from Halshow for postgui.hal?

Please Log in to join the conversation.

More
1 year 3 weeks ago #336203 by Aciera
That does not work because you have forgotten to give a signal name after the 'net' command.

I entered the command in postgui. This does not start linuxcnc. Do I have the correct command from Halshow for postgui.hal?

Not sure I understand this correctly but halshow does not make any distinction between postgui and regular hal files.
The regular hal files are read before the gui has loaded so if any gui related halpins are used in these files you will get a startup error because those pins are missing. The postgui halfile is read after the GUi and the custom panels have loaded.

Please Log in to join the conversation.

More
1 year 3 weeks ago #336204 by Aciera
Note that you can use either a handler or the postgui halfile to make the connections.

Please Log in to join the conversation.

More
1 year 2 weeks ago #336211 by DerKlotz
Can you help me understand how Glade and Handler work? I've already created the switch and the LED. How do I now connect them so that pin 17 switches on and off? I'm completly stuck.

Please Log in to join the conversation.

More
1 year 2 weeks ago #336221 by andypugh
If your Glade UI element is of type "Hal button" then the HAL pin will be created automatically and no handler file is needed.

(This is stated with 93% confidence, I don't have easy access to a LinuxCNC machine at the moment to test this assertion)

Please Log in to join the conversation.

More
1 year 2 weeks ago #336265 by Aciera
You don't need a handler for what you want.

Here is an example that creates a led connected to 'halui.machine.is-on' and a button connected to 'halui.machine.on'  

 

Attachment not found



 

Attachment not found

Please Log in to join the conversation.

More
1 year 2 weeks ago #336279 by DerKlotz
When i start linuxcnc with just setp gladevcp.table1" in the postgui i receive this error message

Code:
Starting DISPLAY program: axis module 'hitcounter' skipped - import error: No module named 'hitcounter' 71303171 ['halcmd', 'loadusr', '-Wn', 'gladevcp', 'gladevcp', '-c', 'gladevcp', '-d', '-x', '79691919', '-u', './hitcounter.py', '/home/cnc/linuxcnc/configs/Fräse/test.glade'] Shutting down and cleaning up LinuxCNC... Running HAL shutdown script


Any ideas how to fix it?

I found this  github.com/LinuxCNC/linuxcnc/blob/2.9/configs/sim/hitcounter.py
I created a file hitcounter.py in /home/cnc/linuxcnc/configs/Fräse/ with the contend from the link

A little different error

Code:
Starting DISPLAY program: axis 77594627 ['halcmd', 'loadusr', '-Wn', 'gladevcp', 'gladevcp', '-c', 'gladevcp', '-d', '-x', '75497615', '-u', './hitcounter.py', '/home/cnc/linuxcnc/configs/Fräse/test.glade'] Shutting down and cleaning up LinuxCNC...

Please Log in to join the conversation.

More
1 year 2 weeks ago #336306 by Aciera
I'm sorry, I forgot the ini file part:

[DISPLAY] section:
Code:
GLADEVCP = example.ui


[HAL]
Code:
POSTGUI_HALFILE = example_postgui.hal

Please Log in to join the conversation.

Time to create page: 0.198 seconds
Powered by Kunena Forum