Air Spindle

Air Spindle

Claytonics
Advocate Advocate
275 Views
1 Reply
Message 1 of 2

Air Spindle

Claytonics
Advocate
Advocate

Hello,

 

I'm trying to mod the Haas pre-NGC post to handle an air spindle. The air spindle runs anytime its in the spindle so no M codes are need. As we only have one option for RPM I'd like the post to error on anything but the standard range 1-10000 except on a 40000 S call, possibly adding a dwell if we needed. 

 

Learning and trying things here is where I'm at, but not successful yet.

var spindleChanged = tool.type != TOOL_PROBE &&
    (insertToolCall || forceSpindleSpeed || isFirstSection() ||
    (rpmFormat.areDifferent(spindleSpeed, sOutput.getCurrent())) ||
    (tool.clockwise != getPreviousSection().getTool().clockwise));
  if (spindleChanged || (operationNeedsSafeStart && tool.type != TOOL_PROBE)) {
    forceSpindleSpeed = false;

     if (spindleSpeed = 40000) {
     }
     skipBlock = !spindleChanged;
    writeBlock(
        sOutput.format(spindleSpeed)//sOutput.format(spindleSpeed), mFormat.format(tool.clockwise ? 3 : 4)
     );

    if (spindleSpeed < 1) {
      error(localize("Spindle speed out of range."));
      return;
    }
    if (spindleSpeed > 10001) {
      error(localize("Spindle speed exceeds maximum value."));
    }
    skipBlock = !spindleChanged;
    writeBlock(
      sOutput.format(spindleSpeed), mFormat.format(tool.clockwise ? 3 : 4)
    );
  }

 Thanks in advance.

 

0 Likes
276 Views
1 Reply
Reply (1)
Message 2 of 2

Claytonics
Advocate
Advocate

I think I got it. Fixed some brackets and == for equal to not = 

 

0 Likes