Where are predefined variables set?

The documentation for the postprocessor contains information about predefined variables and that they exist. Such as endX, endY and endZ.
But I couldn’t find information on how to set their values. I’m specifically interested in endZ.
Somewhere, by default, apparently the value is set to 170. But my Z axis has a final displacement equal to 110. How and where can I override this?

Regards, Dmitry.

Those variables are set in sheetcam based to the cut path. You can’t set them. Are you trying to get your machine to park? There is a parking position in the settings.

endZ and most other Predefined Variables described in the Post Documentation are SC “internally” managed variable, meaning they’re managed outside the scope of post processors. I don’t believe they are intended to be written or changed, but they certainly are intended to be read and referenced by post processors as need be. endX, 'Y, and 'Z are set by SC prior to a call to .scpost functions and they represent the destination of the next motion, where currentX, 'Y, 'Z represent the current position of XYZ and thus just prior to the next motion. So the absolute value of currentZ - endZ is the distance of the next motion on that axis, and so on. I’m assuming your mention of “final displacement of 110” means the distance of the motion in question.

Also, depending on the function that SC calls in the .scpost, only predefined variables relevant to that function will have meaningful values. You can examine a variable by placcing a debug breakpoint on the first stmt in the function of interest and then click on the Stack tab of the window just below the Edit Post window, you have to resize the Edit and Stack window separator to see the variables.

In the attached .scpost there is quite a bit of currentX, Y, Z and endX, Y, Z usage.
GRBL plasma LDC v24-12 (2) - Copy.scpost (10.3 KB)


I’m trying to adapt the LinuxCNC_plasma_rotatif.scpost postprocessor for my pipe cutting machine. I have a question about how the endZ position is calculated. For different pipe diameters, different values are given. It happens that the Z movement value is much greater than how much my axis can physically travel. For control I use LinuxCNC.
In principle, for a round pipe it is possible to eliminate the operations of calculating the movement along the Z, but for a square pipe this cannot be done.
In general, I have problems with the square pipe. The movement in the Z is calculated incorrectly.

My machine has an option to search for a pipe surface in the Z.

Regards, Dmitry.

On a rotary axis the Z is calculated from the center of the pipe not the surface.

Looking at that post, the height of the surface of the pipe is passed to the touch-off subroutine. Your touch-off subroutine needs to set the current Z position based on that value.