recently i got Planet CNC controller Mk3/4. Everything is working good for me and i like it. But i need few custom cycles.I contacted Planet CNC support and i got answer that it is easy to do,all i have to do is to write new script using Gcode,create new M code and every time when i use this M code this script will be activated. I checked all scripts and all manuals which are included with Planet CNC software but i cant understand logic and syntax of these scripts. I dont know any programming language (like C, python, ...) and i dont realy understand logic of any of these programing languages. I know gcode good enought. But i still cant figure out how to make these scripts. For example i need that my cnc plasma before every cut make automatic height measure.
I found this script:
(name,Measure Surface Height)
O<PlanetCNC> if[[#<_probe_pin_1> EQ 0] AND [#<_probe_pin_2> EQ 0]]
(msg,Sensor is not configured)
M2
O<PlanetCNC> endif
(print,|!Set work position
(print,G92.1 Z#<offw>)
(print,|!Set coordinate system #<_coordsys,0>
(print,G10 L2 P#<_coordsys,0> Z#<offc>)
(print,|!------------------------------)
Hi, This is not the usual Gcode programming language (which is BMACRO)
!!! I am not familiar with this language, so I am not 100% sure of the following (but maybe it can help)
From what I can understand is does a probbing in Z then store the result measure in the variable #<_measure>
Then it calculate a work offsets in the form of variables #<offw> & #<offc> (they seems to have different applications)
So you can call G92.1 Z#<offw> (which is commented in your pgm) to shift the coordinate system accordingly
In alternative, you can store the value as an offset table G10 L2 P#<_coordsys,0> Z#<offc> (which is also commented in your pgm), and use it when you need by calling G54 in this case because its P2. But since you dont understand the details of GCode programming just try the G92 its simpler i guess