- Posts: 83
- Thank you received: 11
halshow with PathPilot 2
8 years 1 month ago - 8 years 1 month ago #117740
by rafferty
halshow with PathPilot 2 was created by rafferty
With these fixes ADMIN HALSHOW now works under PathPilot V2.1.3.
Can now also open a new shell while PathPilot is running and run halcmd, halmeter, halscope and halshow in that shell.
Required are one or two files not in PathPilot 2, they are halshow.tcl and haltcl. They are in the LinuxCNC distribution and in Stigoe's LinuxCNC Mint build Compiling full LinuxCNC to get realtime components for use with PathPilot 2 . Both are scripts.
The haltcl file is needed only for halrun which appears to work, halrun -U will certainly shutdown a running PathPilot but bringing up a new environment needs testing.
I tried to do this with minimum changes, no existing files are modified, all done by creating directories and linking to existing files.
The following lines assume /home/operator/tmc is a link to the current PathPilot (as it normally would be be)
Copy in the one required file
Optionally copy in and edit the haltcl file for halrun
Add the folloing three lines to the end of .bashrc to run hal commands from a shell (sorry, one existing file is modified)
Let me know if it works for you, if not I'll try and work out what I've left out.
Good luck.
---
Update:
halrun is running from a shell.
halrun -I file name works, as does the command "source filename" at the halrun interactive prompt (halcmd: )
The optional haltcl file doesn't seem to be required, I've not committed to removing yet, just renamed it out of reach until I work out why it seemed necessary at some stage.
Update2:
fixed first code section so the 3 directories are created in the right place.
Can now also open a new shell while PathPilot is running and run halcmd, halmeter, halscope and halshow in that shell.
Required are one or two files not in PathPilot 2, they are halshow.tcl and haltcl. They are in the LinuxCNC distribution and in Stigoe's LinuxCNC Mint build Compiling full LinuxCNC to get realtime components for use with PathPilot 2 . Both are scripts.
The haltcl file is needed only for halrun which appears to work, halrun -U will certainly shutdown a running PathPilot but bringing up a new environment needs testing.
I tried to do this with minimum changes, no existing files are modified, all done by creating directories and linking to existing files.
The following lines assume /home/operator/tmc is a link to the current PathPilot (as it normally would be be)
Code:
mkdir -p /home/operator/repos/tormach_linuxcnc/linuxcnc/
cd /home/operator/repos/
ln -s /home/operator/repos/tormach_linuxcnc/ pathpilot3
cd tormach_linuxcnc/linuxcnc/
mkdir bin
mkdir tcl
mkdir tcl/bin
sudo chmod 4755 home/operator/tmc/bin/rtapi_app
ln -s /home/operator/tmc/bin/rtapi_app /home/operator/repos/tormach_linuxcnc/linuxcnc/bin/rtapi_app
ln -s /home/operator/tmc/rtlib home/operator/repos/tormach_linuxcnc/linuxcnc/rtlib
ln -s /home/operator/tmc/tcl/hal.so /home/operator/repos/tormach_linuxcnc/linuxcnc/tcl/hal.so
ln -s /home/operator/tmc/tcl/linuxcnc.tcl /home/operator/repos/tormach_linuxcnc/linuxcnc/tcl/linuxcnc.tcl
ln -s /home/operator/tmc/tcl/linuxcnc.so /home/operator/repos/tormach_linuxcnc/linuxcnc/tcl/linuxcnc.so
ln -s /home/operator/tmc/scripts/halrun /home/operator/tmc/bin/halrun
Copy in the one required file
Code:
copy the halshow.tcl file to /home/operator/repos/tormach_linuxcnc/linuxcnc/tcl/bin/
Optionally copy in and edit the haltcl file for halrun
Code:
copy the haltcl file to /home/operator/tmc/bin/ and change the first two lines to
#!/usr/bin/tclsh8.6
load /home/operator/repos/tormach_linuxcnc/linuxcnc/tcl/hal.so
Add the folloing three lines to the end of .bashrc to run hal commands from a shell (sorry, one existing file is modified)
Code:
export LD_LIBRARY_PATH="/home/operator/tmc/lib"
export PATH="/home/operator/tmc/bin":$PATH
export LINUXCNC_RTLIB_DIR="/home/operator/tmc/rtlib"
Let me know if it works for you, if not I'll try and work out what I've left out.
Good luck.
---
Update:
halrun is running from a shell.
halrun -I file name works, as does the command "source filename" at the halrun interactive prompt (halcmd: )
The optional haltcl file doesn't seem to be required, I've not committed to removing yet, just renamed it out of reach until I work out why it seemed necessary at some stage.
Update2:
fixed first code section so the 3 directories are created in the right place.
Last edit: 8 years 1 month ago by rafferty. Reason: correct error in code list
Please Log in or Create an account to join the conversation.
8 years 1 month ago #118218
by rudydp
Replied by rudydp on topic halshow with PathPilot 2
The directory structure and links do not make sense to me. Either the directories bin, tlc and tlc/bin are in the wrong place (in repos), or the links in which they are referred to may be wrong.
Can you please check them again.
Can you please check them again.
Please Log in or Create an account to join the conversation.
- racedirector
- Offline
- Elite Member
-
Less
More
- Posts: 218
- Thank you received: 42
8 years 1 month ago #118268
by racedirector
Replied by racedirector on topic halshow with PathPilot 2
Thanks for this but a few things seem to be an issue.
Firstly you seem to create bin, tcl and tcl/bin in the wrong place, I created them in /home/operator/repos/tormach_linuxcnc/linuxcnc/ and then did the linking and all works.
What is the purpose of the pathpilot3 link? Doesn't seem to do anything
My install didn't need the haltcl file, ADMIN HALSHOW works without it.
Anyhow, again thanks for the effort, it works great!
Firstly you seem to create bin, tcl and tcl/bin in the wrong place, I created them in /home/operator/repos/tormach_linuxcnc/linuxcnc/ and then did the linking and all works.
What is the purpose of the pathpilot3 link? Doesn't seem to do anything
My install didn't need the haltcl file, ADMIN HALSHOW works without it.
Anyhow, again thanks for the effort, it works great!
Please Log in or Create an account to join the conversation.
8 years 1 month ago #118286
by rafferty
Replied by rafferty on topic halshow with PathPilot 2
Yes, you are both correct, the bin, tcl and tcl bin should be in /home/operator/repos/tormach_linuxcnc/linuxcnc/. I edited my list so the pathpilot3 link could be created easily and didn't look further ahead. I'll correct my earlier post to fix this.
About the pathpilot3 link, dumping files in tmc bin, lib, rtlib and tcl directories it looks like LinuxCNC/PathPilot was configured using a build path that contained pathpilot3.
Have a look at tmc/bin/halshow, a text file
Could be the link is needed if PathPilot hasn't set up the runtime environment. I've been running halshow -I <file> in one shell and then halshow in another shell (or some other hal command).
I'll have a look in the next couple of days at what exactly is needed for shell use and MDI ADMIN use.
Thank you both for the corrections.
About the pathpilot3 link, dumping files in tmc bin, lib, rtlib and tcl directories it looks like LinuxCNC/PathPilot was configured using a build path that contained pathpilot3.
Have a look at tmc/bin/halshow, a text file
Code:
#!/usr/bin/tclsh8.6
source /home/operator/repos/pathpilot3/linuxcnc/tcl/bin/halshow.tcl
Could be the link is needed if PathPilot hasn't set up the runtime environment. I've been running halshow -I <file> in one shell and then halshow in another shell (or some other hal command).
I'll have a look in the next couple of days at what exactly is needed for shell use and MDI ADMIN use.
Thank you both for the corrections.
The following user(s) said Thank You: racedirector
Please Log in or Create an account to join the conversation.
8 years 1 month ago #118326
by rafferty
Replied by rafferty on topic halshow with PathPilot 2
The pathpilot3 link is needed to run halscope from a shell.
Still not sure about the haltcl file, previously I said I'd renamed it out of the way to see if it was required but as I look today it's still there.
I moved it now, doesn't seem to be needed, but puzzled why I thought it was.
Still not sure about the haltcl file, previously I said I'd renamed it out of the way to see if it was required but as I look today it's still there.
I moved it now, doesn't seem to be needed, but puzzled why I thought it was.
Please Log in or Create an account to join the conversation.
7 years 11 months ago #121679
by smgvbest
Replied by smgvbest on topic halshow with PathPilot 2
It's actually easier than this
edit ~/tmc/bin/halshow
change
to
copy halshow.tcl from linuxcnc to ~/tmc/tcl/bin
make sure operator is owner, should be since you copied from that ID
you can get halshow.tcl from the git repo
github.com/LinuxCNC/linuxcnc/blob/master/tcl/bin/halshow.tcl
copy/paste into an editor and save it
this worked for me.
minimal changes needed
edit ~/tmc/bin/halshow
change
Code:
#!/usr/bin/tclsh8.6
source /home/operator/repos/pathpilot3/linuxcnc/tcl/bin/halshow.tcl
to
Code:
#!/usr/bin/tclsh8.6
source ~/tmc/tcl/bin/halshow.tcl
copy halshow.tcl from linuxcnc to ~/tmc/tcl/bin
make sure operator is owner, should be since you copied from that ID
you can get halshow.tcl from the git repo
github.com/LinuxCNC/linuxcnc/blob/master/tcl/bin/halshow.tcl
copy/paste into an editor and save it
this worked for me.
minimal changes needed
The following user(s) said Thank You: gerritv
Please Log in or Create an account to join the conversation.
Time to create page: 0.304 seconds