Invoking "halcmd -s" within TCL script

More
04 Nov 2021 09:45 - 23 Nov 2021 19:28 #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.
proc hal {args} {
load $::linuxcnc::TCL_LIB_DIR/hal.so eval hal $args
}
 
Last edit: 23 Nov 2021 19:28 by HansU.

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

More
22 Nov 2021 19:45 - 23 Nov 2021 19:26 #227317 by HansU
That is not possible because the hal library provides only the functions like "show" and so on  defined in halcmd.c:
{"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':
exec halcmd -s
Maybe not so performant as the library call.


 
Last edit: 23 Nov 2021 19:26 by HansU.

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

Time to create page: 0.065 seconds
Powered by Kunena Forum