Postprocessor Script help

Postprocessor Script help

iamcdn79
Mentor Mentor
897 Views
2 Replies
Message 1 of 3

Postprocessor Script help

iamcdn79
Mentor
Mentor

I am trying to write a script for one of our posts that if it detects cutter compensation set to None to write "M112 T.005" and if it is on to leave the line blank and put that script into a user parameter.

 

Not sure if I have the correct wording for the script I get no errors but the issue I have is that it is always adding the M112 T.005 even when the toolpath is not using cutter comp.

 

This is the script that I wrote

 

iamcdn79_0-1698079857022.png

this is the user parameter I made using the script

iamcdn79_1-1698079985034.png

this is the NC code with cutter comp set to LEFT in the NC program settings but it's adding M112 T.005 when the line  should be blank

 

iamcdn79_2-1698080095250.png

 

 

iamcdn79_3-1698080179983.png

 

 


Intel Core i9 13900KF CPU
128 GB Kingston Beast DDR4 SDRAM
PNY RTX A2000 6GB Video Card
WD 1 TB SSD Hard Drive
Windows 11 Pro

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

Sean571
Advocate
Advocate
Accepted solution

So You will find that the Cutter compensation Mode does not get set until the line that cutter comp is actually turned on. Meaning that at Toolpath start or Toolpath Header it will always be set to off. Here is the way I get around this for setting the Tool Radius depending on the cutter comp:

Sean571_0-1698102264894.png


Because I have this setup in toolpath start, I can't check the Cutter compensation Mode parameter directly because it it won't be turned on yet. I have to use this instead:

program.ActiveToolpath.GetParameter("%p(Cutter Compensation Mode)%")


In your case you'll check if it is set to "OFF" but the concept is the same.

Sean Wroblewski
Applications Engineer

Message 3 of 3

iamcdn79
Mentor
Mentor

I was thinking that might be why it wasn't reading my cutter comp properly. 

 

 


Intel Core i9 13900KF CPU
128 GB Kingston Beast DDR4 SDRAM
PNY RTX A2000 6GB Video Card
WD 1 TB SSD Hard Drive
Windows 11 Pro

0 Likes