Run hal Script
01 Feb 2013 08:19 #29412
by marsheng
Run hal Script was created by marsheng
How do I execute a list of hal commands in a script ?
Whether I run Halrun and then a script of straight from My desktop, it dose't matter.
EG
Loadrt siggen
Loadusr Halmeter
SetP siggen.0.amplitude 4
etc
Whether I run Halrun and then a script of straight from My desktop, it dose't matter.
EG
Loadrt siggen
Loadusr Halmeter
SetP siggen.0.amplitude 4
etc
Please Log in or Create an account to join the conversation.
01 Feb 2013 08:50 #29414
by alan_3301
Replied by alan_3301 on topic Run hal Script
unless I'm missing something,
put all your command in a .hal file
then at command line run:
halrun myfile.hal
Thats what the halrun man page makes it seem like.
put all your command in a .hal file
then at command line run:
halrun myfile.hal
Thats what the halrun man page makes it seem like.
Please Log in or Create an account to join the conversation.
01 Feb 2013 09:04 #29416
by BigJohnT
Replied by BigJohnT on topic Run hal Script
Might want to read the HAL tutorial in the HAL manual it give detailed instructions on how to use HAL from the command line.
John
John
Please Log in or Create an account to join the conversation.
01 Feb 2013 09:56 - 01 Feb 2013 09:57 #29420
by marsheng
Replied by marsheng on topic Run hal Script
Sorry to reword the question, to run a script and leave the halrun window open after the hal commands are run.
halrun myfile.hal works but then it closes the HalRun environment.
What I'm trying to do is to go into Halrun and set a known environment by executing a list of commands that I have tested and are working and then test a few more manual connections/entries.
Thanks
halrun myfile.hal works but then it closes the HalRun environment.
What I'm trying to do is to go into Halrun and set a known environment by executing a list of commands that I have tested and are working and then test a few more manual connections/entries.
Thanks
Last edit: 01 Feb 2013 09:57 by marsheng.
Please Log in or Create an account to join the conversation.
01 Feb 2013 11:29 #29423
by dgarrett
Replied by dgarrett on topic Run hal Script
(ref emc2.5.x)
1) If hal (or linuxcnc is already running):
$ halcmd -kf filename # source filename, then exit
$ halcmd -kf # interactive halcmd
When interactive in halcmd, you can "source" a file
and remain interactive, example:
$ cat t.hal
show pin
$ halcmd -kf
halcmd: source t.hal
...
2) If hal (and linuxcnc are not running) you can startup
the realtime system and hal:
$ halrun -kf filename # source filename, then exit
$ halrun -I -kf filename # source filename, then interactive halcmd
$ halrun -T -kf filename # source filename, then interactive haltcl
for more info:
$ man halrun
$ man haltcl
some experimentation is useful to understand the options
1) If hal (or linuxcnc is already running):
$ halcmd -kf filename # source filename, then exit
$ halcmd -kf # interactive halcmd
When interactive in halcmd, you can "source" a file
and remain interactive, example:
$ cat t.hal
show pin
$ halcmd -kf
halcmd: source t.hal
...
2) If hal (and linuxcnc are not running) you can startup
the realtime system and hal:
$ halrun -kf filename # source filename, then exit
$ halrun -I -kf filename # source filename, then interactive halcmd
$ halrun -T -kf filename # source filename, then interactive haltcl
for more info:
$ man halrun
$ man haltcl
some experimentation is useful to understand the options
Please Log in or Create an account to join the conversation.
Time to create page: 0.077 seconds