need to modify HURCO Post...help

need to modify HURCO Post...help

lenny_1962
Advisor Advisor
589 Views
8 Replies
Message 1 of 9

need to modify HURCO Post...help

lenny_1962
Advisor
Advisor

Ok I would like the HURCO post to allow me to put 54,55.....58, 59 in the job setup instead of 1,2.....5, 6, to ge 54-59.

 

NEXTGEN did one for our HAAS in 2012 and I tried to copy paste the code that works in my HAAS post but doesn't work in the HURCO.

 

any Ideas?

 

// wcs
var workOffsetWords = "";
var workOffset = currentSection.workOffset;
if (workOffset == 0) {
warningOnce(localize("Work offset has not been specified. Using G54 as WCS."), WARNING_WORK_OFFSET);
workOffset = 54;
}
if (workOffset > 0) {
if (workOffset > 129 || (workOffset > 59 && workOffset < 110)) {
error(localize("Work must use 54-59 and 110-129."));
return;
}
if (workOffset != currentWorkOffset) {
//writeBlock(gFormat.format(workOffset));
workOffsetWords = formatWords(gFormat.format(workOffset));
currentWorkOffset = workOffset;
}
}

0 Likes
Accepted solutions (1)
590 Views
8 Replies
Replies (8)
Message 2 of 9

lenny_1962
Advisor
Advisor

@Tomek.G @AchimN 

Can you guys help me out, PLEASE

0 Likes
Message 3 of 9

Tomek.G
Autodesk
Autodesk

Hi @lenny_1962,

If the machine is selected in Setup tab settings, and the selected machine definition has the correct Hurco post connected you will be able to insert 54 as the WCS number

TomekG_0-1668610246503.png

 


Tomek.G
Sr. Technical Consultant
0 Likes
Message 4 of 9

lenny_1962
Advisor
Advisor

@Tomek.G 

I'm using HSMWorks, not FUSION 360, so not sure where all those options are that you put the links too.

 

So thats why I need the post of allow me to do it, like i said NEXTGENCAM did my HASS post before you guys bought HSMWorks.

 

so how can i make the HURCO post do the samething?

0 Likes
Message 5 of 9

Tomek.G
Autodesk
Autodesk

Hi @lenny_1962,

Your code can work,
you definitely need to output your WCS, for now this writeBlock() line is commented out.
You throw an error if workOffset is greater than 129 or is in the range between 59 and 110
What about the range <0,54>?

if (workOffset > 0) {
  if (workOffset < 54 || workOffset > 129 || (workOffset > 59 && workOffset < 110)) {

 


Tomek.G
Sr. Technical Consultant
0 Likes
Message 6 of 9

lenny_1962
Advisor
Advisor

@Tomek.G 

 

not sure what you are trying to show me with just those 2 lines.

 

I don't really understand how the code works, just need it to work.

 

where in the HURCO post would this go??

 

I only need G54 thru G59, HURCO doesn't have G110 thru G129.

 

The one I showed was from my HAAS post modified in 2012

0 Likes
Message 7 of 9

Tomek.G
Autodesk
Autodesk
Accepted solution

@lenny_1962,

Sorry, you wrote that you inserted this code and it doesn't work, so I mistakenly assumed that you knew where and how to insert it and only checked the correctness of this code.

Search for // wcs it should be the line #1225 and looks like this:

 

  // wcs
  if (insertToolCall) { // force work offset when changing tool
    currentWorkOffset = undefined;
  }

  if (currentSection.workOffset != currentWorkOffset) {
    writeBlock(currentSection.wcs);
    currentWorkOffset = currentSection.workOffset;
  }

  forceXYZ();

 

and paste the code listed below:

 

  // wcs
  if (insertToolCall) { // force work offset when changing tool
    currentWorkOffset = undefined;
  }

  var workOffset = currentSection.workOffset;
  if (workOffset == 0) {
    warningOnce(localize("Work offset has not been specified. Using G54 as WCS."), WARNING_WORK_OFFSET);
    workOffset = 54;
  }
  if (workOffset > 0) {
    if (workOffset < 54 || workOffset > 59) {
      error(localize("Work must use 54-59"));
      return;
    }
    if (workOffset != currentWorkOffset) {
      writeBlock(gFormat.format(workOffset));
      currentWorkOffset = workOffset;
    }
  }

  forceXYZ();

 

 


Tomek.G
Sr. Technical Consultant
0 Likes
Message 8 of 9

lenny_1962
Advisor
Advisor

@Tomek.G 

 

Thanx I will give it a try and let you know.

 

Have a Great weekend

0 Likes
Message 9 of 9

lenny_1962
Advisor
Advisor

@Tomek.G 

 

Worked like a dream!!! U DA MAN!

Thanx again

 

lenny

0 Likes