Skip to content
kondia-b500.cps 67.9 KiB
Newer Older
ellyan's avatar
ellyan committed
/**
ellyan's avatar
ellyan committed
  Copyright (C) 2012-2023 by Autodesk, Inc.
ellyan's avatar
ellyan committed
  All rights reserved.

  NUM post processor configuration.

ellyan's avatar
ellyan committed
  $Revision: 44079 7098e6d148aa6ea195b42597d82fe2f00d0115bb $
  $Date: 2023-07-17 12:38:58 $
ellyan's avatar
ellyan committed

  FORKID {8B1FC740-38BD-4cb2-9CD5-94A55CBE87A5}
*/

description = "NUM";
vendor = "NUM";
vendorUrl = "http://www.num.com";
ellyan's avatar
ellyan committed
legal = "Copyright (C) 2012-2023 by Autodesk, Inc.";
ellyan's avatar
ellyan committed
certificationLevel = 2;
ellyan's avatar
ellyan committed
minimumRevision = 45917;
ellyan's avatar
ellyan committed

longDescription = "Generic milling post for NUM.";

extension = "nc";
programNameIsInteger = true;
setCodePage("ascii");

ellyan's avatar
ellyan committed
capabilities = CAPABILITY_MILLING | CAPABILITY_MACHINE_SIMULATION;
ellyan's avatar
ellyan committed
tolerance = spatial(0.002, MM);

minimumChordLength = spatial(0.25, MM);
minimumCircularRadius = spatial(0.01, MM);
maximumCircularRadius = spatial(1000, MM);
minimumCircularSweep = toRad(0.01);
maximumCircularSweep = toRad(5400);
allowHelicalMoves = true;
allowedCircularPlanes = undefined; // allow any circular motion

// user-defined properties
properties = {
  writeMachine: {
    title      : "Write machine",
    description: "Output the machine settings in the header of the code.",
    group      : "formats",
    type       : "boolean",
    value      : true,
    scope      : "post"
  },
  writeTools: {
    title      : "Write tool list",
    description: "Output a tool list in the header of the code.",
    group      : "formats",
    type       : "boolean",
    value      : true,
    scope      : "post"
  },
  preloadTool: {
    title      : "Preload tool",
    description: "Preloads the next tool at a tool change (if any).",
    group      : "preferences",
    type       : "boolean",
    value      : true,
    scope      : "post"
  },
  showSequenceNumbers: {
    title      : "Use sequence numbers",
    description: "'Yes' outputs sequence numbers on each block, 'Only on tool change' outputs sequence numbers on tool change blocks only, and 'No' disables the output of sequence numbers.",
    group      : "formats",
    type       : "enum",
    values     : [
      {title:"Yes", id:"true"},
      {title:"No", id:"false"},
      {title:"Only on tool change", id:"toolChange"}
    ],
    value: "true",
    scope: "post"
  },
  sequenceNumberStart: {
    title      : "Start sequence number",
    description: "The number at which to start the sequence numbers.",
    group      : "formats",
    type       : "integer",
    value      : 10,
    scope      : "post"
  },
  sequenceNumberIncrement: {
    title      : "Sequence number increment",
    description: "The amount by which the sequence number is incremented by in each block.",
    group      : "formats",
    type       : "integer",
    value      : 5,
    scope      : "post"
  },
  optionalStop: {
    title      : "Optional stop",
    description: "Outputs optional stop code during when necessary in the code.",
    group      : "preferences",
    type       : "boolean",
    value      : true,
    scope      : "post"
  },
  separateWordsWithSpace: {
    title      : "Separate words with space",
    description: "Adds spaces between words if 'yes' is selected.",
    group      : "formats",
    type       : "boolean",
    value      : true,
    scope      : "post"
  },
  useRadius: {
    title      : "Radius arcs",
    description: "If yes is selected, arcs are outputted using radius values rather than IJK.",
    group      : "preferences",
    type       : "boolean",
ellyan's avatar
ellyan committed
    value      : false,
ellyan's avatar
ellyan committed
    scope      : "post"
  },
  showNotes: {
    title      : "Show notes",
    description: "Writes operation notes as comments in the outputted code.",
    group      : "formats",
    type       : "boolean",
    value      : false,
    scope      : "post"
  },
  safePositionMethod: {
    title      : "Safe Retracts",
    description: "Select your desired retract option. 'Clearance Height' retracts to the operation clearance height.",
    group      : "homePositions",
    type       : "enum",
    values     : [
      {title:"Clearance Height", id:"clearanceHeight"},
      {title:"G52", id:"G52"}
    ],
    value: "G52",
    scope: "post"
  },
  controllerType: {
    title      : "Controller version",
    description: "Select the family of controller.",
    group      : "configuration",
    type       : "enum",
    values     : [
      {title:"NUM 7xx", id:"NUM7x0"},
      {title:"NUM 10xx", id:"NUM10x0"}
    ],
    value: "NUM7x0",
    scope: "post"
  }
};

// wcs definiton
wcsDefinitions = {
  useZeroOffset: false,
  wcs          : [
    {name:"Standard", format:"#", range:[1, 1]}
  ]
};

var gFormat = createFormat({prefix:"G", width:2, zeropad:true, decimals:0});
var mFormat = createFormat({prefix:"M", width:2, zeropad:true, decimals:0});
var hFormat = createFormat({prefix:"H", width:2, zeropad:true, decimals:0});
ellyan's avatar
ellyan committed
var diameterOffsetFormat = createFormat({prefix:"D", width:2, zeropad:true, decimals:0});
ellyan's avatar
ellyan committed

var xyzFormat = createFormat({decimals:(unit == MM ? 3 : 4), forceDecimal:true});
var rFormat = xyzFormat; // radius
var abcFormat = createFormat({decimals:3, forceDecimal:true, scale:DEG});
var feedFormat = createFormat({decimals:(unit == MM ? 0 : 1), forceDecimal:true});
ellyan's avatar
ellyan committed
var pitchFormat = createFormat({decimals:(unit == MM ? 3 : 4), forceDecimal:true});
ellyan's avatar
ellyan committed
var toolFormat = createFormat({width:2, zeropad:true, decimals:0});
var rpmFormat = createFormat({decimals:0});
var secFormat = createFormat({decimals:2, forceDecimal:true}); // seconds - range 0.01-99.99
var taperFormat = createFormat({decimals:1, scale:DEG});

var xOutput = createVariable({prefix:"X"}, xyzFormat);
var yOutput = createVariable({prefix:"Y"}, xyzFormat);
var zOutput = createVariable({onchange:function () {retracted = false;}, prefix:"Z"}, xyzFormat);
var aOutput = createVariable({prefix:"A"}, abcFormat);
var bOutput = createVariable({prefix:"B"}, abcFormat);
var cOutput = createVariable({prefix:"C"}, abcFormat);
var feedOutput = createVariable({prefix:"F"}, feedFormat);
ellyan's avatar
ellyan committed
var pitchOutput = createVariable({prefix:"K", force:true}, pitchFormat);
ellyan's avatar
ellyan committed
var sOutput = createVariable({prefix:"S", force:true}, rpmFormat);

// circular output
var iOutput = createVariable({prefix:"I", force:true}, xyzFormat);
var jOutput = createVariable({prefix:"J", force:true}, xyzFormat);
var kOutput = createVariable({prefix:"K", force:true}, xyzFormat);

var gMotionModal = createModal({}, gFormat); // modal group 1 // G0-G3, ...
var gPlaneModal = createModal({onchange:function () {gMotionModal.reset();}}, gFormat); // modal group 2 // G17-19
var gAbsIncModal = createModal({}, gFormat); // modal group 3 // G90-91
var gFeedModeModal = createModal({}, gFormat); // modal group 5 // G93-94
var gUnitModal = createModal({}, gFormat); // modal group 6 // G70-71
var gCycleModal = createModal({}, gFormat); // modal group 9 // G81, ...
var gRetractModal = createModal({}, gFormat); // modal group 10 // G98-99
ellyan's avatar
ellyan committed
var mClampModal = createModalGroup(
  {strict:false},
  [
    [10, 11] // 4th axis clamp / unclamp
    //[12, 13] // 5th axis clamp / unclamp
  ],
Loading full blame...