Invoking "halcmd -s" within TCL script
04 Nov 2021 09:45 - 23 Nov 2021 19:28 #225217
by HansU
Invoking "halcmd -s" within TCL script was created 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.
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.
22 Nov 2021 19:45 - 23 Nov 2021 19:26 #227317
by HansU
Replied by HansU on topic Invoking "halcmd -s" within TCL script
That is not possible because the hal library provides only the functions like "show" and so on defined in halcmd.c:
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':Maybe not so performant as the library call.
{"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
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