halshow with PathPilot 2

More
19 Sep 2018 08:54 - 01 Oct 2018 13:06 #117740 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)
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
copy the halshow.tcl file to /home/operator/repos/tormach_linuxcnc/linuxcnc/tcl/bin/ 

Optionally copy in and edit the haltcl file for halrun
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)
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: 01 Oct 2018 13:06 by rafferty. Reason: correct error in code list
The following user(s) said Thank You: andypugh, gerritv, Clive S, tivoi, racedirector

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

More
30 Sep 2018 06:34 #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.

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

More
01 Oct 2018 05:29 #118268 by racedirector
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!

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

More
01 Oct 2018 13:00 #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
#!/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.

More
01 Oct 2018 23:30 #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.

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

More
01 Dec 2018 16:35 #121679 by smgvbest
Replied by smgvbest on topic halshow with PathPilot 2
It's actually easier than this
edit ~/tmc/bin/halshow

change
#!/usr/bin/tclsh8.6
source /home/operator/repos/pathpilot3/linuxcnc/tcl/bin/halshow.tcl

to
#!/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.

More
01 Dec 2018 19:52 #121686 by rafferty
Replied by rafferty on topic halshow with PathPilot 2
Wow, that is a lot less work!

It was three months ago when I was looking at this, my ageing brain has discarded the details of the changes.

I had two aims, 1) have a working halshow from Pathpilot and 2) being able to run the various hal tools from a terminal without starting PathPilot.

Have you tested my 2nd aim, the hal tools in a terminal without PathPilot running?

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

More
02 Dec 2018 19:58 #121725 by smgvbest
Replied by smgvbest on topic halshow with PathPilot 2
Change these
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)
export LD_LIBRARY_PATH="/home/operator/tmc/lib"
export PATH="/home/operator/tmc/bin":$PATH
export LINUXCNC_RTLIB_DIR="/home/operator/tmc/rtlib"

to
copy the haltcl file to /home/operator/tmc/bin/ and change the first two lines to 
#!/usr/bin/tclsh8.6
load /home/operator/tcl/hal.so
Add the following three lines to the end of .bashrc to run hal commands from a shell (sorry, one existing file is modified)
export LD_LIBRARY_PATH="~/tmc/lib"
export PATH=~/tmc/bin:~/tmc/scripts:$PATH
export LINUXCNC_RTLIB_DIR="~/tmc/rtlib"

that should do the same thing
I haven't checked it but if that was all you had to do that change to PATH should be all that's needed

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

More
23 Mar 2020 18:22 #161238 by DanieGouws
Replied by DanieGouws on topic halshow with PathPilot 2
Hi,

I'm also trying to get Halshow running for PathPilot on a non-Tormach machine. Halscope and Halmeter are working.

I have copied halshow.tcl from another Linuxcnc installation running on a 64 bit machine, as far as I can see it is the same version as the one available at git repo.

However, I cannot seem to find the lines of code:

#!/usr/bin/tclsh8.6
source /home/operator/repos/pathpilot3/linuxcnc/tcl/bin/halshow.tcl
in the code.

In my halshow.tcl the 1st few lines of code looks like:

#!/bin/sh
# the next line restarts using emcsh \
exec $LINUXCNC_EMCSH "$0" "$@"

###############################################################
# Description: halshow.tcl
# This file, shows a running hal configuration
# and has menu for modifying and tuning
#
# Author: Raymond E Henry
# License: GPL Version 2
#
# Copyright (c) 2006-2009 All rights reserved.
###############################################################
# FIXME -- empty mod entry widgets after execute
# FIXME -- please hal param naming conventions aren't
###############################################################

# Load the linuxcnc.tcl file, which defines variables for various useful paths
source [file join [file dirname [info script]] .. linuxcnc.tcl]

Hope you can help, thank you very much

Danie

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

More
24 Mar 2020 02:32 #161307 by rafferty
Replied by rafferty on topic halshow with PathPilot 2
I think you are editing at the wrong file.

The file to edit is "haltcl" not "halshow.tcl".

Ken

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

Moderators: cncbasher
Time to create page: 0.188 seconds
Powered by Kunena Forum