structure comment

structure comment

l.ebertT6379
Contributor Contributor
369 Views
5 Replies
Message 1 of 6

structure comment

l.ebertT6379
Contributor
Contributor

Hello,

i want write structure comments with value of verticalstocktoleave and stocktoleave. If no values than write only the structure comment like in the standard postprozessor. I have entered the changes in the pp but i get only the structure comment with values. I don´t know what i have to change. Does anyone have a solution?

 

standard pp:( output picture 144718)

 

if (hasParameter("operation-comment")) {
var comment = getParameter("operation-comment");
if (comment && ((comment !== lastOperationComment) || !patternIsActive || insertToolCall))
writeStructureComment( comment );

lastOperationComment = comment;
}

 

pp with change( output picture 144819)

i thing the && signs are wrong.

 

if (hasParameter("operation-comment") &&
    hasParameter("operation:verticalStockToLeave") &&
    hasParameter("operation:stockToLeave")) {
 var comment = getParameter("operation-comment");
 var ZAufmass = getParameter("operation:verticalStockToLeave");
 var Aufmass = getParameter("operation:stockToLeave");
  if (comment && ((comment !== lastOperationComment) || !patternIsActive || insertToolCall));      
       writeStructureComment( comment + " Z " + ZAufmass +"mm"  + " XY " + Aufmass  );
     
      lastOperationComment = comment;
   }

 

I hope you understand what i mean.

I want to upload pictures from the cnc programm but i get a error message.

Can i not upload jpeg?

 

Gruß

Lars

 

0 Likes
370 Views
5 Replies
Replies (5)
Message 2 of 6

serge.quiblier
Autodesk
Autodesk

Hi @l.ebertT6379 

 

as no picture had been attached correctly in the thread, it will try to guess what could go wrong.

First thing, not all the toolpath contain all the variable. So, the stockToLeave may not be outputted with all operations.

We need to secure that part. Let's change the parameter retrivial to make it foolproof.

 var ZAufmass = getParameter("operation:verticalStockToLeave",0);
 var Aufmass = getParameter("operation:stockToLeave",0);

 

If the value is not passed, zero will be assumed. Not perfect, but it prevent bug/crash.

 

Second thing, it more aesthetic than functionnality, but the comment is a string, and the stockToLeave are numbers.

It would be best to format them before adding to the string.

As I have no idea on the post processor considered, let's suppose that the post have the xyzFormat defined inside.

It's a pretty common one.

writeStructureComment( comment + " Z " + xyzFormat.format(ZAufmass) +"mm"  + " XY " + xyzFormat.format(Aufmass)  );

 

I hope it can guide you to the solution.

 

Regards.


______________________________________________________________

If my post answers your question, please click the "Accept Solution" button. This helps everyone find answers more quickly!

 

 


Serge.Q
Technical Consultant
cam.autodesk.com
0 Likes
Message 3 of 6

l.ebertT6379
Contributor
Contributor

I try your changes. But i get not everywhere a structure comment.

here without a value in stocktoleave i get no structure comment, but i want it for every operation like in the standard PP.

 

3672 L Z-69.326R0 FMAX M92
3673 TOOL CALL 516 Z S10000
3674 ;Schruppfräser 16mm_ALU
3675 TOOL DEF 711
3676 L Z-69.326R0 FMAX M92
3677 M3
3678 M7
3679 L X+81.239 Y+6.146 R0 FMAX
3680 L Z+36 R0 FMAX
3681 CYCL DEF 32.0 TOLERANCE
3682 CYCL DEF 32.1 T+0.013

 

here with a value

 

31 ;
32 * - T510-Adaptiv1 (1) Z +0.2mm XY +0.2
33 TOOL CALL 510 Z S9995
34 ;Schruppfräser 10mm Alu
35 TOOL DEF 516
36 L Z-69.326R0 FMAX M92
37 M3
38 M8
39 L X-5.254 Y-18.371 R0 FMAX

 

0 Likes
Message 4 of 6

l.ebertT6379
Contributor
Contributor

If it not possible to get it in one line i will use two lines.

 

Gruß

Lars

0 Likes
Message 5 of 6

serge.quiblier
Autodesk
Autodesk

Hi @l.ebertT6379 

 

If the output is not generated, it because of that changed test:

if (hasParameter("operation-comment") &&
    hasParameter("operation:verticalStockToLeave") &&
    hasParameter("operation:stockToLeave")) {

 

If you want the output, even when the stock to leave is not defined, it should be as follow:

if (hasParameter("operation-comment")) {

 

Regards.



Serge.Q
Technical Consultant
cam.autodesk.com
0 Likes
Message 6 of 6

l.ebertT6379
Contributor
Contributor
I have now solved this as follows:
if (hasParameter("operation:verticalStockToLeave") &&
    hasParameter("operation:stockToLeave")) {
  var ZAufmass = getParameter("operation:verticalStockToLeave");
  var Aufmass = getParameter("operation:stockToLeave");
     if (ZAufmass >0 ||  Aufmass >0 ) {
            writeStructureComment(  "Z" + xyzFormat.format(ZAufmass) +"mm "  + "XY" + xyzFormat.format(Aufmass) +"mm"  );
      //lastOperationComment = comment;
    }
    }
   
   if (hasParameter("operation-comment")) {
    var comment = getParameter("operation-comment");      
    if (comment && ((comment !== lastOperationComment) || !patternIsActive || insertToolCall))          
          writeStructureComment( comment + "__T" + tool.number);
      lastOperationComment = comment;
Then I have 2 lines that are output, which is also fine


Gruß
Lars
 
0 Likes