Need help with drilling cycles on Dialog 4

Need help with drilling cycles on Dialog 4

InfoGZ52M
Enthusiast Enthusiast
1,111 Views
2 Replies
Message 1 of 3

Need help with drilling cycles on Dialog 4

InfoGZ52M
Enthusiast
Enthusiast

I need help with the numbering of these macro cycles. The cycles are placed at the end of the program as macros on one line each, and are called by the line containing the X,Y,Z coordinates in the main body of the program. The first cycle called is usually numbered N*1, the second is numbered N*2, the third is N*3, etc.

Then in the main program, the table is positioned at XYZ, then the macro N*1 is called. For all the holes drilled to the same depth with the same retract height and clearance height, the table is repositioned in XYZ and then N*1 is called again. For the next set of holes, the table is positined in XYZ and then N*2 is called for each hole, etc.

 

This post is numbering each hole with a separate N*x number macro, even if they are the same depth, line N21, N23,N25 and N27 should all call N*1, but they are calling N*1,N*2,N*3, and N*4. The next depth of hole on line N39 as well as the next 3 are all calling N*5 when they should all be calling N*2. The next depth hole in line 71 is calling N*9 when it and the next 3 should all be calling N*3 Am I explaining this well?

 

Drilling/tapping/boring cycles are not modal on this control, this how it is done to avoid writing the entire cycle for each hole location.

The numbers in the main body need to be corrected so that all the macro calls for the same spec. holes are to the same macro number, ideally the Macros should be consecutive N*x numbers.

 

I started with the sample post for Dialog 4, I haven't changed any of the drilling cycle code. Except for the the numbering, the hole cycle values all seem to be correct

 

0 Likes
Accepted solutions (1)
1,112 Views
2 Replies
Replies (2)
Message 2 of 3

boopathi.sivakumar
Autodesk
Autodesk
Accepted solution

Hi @InfoGZ52M 

Create a new var above the function onCyclePoint()

var firstCycleCall = nextCycleCall;  //<< Add this line
function onCyclePoint(x, y, z) {

And add change the end of function onCyclePoint() go to this location 

    default:
      expandCyclePoint(x, y, z);
    }
  }
  
  if (cycleExpanded) {
    expandCyclePoint(x, y, z);
  } else {
    writeBlock(uFormat.format(nextCycleCall), gMotionNotModal.format(0), xOutput.format(x), yOutput.format(y));
    nextCycleCall += 1;
  }
}

 

And add change it to like below carefully

    default:
      expandCyclePoint(x, y, z);
    }
    if (nextCycleCall >1){
      firstCycleCall +=1;
    }
    nextCycleCall +=1;
  }
  
  if (cycleExpanded) {
    expandCyclePoint(x, y, z);
  } else {
    writeBlock(uFormat.format(firstCycleCall), gMotionNotModal.format(0), xOutput.format(x), yOutput.format(y));
  }
}

 Hope it should work fine carefully test and let me know the feedback


Boopathi Sivakumar
Senior Technology Consultant

Message 3 of 3

InfoGZ52M
Enthusiast
Enthusiast

It is working perfectly, thank you very much!

0 Likes