Did you look in the integrators manual under M100? Did you follow those instructions? We need more info.
Cheers Chris
I am trying to create a M100 to turn an output on in a program. What is the descripter for M100 to be used in HAL. When I create a Gcode program and open it it causes and error because M100 is not defined.
Jamy
Did you look in the integrators manual under M100? Did you follow those instructions? We need more info.
Cheers Chris
This is whats in the manual.
12.12 M100 to M199 User Defined Commands
To invoke a user-defined command, program M- P- Q- where P- and Q- are both optional. The
external program “Mnnn” in the directory [DISPLAY]PROGRAM_PREFIX is executed with the P and Q
values as its two arguments. Execution of the RS274NGC file pauses until the invoked program
exits.
It is an error if
• The specified User Defined Command does not exist
I dont what they mean by M- P- Q-. Also the external program "Mnnn" in the directroy [Display]Program_PREFIX is executed with P and Q values as its two arguments. They also talk about the RS274NGC file. I dont know what that is and where to find the file.
Just to confirm- you want to use M100 to run a 'seperate program' to turn an output on or do you just want a M code to turn a output on?
For M100 the m- is just the m number you used 100-199, p- and q- are variables that are passed to the seperate program like on the command line. A RS274NGC file is the original G code file. I think the seperate program needs to be named the same as the M number eg. M100 the program is called m100. The program prefix is probably where EMC is supposed to look for the seperate program. I will try to find out.
If you just want an output turned on and off you want to use M62-65
I asked on the EMC maillist here is what I got:
>
> Does this mean the external program must be named M100-199?
Yes
> What is meant by PROGRAM_PREFIX ? pathway?
>From my lathe .ini file:
...
# Sections for display options
------------------------------------------------
[DISPLAY]
DISPLAY = axis
LATHE = 1
PYVCP = spindle.xml
# DISPLAY = usrmot
# DISPLAY = tkemc
CYCLE_TIME = 0.100
HELP_FILE = doc/help.txt
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.2
PROGRAM_PREFIX = ../../nc_files/
...
you can see that the M1xx files will need to be two directories up from
the current directory and in nc_files. I believe that makes
it /home/user_name/emc2/nc_files. You can change PROGRAM_PREFIX if you
want.
> I assume the external program can be in any supported language or are
> we talking G code?
My guess is that you can not execute G-code, but bash, python, C or any
non-real-time executable would work. I use a bash script to create
missing g-codes for my lathe, such as M102 Collet Open:
file = /home/kwallace/emc2/nc_files/M102
-----------------
#!/bin/sh
# Custom - Only intended for Kirk Wallace's HNC lathe, KW 20070823
# M102 - Opens Collet Closer
halcmd setp parport.0.pin-07-out False
halcmd setp parport.0.pin-06-out True
exit 0
-----------------
I use M102 in my G-code files for opening the collet closer.
hope that helps
Jamy,
In response to your question that chester88 posted on the users list and to Kirk's answer I have updated the manual. See if it makes more sense...
http://www.linuxcnc.org/docview/html...:M100-to-M199:
Thanks for asking the question.
John
How do I go about doing the M64 and M65 turning on the Digital output. I know in the program I just type M64. But in the HAL file?
This page on M66 should help you understand...
http://wiki.linuxcnc.org/cgi-bin/emcinfo.pl?Mword
and here...
http://www.linuxcnc.org/docview/html...ec:M62-to-M65:
and watch it all with HAL show...
http://www.linuxcnc.org/docview/html//hal_halshow.html
John
How do I create an input to start a program in EMC2. Also the same input to run the program after a M0 stop command. I was able to do start the program and when it got to M0 it stopped but when I pressed the input it started the program from the beginning. It seems like I need to do some sort of IF statement. If program.run and mode.auto is true then input only is used to program.run. Is there anyone that can help me?
Yes I know the S will work and also clicking on the resume button on the screen. What I am refering to is a button used by a operator to start a program. I would like to use the same button to resume the program when the program is paused (M0). The only input the operator can toggle is this button. The button is setup like this remote-start halui.program.run halui.mode.auto = parport 15
What Im going to try next is to create a manual and auto button on the screen. By selecting auto the switch can be configured as remote start halui.program. run halui.program.resume=parport 15. I have a feeling that it probaly will just start the program over with having Halui.program.run.
Any other suggestions?
If you use halui you can take advantage of the pins halui.program.is-paused, is-idle, resume, run to restart/start based on the current status. For this you use a logic operator to do the right thing.
In your hal file you want to do the following pseudo code
JohnCode:If paused then resume My button pressed | If idle then start