EasyManua.ls Logo

Centroid M400 - CHAPTER 11 - CNC Program Codes; User and System Variables

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 Operator’s Manual 4/9/15 11-4
;
- Internal Comment Identifier
The semicolon (;) is used to indicate the start of an internal comment within a CNC program line. All characters
after the semicolon are ignored when the program is run. Internal comments are used to document NC programs or
temporarily omit the remainder of a line.
Example:
G90 ; select absolute positioning
G17 ; XY plane
G1 X1 Y1 F10
G0 ; X0 Y0 ; G0 selected with no movement
[ ] – Numerical Expression
The left bracket ‘[‘ and right bracket ‘]’ are used to delimit a numerical expression. Numerical expressions can
contain floating-point numbers or user and system variables in combination with mathematical operators and
functions. The left parenthesis ‘(‘ or bracket ‘[‘ and right parenthesis ‘)’ or bracket ‘]’ can be used between the first
left bracket and last right bracket to force operator precedence or associatively. A bracketed numerical expression
can be used anywhere a number would be used. Comparison operators (‘eq’, ‘ne’, etc.) have built in rounding
specified by parameter 144. Without this rounding, ‘eq’ would usually return “false” when comparing two
numbers calculated in different ways. Comparison operators and logical operators (‘!’, ‘&&’, ‘||’) return 1.0 for
“true” and 0.0 for “false”.
The mathematical operators and functions are:
+ Addition (or unary positive) # Variable access
- Subtraction (or unary negative) eq or == Equals
* Multiplication ne or != Not equals
/ Division ge or >= Greater than or equals
^ Exponentiation gt or > Greater than
Mod or % Modulo (remainder of a division) le or <= Less than or equals
abs Absolute value lt or < Less than
sin Sine (degrees) not or ! Logical NOT
cos Cosine (degrees) && Logical AND
tan Tangent (degrees) || Logical OR
sqrt Square root and Bit-wise AND
asin Arc Sine (degrees) xor Bit-wise exclusive OR
acos Arc Cosine (degrees) or Bit-wise OR
atan Arc Tangent (degrees) ~ Bit-wise complement
Examples:
G91 X[13/64] Z[1+3/8] ; move the X axis 13/64 (0.2031) units
; and the Z axis 1 3/8 (1.375) units incrementally
X[SQRT[ABS[SIN[#101]-COS[#102]]]] ; Move X as a function of #101 and #102
$
- ASCII Code Substitution
The ‘$’ symbol followed by an ASCII code is an alternate way of specifying a letter. Only ASCII codes 65 – 90
(‘A’ – ‘Z’) are valid. This substituion can be used where a letter command or axis label is normally specified.
Examples:
G0 $88 2.0 ; Rapid move X to 2.0 ( Equivalent to G0 X2.0 )
$71 0 $[88+2] 3.0 ; Rapid move Z to 3.0 ( Equivalent to G0 Z3.0 )
M26 /$90 ; Set Z home ( Equivalent to M26 /Z )

Table of Contents

Related product manuals