Report of work

More
08 Dec 2011 13:55 - 08 Dec 2011 14:25 #15478 by ArcEye
Replied by ArcEye on topic Re:Report of work
Hi

Open a terminal and run 'emc'

Once homing is done choose the MDI tab and enter 'M121 P1'

If you get an error displayed in the terminal
cat: /tmp/filename.txt: No such file or directory

You have tried to get the loaded file name when there is NO file loaded

If you get an error to do with python quoting last call to
get_file_name(event=None):
and an error
f = open('/tmp/filename.txt','rw')

You are still using the old version of axis somehow

Either edit f = open('/tmp/filename.txt','rw') to f = open('/tmp/filename.txt','w') or copy the new version of axis-2.4.5 from the zip I posted.

regards

PS.
As I suspect the problem is probably no file was loaded, I have amended the axis file so that /tmp/filename.txt is created
whatever and if no file is loaded, "No File Loaded" is written to it.

File Attachment:

File Name: jobtimestamp3.zip
File Size:61 KB
Attachments:
Last edit: 08 Dec 2011 14:25 by ArcEye.

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

More
08 Dec 2011 15:43 #15485 by gois
Replied by gois on topic Re:Report of work
Good afternoon!
Here we go again ....
I did what you suggested, if I run the command directly on the M121 P1 MDI works correctly, but when I put the M121 P1 arquivo.ngc at the beginning of the following message appears on the terminal (axis can not accept remote command while running) and does not save .

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

More
08 Dec 2011 16:02 #15488 by gois
Replied by gois on topic Re:Report of work
Oops, now it worked ...
I commented the line

# If running ():
# Return _ ("axis can not accept remote command while running")

In this way he expertly executed the command within the ngc file.

Referring to this line, can I have problems for commenting it?

grateful

Evan F. Gois

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

More
08 Dec 2011 18:36 #15496 by ArcEye
Replied by ArcEye on topic Re:Report of work
Hi

Referring to this line, can I have problems for commenting it?


No that would not be a good idea, better uncomment those lines.

I wasn't sure what axis regarded as 'running', it is obviously being in auto mode regardless of whether anything is happening.

The answer is simple, we just go for a 3 stage process.

Change M121 to
#!/bin/bash

if [ ! $# -ge 1 ]; then
  echo "Usage: M121 n - where n is 1 (get filename 2 (start  3 (end "
  exit 1
fi

float=$1
int=${float/\.*}

case $int in

    1 ) axis-remote --get 
        echo "JOB FILE NAME" >> /tmp/joblog.txt
        echo "*************" >> /tmp/joblog.txt
        cat /tmp/filename.txt >> /tmp/joblog.txt;;

    2)	echo "Started at:-" >> /tmp/joblog.txt
    	date >> /tmp/joblog.txt;;
    
    3 ) echo "Ended at:-" >> /tmp/joblog.txt
        date >> /tmp/joblog.txt;;

esac

exit 0

Then you can call M121 P1 from MDI just before you start your program, which will set the filename with axis in manual mde
Call M121 P2 in the header of your code
Call M121 P3 at the end of your code

Should achieve the same object without risking code insertion in the middle of a running program by commenting out
the safety check

regards

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

More
09 Dec 2011 08:01 #15509 by ArcEye
Replied by ArcEye on topic Re:Report of work
Hi

Having had a nights sleep, I think I had the right idea for more permanent implementation in my initial post

A solution that comes to mind is to amend axis.py to write the loaded_file to filename.txt whenever it is changed or set.


I will write the patch necessary to have Axis write the current file name to file, every time a file is loaded.
Emc already keeps a few log files etc in /tmp so that seems the place for it.

It will prevent any problems getting the filename whilst Axis is in Auto mode and any other program or script that needs the current filename will be able to read that file and use it accordingly.

I will probably put the result under the Axis sub-topic so that it is more easily found and link to this one

regards

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

More
09 Dec 2011 15:24 #15514 by ArcEye

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

Time to create page: 0.077 seconds
Powered by Kunena Forum