Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

job-notes- output to the post processor

Tomas_V_cz
Advocate

job-notes- output to the post processor

Tomas_V_cz
Advocate
Advocate

Hello, I would like to get some data into the program and it occurred to me that "job-notes" (according to the picture) is a good option.

I need to get the data into two lines (it's in the code), but as shown in the picture. The current form is repeated 2 times for me, and I would have to remove 2 lines. The code is as follows:

 

 if (hasGlobalParameter("job-notes")) {
    var notes = getGlobalParameter("job-notes"); 
    if (notes) { 
      var lines = String(notes).split("\n"); 
      for (line in lines) { 
        var comment = lines[line].replace(/^\s+|\s+$/gm,''); 
        if (comment) { 
          writeBlock("*-material:" + (comment))
          writeBlock("*-zmena:" + (comment))
        }
      }
    }
  }
if (programComment) {
   writeBlock("*-poznamka:" + (programComment))
 } else {
    writeBlock("*-poznamka:");
}

 

The current output is like this (it's wrong)

 

1 BLK FORM 0.1 Z X-24 Y-24 Z-150
2 BLK FORM 0.2 X+24 Y+24 Z+0
3 CYCL DEF 32.0 TOLERANCE
4 CYCL DEF 32.1 T0.02
5 *-material:11523
6 *-zmena:11523
7 *-material:A
8 *-zmena:A
9 *-poznamka:
10 *-datum: utery, 5. brezna 2024

 

The output should be like this:

 

1 BLK FORM 0.1 Z X-24 Y-24 Z-150
2 BLK FORM 0.2 X+24 Y+24 Z+0
3 CYCL DEF 32.0 TOLERANCE
4 CYCL DEF 32.1 T0.02
5 *-material:11523
6 *-zmena:A
7 *-poznamka:
8 *-datum: utery, 5. brezna 2024

 

If I don't enter any data in the notes, the output should be like this:

 

1 BLK FORM 0.1 Z X-24 Y-24 Z-150
2 BLK FORM 0.2 X+24 Y+24 Z+0
3 CYCL DEF 32.0 TOLERANCE
4 CYCL DEF 32.1 T0.02
5 *-material:
6 *-zmena:
7 *-poznamka:
8 *-datum: utery, 5. brezna 2024

 

I enter the data here:

Notes1.png

 

Notes2.png

 

Thanks

 

0 Likes
Reply
Accepted solutions (1)
280 Views
4 Replies
Replies (4)

Tomas_V_cz
Advocate
Advocate
Accepted solution

I already solved it myself... If anyone is interested, the code is as follows:

var material = "";
var zmena = "";

if (hasGlobalParameter("job-notes")) {
    var notes = getGlobalParameter("job-notes"); 
    if (notes) { 
      var lines = String(notes).split("\n"); 
      material = lines[0].replace(/^\s+|\s+$/gm,'');
      zmena = lines[1].replace(/^\s+|\s+$/gm,'');
    }
}

writeBlock("*-material:" + material);
writeBlock("*-zmena:" + zmena);
0 Likes

a.laasW8M6T
Mentor
Mentor

I'm Curious

What is the reason these notes are being output as Section Comments(* -), Rather than normal comments(;)?

 

It doesn't seem like the correct usage, but I am probably missing something.

0 Likes

Tomas_V_cz
Advocate
Advocate

 

1 BLK FORM 0.1 Z X-232 Y-15 Z-12
2 BLK FORM 0.2 X+2 Y+15 Z+0
3 CYCL DEF 32.0 TOLERANCE
4 CYCL DEF 32.1 T0.02
5 *-material:11523                   'job-notes' 1 line
6 *-zmena:A                          'job-notes' 2 line
7 *-poznamka:                         Program Comment
8 *-datum: streda, 6. brezna 2024     date of generation of the program with the name of the day
9 ; 
10 *- zarovnat z prava X+0            'operation-comment'    
11 ; 
12 TOOL CALL 1 Z S2200; monolit 16
13 L M6 
14 M3
15 L X+11.3 Y+20 R0 FMAX
16 M8
17 L Z+50 R0 FMAX

 

 

I need to get some data into the program - material - for example duralumin, stainless steel, etc... and the current change in the drawing. Fusion does not provide any global parameters that the postprocessor would write to the program. Our practice is that these data are in the program for various reasons - at a glance I can see if the program is up-to-date, what the material is. And this is the option to display this data in the program in the place that I want. Any idea how to get this data from Fusion other than writing it in this note?

 

And what is * - or ; It's just that the output in this part of the program was like this before. And that's how we like it. Other comments on operations are already with ;

 

the data "* -" is displayed in the right part of the screen of heidenhain 530 CNC machines - it is easy for the operator to quickly get to the desired place, because the operation lists are also with "* -"

0 Likes

a.laasW8M6T
Mentor
Mentor

OK, that makes sense if you want to see the information in the Sections window on the controller, rather than just in the program header.

1 Like