Invoking "halcmd -s" within TCL script

More
4 years 11 months ago #225217 by HansU
Hi,
I want to use something like “halcmd -s show ...” with a library call in a TCL script. In halshow.tcl, the function hal seems to be the halcmd equivalent. But except the “-s” parameter. This isn’t accepted here.
My further investigation led to the definition of hal in linuxcnc.tcl.in.
Code:
proc hal {args} { load $::linuxcnc::TCL_LIB_DIR/hal.so eval hal $args }
 

Please Log in to join the conversation.

More
4 years 11 months ago #227317 by HansU
That is not possible because the hal library provides only the functions like "show" and so on  defined in halcmd.c:
Code:
{"show", FUNCT(do_show_cmd), A_ONE | A_OPTIONAL | A_PLUS},

But the command line option "-s" for scriptmode is only set in halcmd_main.c, so not accessible in the lib.

And of course it is also possible to invoke a subprocess with 'exec':
Code:
exec halcmd -s
Maybe not so performant as the library call.


 

Please Log in to join the conversation.

Time to create page: 0.067 seconds
Powered by Kunena Forum