EasyManua.ls Logo

Centroid M400 - Page 228

Centroid M400
302 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
M-Series Operators Manual 4/9/15
13
-
14
M120 - Open data file (overwrite existing file)
This M function will open the requested data file for writing. If no drive or directory is specified with the file
name, then the file will be opened in the same directory as the CNC program. If the file cannot be successfully
opened, then an error will be returned, ultimately terminating the job. If a data file is already open when M120 is
called, that file will first be closed, then the new file opened.
Example:
M120 "probetst.dat" ; Opens probetst.dat file to write data too
Note: M120 and M121 also allow use of the string user variables #300 - #399 to specify a filename. As an
example, given that #300 = “myfile” and #301 = “cnc”
M120 “#300.#301” ;Opens the file “myfile.cnc” for data recording.
Keep in mind however that there is a quirk in the way that the M120/M121 operates that requires the '.' to be
present so assigning #301 = “.cnc” and executing M120 “#300#301” does not work and generates a “Could not
open file” error message.
M121 - Open data file (append to existing file)
This M function will open the requested file for writing at the end of the file. If no drive or directory is specified
with the file name, then the file will be opened in the same directory as the CNC program. If the file does not
already exist, it will be created. This is not an error. If the file cannot be successfully opened, then an error will be
returned, ultimately terminating the job. If a data file is already open when M121 is called, that file will first be
closed, then the new file opened.
Example:
M121 "c:\probetst.dat" ; Opens probetst.dat file to add data to it
String variables #300-#399 may also be used to specify a file name. Please see M120 above for details.
M122 - Record local position(s) and optional comment in data file
This M function will write the current expected position value to the data file, in the usual format (i.e. axis label
before number, 4 decimal places in inch mode, 3 decimal places in millimeter mode. Any comment that appeared
on the line with M122 will be outputted after the position(s). With no axis arguments, M122 will write the
positions of all installed axes. With axis arguments, it will write the positions only of the requested axes. Positions
will be written in local (not machine) coordinates, in native machine units. If no data file has been opened with
M120 or M121 before M122 is called, then M122 will return an error and terminate the job. The parameter L1 may
be used to suppress the new line character normally outputted after the last position. Furthermore, the output of axis
labels, comma separators, and spaces can be enabled or suppressed via machine parameter 72 (see Parameter 72 in
Chapter 14). If the control has been configured to use a DSP probe type, using parameter Q1 will write the values
stored in #24301-#24305 to the file.
Examples (M function and sample output):
M122 ;comment -> X1.2345 Y-3.2109 Z-0.5678 ;comment
M122 /X L1 -> X-1.5000
M122 /X -> X-1.5000 X-2.0000

Table of Contents

Related product manuals