Re: [Emc-users] Trouble with Python

2009-06-30 Thread Leslie Newell
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

Re: [Emc-users] Trouble with Python

2009-06-30 Thread Jeff Epler
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 --

Re: [Emc-users] Trouble with Python

2009-06-30 Thread Kenneth Lerman
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

Re: [Emc-users] Trouble with Python

2009-06-30 Thread Leslie Newell
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

Re: [Emc-users] Trouble with Python

2009-06-29 Thread Jeff Epler
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

[Emc-users] Trouble with Python

2009-06-29 Thread Leslie Newell
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