Custom GUI - how to launch Hal Meter, Hal Scope, etc.

08 May 2018 15:34 #110386 by tripwire
I'm using LCNC 2.8-pre and Glade 3.8.6.

I've gotten pretty far along with my stand-alone Glade VCP gui app but can't seem to figure out how to launch Hal Meter, Hal Scope, Status, Config, etc. like Axis does from the "Machine" menu. I've discovered MDI commands such as HALMETER and STATUS that do work as MDI input, but I've tried to add these commands to a vcp mdi action, attached to a menu item, but these fail with messages such as, "interp_error: Unknown word starting with a". ("Normal commands such as G0 X0Y0 *do* work.)

Is there a proper way to do this with a vcp mdi action? Or is there something I can do programmatically in python? (I've tried issuing a self.c.mdi('HALMETER') but get the same error as stated above.)

Thanks as always for any help provided!

Dave L.
08 May 2018 17:56 #110393 by cmorley
I might suggest looking at gscreen's source code - it was made for producing custom screens.
I'll agree its hard to digest and not well documented.
for instance to load halmeter while using gscreens system would be:

but to answer your question; in python:
p = os.popen("halmeter &")

p = os.popen("halscope > /dev/null &","w")

linuxcnc status:

p = os.popen("linuxcnctop > /dev/null &","w")

TCLPATH = os.environ
p = os.popen("tclsh %s/bin/halshow.tcl &" % (TCLPATH))

Chris M
The following user(s) said Thank You: tripwire
08 May 2018 18:04 - 08 May 2018 19:40 #110394 by tripwire
Thanks for the info, Chris! I'll check those out.

checked it out. All the os functions worked great except I had trouble with "halshow". I found an executable file named "halshow" in /usr/bin and called it from python with a simple p = os.popen("/usr/bin/halshow","w"). This worked.

Thanks again!
Last edit: 08 May 2018 19:40 by tripwire.
09 May 2018 22:00 #110463 by andypugh
If you don't need them from the GUI you can get them from the terminal.

halcmd loadusr halmeter

I do this a lot, as I tend to use Touchy which doesn't have built-in ways to launch the tools.
Moderators: mhaberler
Time to create page: 0.065 seconds
Powered by Kunena Forum