i have the file m101 in my PROGRAM_PREFIX directory and it's executable.
i'm trying to call it in my program with m101 p4. i'm getting "unknown m code used"
my m101 file;
halcmd setp thc.feedrate $feedrate
It is possible your M101 file IS working
Why are you passing only 1 parameter to your M101 and then using parameter 2 to set your feedrate?
Feed rate would always be set to -1.000000 which is the default value emc passes in the absence of any user input.
Run emc from within a terminal, so that you can see output in the terminal. Put the attached file in your PROGRAM_PREFIX directory and run 'M111 Pnn in the MDI window
You should get an output of 'Parameter entered was nn' where nn is whatever number you used.
File Attachment:File Name: M111-b2a66...54d4.zip
File Size:0 KB
Thanks. i did that and got unknown m code.
but i'm guessing it's because i don't have
thc loaded as john figured out.
All the file I attached does is convert the parameter passed by emc to an integer and echo it back.
It is not dependent upon anything else, if you can't run it, you will not be able to run any M1xx routines until you find the problem.
I don't know why so many people have trouble getting this to work, I am trying to assist someone else re very similar.
Assuming as you say, you have put it in the right directory and set it as executable,
all I can suggest is that you log in as root, try launching emc then call M111 Pnn from the MDI window.
If that works, it is all about your user permissions.
If it doesn't work, try chmod 'ing the file to 755 as root, close emc , launch again and try again.
(this is important because emc caches stuff and if you modify a M1xx file it won't see the change until next session)
If that works, it is also about your user access and not being able to set the file permissions you thought you were doing.