[Home]M100-199

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org

Difference (from prior major revision) (no other diffs)

Changed: 13c13
>From my lathe .ini file:...
>From my lathe .ini file:

Changed: 47c47
I use M102 in my G-code files for opening the collet closer.

I use M102 in my G-code files for opening the collet closer.


Hi guys: I am trying to help someone on cnc zone to use M100 but I don'tunderstand the manual desription nor can I find anything in the wiki to help.the manual says:
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 withthe P and Q values as its two arguments.
Execution of the RS274NGC file pauses until the invoked program exits.

Does this mean the external program must be named M100-199?
What is meant by PROGRAM_PREFIX ? pathway?
I assume the external program can be in any supported language or are we talking G code?

 Yes > What is meant by PROGRAM_PREFIX ? pathway? 

>From my lathe .ini file:

  1. Sections for display options

[DISPLAY]DISPLAY = axis LATHE = 1 PYVCP = spindle.xml
  1. DISPLAY = usrmot
  2. 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

 
  1. !/bin/sh
  2. Custom - Only intended for Kirk Wallace's HNC lathe, KW 20070823
  3. 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.

LinuxCNCKnowledgeBase | RecentChanges | PageIndex | Preferences | LinuxCNC.org
This page is read-only. Follow the BasicSteps to edit pages. | View other revisions
Last edited July 8, 2012 6:37 am by Andypugh (diff)
Search:
Published under a Creative Commons License