Post editing with Visual Studio Code

Post editing with Visual Studio Code

andrew.todd1
Advocate Advocate
1,803 Views
11 Replies
Message 1 of 12

Post editing with Visual Studio Code

andrew.todd1
Advocate
Advocate

Morning all.

 

Im have been diving into post editing with studio code.

 

See screenshot. Im editing a generic doosan milling post. the post has 5 axis capability but when i try and edit a 3 & 2 toolpath in studio code im getting this.

 

What am i doing wrong?

Capture.PNG

 

0 Likes
Accepted solutions (2)
1,804 Views
11 Replies
Replies (11)
Message 2 of 12

seth.madore
Community Manager
Community Manager

Hmm. Are you working with a sample part you can share? 5 axis Doosan should "just" be setting "has5axis" to "true" and you should be good to go.


Seth Madore
Customer Advocacy Manager - Manufacturing


0 Likes
Message 3 of 12

andrew.todd1
Advocate
Advocate

Sure.

 

Both files attached.

 

Thanks.

0 Likes
Message 4 of 12

seth.madore
Community Manager
Community Manager
Accepted solution

Using the stock post (not yours), I get code:

(FACE)
N10
T1 M06
(12 FLAT ENDMILL)
S7639 M03
G54
G00 A0. C0.
G00 X2.275 Y-1.882
G43 Z8.4744 H01
M08
G00 Z8.0744

And the whole program gets posted out. Using your post, I get the same. The trick is to change this:

2020-12-31_06h52_12.png

Oddly enough, when I also set it to "no", I still get a program......


Seth Madore
Customer Advocacy Manager - Manufacturing


0 Likes
Message 5 of 12

andrew.todd1
Advocate
Advocate

thanks for your help on this Seth

0 Likes
Message 6 of 12

andrew.todd1
Advocate
Advocate

also, can you tell me how i can add custom test that would appear at the start of every program?

 

Like after the program num (PROGRAM IS UNPROVEN, PROCEED WITH CAUTION)

 

Is this doable?

0 Likes
Message 7 of 12

seth.madore
Community Manager
Community Manager

This is what I have in my own posts, located right before the switch (unit) { line

 

  writeComment("SEE SETUP SHEET");
writeln("(LAST RUN)(UNPROVEN)");
writeComment("PROGRAM BY=STM")
writeComment((now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear() + " " + now.getHours() + ":" + ('0'+now.getMinutes()).slice(-2));

 

 

2020-12-31_07h21_53.png

 

 

Now, before you go and paste that exact line in, you're going to need to add a new variable:

 

// collected state
var sequenceNumber;
var currentWorkOffset;
var optionalSection = false;
var forceSpindleSpeed = false;
var activeMovements; // do not use by default
var currentFeedId;
var g68RotationMode = 0;
var angularProbingMode;
var now = new Date ();      <-------------
var wfo;

 

It's the "var now = new Date (); line. I just wanted to show you where it went in the variables.

 

Oh, and you'll likely need to add a few characters to your var permittedCommentChars list:

 

var permittedCommentChars = " ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,=_-/*#:";

 

 


Seth Madore
Customer Advocacy Manager - Manufacturing


0 Likes
Message 8 of 12

andrew.todd1
Advocate
Advocate

thanks. Where to add new variable Seth?

0 Likes
Message 9 of 12

seth.madore
Community Manager
Community Manager
Accepted solution

Somewhere in the "// collected state" area (line 209). If it's before any other variable, don't forget your ";" at the end

Example with the Doosan post:

// collected state
var sequenceNumber;
var now = new Date ();      <--------------
var currentWorkOffset;
var optionalSection = false;
var forceSpindleSpeed = false;
var activeMovements; // do not use by default
var currentFeedId;
var g68RotationMode = 0;
var angularProbingMode;
var subprograms = [];
var currentPattern = -1;
var firstPattern = false;
var currentSubprogram;
var lastSubprogram;
var definedPatterns = new Array();
var incrementalMode = false;
var saveShowSequenceNumbers;
var cycleSubprogramIsActive = false;
var patternIsActive = false;
var lastOperationComment = "";
var incrementalSubprogram;
var previousABC = new Vector(0, 0, 0);
var retracted = false; // specifies that the tool has been retracted to the safe plane
probeMultipleFeatures = true;

And then further down the post (line 460):

// absolute coordinates and feed per min
  writeBlock(/*gAbsIncModal.format(90),*/ gFeedModeModal.format(properties.useG95 ? 95 : 00),gFormat.format(17), gFormat.format(40), gFormat.format(80), gFormat.format(90), gFormat.format(94),gFormat.format(98));

  writeComment("SEE SETUP SHEET");
  writeln("(LAST RUN)(UNPROVEN)");
  writeComment("PROGRAM BY=STM")
  writeComment((now.getMonth()+1) + "/" + now.getDate() + "/" + now.getFullYear() + " " + now.getHours() + ":" + ('0'+now.getMinutes()).slice(-2));

 

Resulting code (note the date time format, doesn't reflect the missing charcters mentioned above)

G00 G17 G40 G80 G90 G94 G98
(SEE SETUP SHEET)
(LAST RUN)(UNPROVEN)
(PROGRAM BY=STM)
(12312020 825)

Seth Madore
Customer Advocacy Manager - Manufacturing


0 Likes
Message 10 of 12

andrew.todd1
Advocate
Advocate

Almost there Seth and thanks so much for the help.

 

One more thing bugging me. See attached screenshot. tis is from my customers original G code.

 

at the start of every toolpath we have this G68.2 line.

 

What is it and how can we replicate it on the post? 

 

Capture.PNG

0 Likes
Message 11 of 12

seth.madore
Community Manager
Community Manager

Sorry Andrew, this last question is above my skill level to answer. I will point you to THIS THREAD where they explore adding Euler angles to a Mazak post.


Seth Madore
Customer Advocacy Manager - Manufacturing


0 Likes
Message 12 of 12

andrew.todd1
Advocate
Advocate

Thanks Seth

0 Likes