Thanks Jeff and Ken,
In the end I used:
iniFile = emc.ini(os.environ['INI_FILE_NAME'])
emc.nmlfile = os.path.join(os.path.dirname(os.environ['INI_FILE_NAME']),
iniFile.find("EMC", "NML_FILE"))
A bit ugly but it gets the job done.
the environment variable 'NMLFILE' does not seem to be available
When running from inside the emc script, the environment variable
INI_FILE_NAME holds the inifile, and the environment variable NMLFILE
holds the nmlfile.
AXIS generally passes a "-ini" flag to subprograms that benefit from it,
like debuglevel.
Jeff
--
Look in the file: .emcrc. The GWiz source code shows how to access this;
but it is the same format as a .ini file. Use section PICKCONFIG,
variable LAST_CONFIG to access it.
Ken
Leslie Newell wrote:
> Thanks Jeff,
>
> Unfortunately that raises another problem. I need to find the ini file.
> A
Thanks Jeff,
Unfortunately that raises another problem. I need to find the ini file.
Axis knows this because it is passed on the command line. I think to get
this tool change stuff working correctly I will need to integrate it
into Axis anyway.
Les
Jeff Epler wrote:
> You need to set emc.nmlf
You need to set emc.nmlfile to the right path to emc.nml before creating
the stat and command objects.
This is how it's done in axis:
emc.nmlfile = os.path.join(os.path.dirname(sys.argv[2]),
inifile.find("EMC", "NML_FILE"))
hal_manualtoolchange doesn't need to do this because it doesn't use
I am working on manual tool change code that allows you to use
jogging/mdi during the tool change but I have hit a problem. Here is a
code snippet from my version of the manual toolchange Python HAL module:
import emc, hal
import rs274.options
emcStat = emc.stat();
emcCmd = emc.command()
def do