Insert code just after Z feeds to depth and once again before retract

Insert code just after Z feeds to depth and once again before retract

mwhitten123
Advocate Advocate
860 Views
3 Replies
Message 1 of 4

Insert code just after Z feeds to depth and once again before retract

mwhitten123
Advocate
Advocate

Hello All,

 

I need to "Insert code just after Z feeds to depth and once again before retract". It's for a Water Jet machine, we need to turn the Jet on just after feeding to depth and off just before retract.

 

----------

G0 X  Y <<<<<move to start position

Z.40

G1 Z <<<<<<(Z feeds to cut depth just above part)

codes for Water Jet on goes here <<<<<<<<<<<<<<<<<<<<<<

X Y

X Y                 <<<<<<<part shape is cut out

X Y

X Y

codes for Water Jet off goes here <<<<<<<<<<<<<<<<<<<<<

G0 Z.40

---------------

 

 

Is this possible within the HSMWorks platform? If so, does anyone have a clue for me? I am guessing that it is some fancy post-work, so maybe someone has a sample post that contains the logic that I could use.

 

Any help on this is very much appreciated, so thanks in advance.

 

 

 

Michael Whitten
Selway Machine Tool
CAM Support
[email protected]
0 Likes
Accepted solutions (1)
861 Views
3 Replies
Replies (3)
Message 2 of 4

bob.schultz
Alumni
Alumni
Accepted solution

Hello Michael,

 

Here is some sample code you can use to achieve your results.  Since I don't have the post you are working with (it is always recommended to supply the part, post, and sample output with your comments in it explaining the changes you want to see) I am posting the suggested changes here.  The sample code is basic in nature and may have to be expanded if you have situations other than what you listed here.

 

You will also need to change the writeComment lines to writeBlock calls that contain the codes you require to turn on and off the Water Jet.

 

// collected state
(insert this line at the start of the post)
var jetActive = false;

function onRapid(_x, _y, _z) {
  var x = xOutput.format(_x);
  var y = yOutput.format(_y);
  var z = zOutput.format(_z);

(insert this code in the onRapid function)
  if (jetActive && z) {
    writeComment("Insert Waterjet off codes here");
    jetActive = false;
  }

(insert this code in the onLinear function)
      writeBlock(gMotionModal.format(1), x, y, z, f);
      if (!jetActive && z) {
        writeComment("Insert Waterjet on codes here");
        jetActive = true;
      }

If this does not work for you, then please supply the information mentioned above detailing what you need.

 

Thanks.



Bob Schultz
Sr. Post Processor Developer

0 Likes
Message 3 of 4

mwhitten123
Advocate
Advocate

Hello Bob,

 

Your help has been very much appreciated. I haven't had time to fully work it out as I have been working at customer's facility back in Ohio. The machine is very special, so there were many other things to work out as well.

 

The code seems to work well and do just what I need for 3ax cuts, but not 5ax cuts. The issue is that it is turning the Jet off multiple times(4/5ax only); the code still works though.  It is most likely because I haven't had time to actually work on it privately yet. I am pretty certain that it's something that I will find quickly.

 

I will be off-site again this week, so the final work on this can't happen until next week. I will definitely post up then or before when working at night.

 

Thank you,

Michael Whitten
Selway Machine Tool
CAM Support
[email protected]
0 Likes
Message 4 of 4

mwhitten123
Advocate
Advocate

Hello Bob,

 

The code you posted works perfectly. I made an error when adding to 5ax.

 

 

Thank you!

Michael Whitten
Selway Machine Tool
CAM Support
[email protected]
0 Likes