Probing outside of the standard Setup Orientation in this example can be accomplished with a couple of changes to the post processor. First make sure that you are using the latest version of the post, which you can download from here. I don't know the post being used in the original query, but I am going to assume it is either a Fanuc or Haas based post.
The first issue is that the tool orientation in the probing operation is a rotation around the Z-axis and most of our post processors will actually rotate the XY coordinates to match this orientation rather than rotate the Z-axis table to compensate for the orientation. This can be resolved by modifying the following code in getWorkPlaneMachineABC ...
var tcp = false;
if (tcp) {
setRotation(W); // TCP mode
} else {
var O = machineConfiguration.getOrientation(abc);
var R = machineConfiguration.getRemainingOrientation(abc, W);
setRotation(R);
}
... to look like this ...
var tcp = false;
if (tcp) {
setRotation(W); // TCP mode
} else {
var O = machineConfiguration.getOrientation(abc);
var R = machineConfiguration.getRemainingOrientation(abc, W);
var rotate = true;
var axis = machineConfiguration.getAxisV();
if (axis.isEnabled() && axis.isTable()) {
var ix = axis.getCoordinate();
var rotAxis = axis.getAxis();
if (isSameDirection(machineConfiguration.getDirection(abc), rotAxis) ||
isSameDirection(machineConfiguration.getDirection(abc), Vector.product(rotAxis, -1))) {
var direction = isSameDirection(machineConfiguration.getDirection(abc), rotAxis) ? 1 : -1;
abc.setCoordinate(ix, Math.atan2(R.right.y, R.right.x) * direction);
rotate = false;
}
}
if (rotate) {
setRotation(R);
}
}
This logic is described in 4.3.5 Work Plane - 3+2 Operations in the Post Processor Training Guide.
Next, you may find the following variable defined towards the top of the post processor. Change its value to true to allow for probing during a rotation. This change is not required when only rotating around the Z-axis, but is required if probing at any other orientation.
var allowIndexingWCSProbing = true; // specifies that probe WCS with tool orientation is supported
If you are running a post that does not have this variable defined, then you can comment out the error message that disables WCS probing at an orientation other than 0,0,1 at the top of the onCyclePoint function.
var probeWorkOffsetCode;
if (isProbeOperation()) {
// <<< COMMENT OUT THIS IF BLOCK /* ... */
/*if (!isSameDirection(currentSection.workPlane.forward, new Vector(0, 0, 1)) && (!cycle.probeMode || (cycle.probeMode == 0))) {
error(localize("Updating WCS / work offset using probing is only supported by the CNC in the WCS frame."));
return;
}*/

Bob Schultz
Sr. Post Processor Developer