Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
justontour
173 Views, 0 Replies

Postprocessor - Simply read of coolant table?

Hi,

 

i´m currently looking for a simply way to read the variables from the coolant table:

 

Today i use the old method to read the first two coolant states from the tool (Flood and Mist) and activate them with M8 and M10:

 

 

var mapCoolantTable = new Table(
  [9, 8, 10],
  {initial:COOLANT_OFF, force:true},
  "Invalid coolant mode"
);

var c = mapCoolantTable.lookup(tool.coolant);
    if (c) {
      writeBlock(mFormat.format(c));
    } else {
      warning(localize("Coolant not supported."));
    }

 

 

Now i looking for simple method to read the var c from the "new" cooland table method (here from the fanuc pp):

 

var coolants = [
  {id:COOLANT_FLOOD, 8},
  {id:COOLANT_MIST,  10},
  {id:COOLANT_THROUGH_TOOL, 41},
  {id:COOLANT_AIR, 42},
  {id:COOLANT_AIR_THROUGH_TOOL, 43},
  {id:COOLANT_SUCTION, 44},
  {id:COOLANT_FLOOD_MIST, 45},
  {id:COOLANT_FLOOD_THROUGH_TOOL, 46},
  {id:COOLANT_OFF, 9}
];

 

 

How do i have to adapt the Var c line to read from the var coolant array my numbers as output?

 

var c = mapCoolantTable.lookup(tool.coolant);

 

 

Best case would be something like this to have a easy read function:

var c = mapcoolantsArray.lookup(tool.coolant)

 

Thanks for help.