G-code
Macro programming
Supported operations on expressions
3min
unary operations operation description abs absolute value acos arc cosine asin arc sine atan\[y]\[x] arc tangent cos cosine exp e raised to fix round down fup round up int integer part ln natural log of round round sin sine sqrt square root tan tangent not logical not resetmodulo \[a|b|c] reset a rotation axis to its modulo position binary operations operation description / divided by mod modulo power times and logic and xor logic exclusive or minus or logic nonexclusive or + plus > greater then >= greater than or equeal < less then <= less than or equal == is equel <> not equeal band bitwise and bxor bitwise exclusive or bor bitwise nonexeclusive or << shift left >> shift right example this example drills holes at a circle with a radius of 10, each 30 degrees the code that performs this is put in a subroutine, which can be called as many times as needed in the main program sub do circle holes \#100=0 g0 z1 x0 y0 while \[#100 <> 360] \#102 = \[10 sin\[#100]] \#103 = \[10 cos\[#100]] g0 x\[#103] y\[#102] g1 z 1 g1 z1 \#100 = \[#100 + 30] if \[#100 == 360] msg "done" else msg "processing at angle "#100 endif endwhile endsub gosub do circle holes m30