Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Post_Processor

#1
Hello,

I have a problem with Editing the  "Fanuc_R30i.py" post processor:

Currently I am doing what I need to do with one python code such that:
  • I use (load) the output of the  "Fanuc_R30i.py" file (which is a .Ls file) and perform some changes to it and save it again, and then I send this newly saved file to my robot

But the thing that I would like to do is to embed my python file in to the "Fanuc_R30i.py" and do what I have been doing so far through a single step (not two)

honestly when I read the "Fanuc_R30i.py" file, I don't find any place to perform some changes.
I tryed changing the "class RobotPost" and adding some function to this file
but unfortunatly when I generate the program all the changes, I performed, are skipped. 

I wondered if you could help me and guide me in this?
#2
(03-09-2023, 09:44 PM)mehrdad_rafi Wrote: honestly when I read the "Fanuc_R30i.py" file, I don't find any place to perform some changes.

You need to overwrite the methods you want to use, because the py files use the already compiled classes as their base.

You either have to reach out to RoboDK and ask for the code of your PP or overwrite the methods you want to use in the py file.

Can you provide an example of what you want to achieve?
#3
(03-10-2023, 11:06 AM)maexbecks Wrote:
(03-09-2023, 09:44 PM)mehrdad_rafi Wrote: honestly when I read the "Fanuc_R30i.py" file, I don't find any place to perform some changes.

You need to overwrite the methods you want to use, because the py files use the already compiled classes as their base.

You either have to reach out to RoboDK and ask for the code of your PP or overwrite the methods you want to use in the py file.

Can you provide an example of what you want to achieve?

Thank you very much for replying.

here is a simple example of what I need to do:

After chosing the Post_processor ("Fanuc_R30i.py) for my simulation and hitting "Generate robot program". ---> roboDk generates a .Ls file for me and I can see many lines such as the one below in this .Ls file:

  125:L P[1] 174mm/sec CNT1  ; 

I wrote a program in python which loads this .Ls file, finds the line (125) and change CNT1 to Fine 
 then I save all the resullts in a new .Ls file.

the thing that I would like to do is to copy my own python code in to "Fanuc_R30i.py"  and generate a new post processor (like modified_Fanuc_R30i.py)
as such, I can select modified_Fanuc_R30i.py insted of the original "Fanuc_R30i.py" and have the proper result in one step
in this way I will be able to eliminate many steps that I am currently doing manually.
#4
(03-10-2023, 01:58 PM)mehrdad_rafi Wrote:   125:L P[1] 174mm/sec CNT1  ; 

I wrote a program in python which loads this .Ls file, finds the line (125) and change CNT1 to Fine 
 then I save all the resullts in a new .Ls file.

For this there is no need to change the PP. Add a "Set Rounding Instruction" with -1 before the movements you want to move to accurately.
For programs generated from a machining project you can right click on the program and activate "Show instructions". This way you can add the rounding instruction wherever you want. But the program will be overwritten every time you update your machining project.
#5
(03-10-2023, 03:01 PM)maexbecks Wrote:
(03-10-2023, 01:58 PM)mehrdad_rafi Wrote:   125:L P[1] 174mm/sec CNT1  ; 

I wrote a program in python which loads this .Ls file, finds the line (125) and change CNT1 to Fine 
 then I save all the resullts in a new .Ls file.

For this there is no need to change the PP. Add a "Set Rounding Instruction" with -1 before the movements you want to move to accurately.
For programs generated from a machining project you can right click on the program and activate "Show instructions". This way you can add the rounding instruction wherever you want. But the program will be overwritten every time you update your machining project.

yes, what you said is totally correct, but my program contains 20 thousands of lines , Thus, I think this method is not applicable to my case.(unfortunately)
#6
(03-10-2023, 04:08 PM)mehrdad_rafi Wrote: yes, what you said is totally correct, but my program contains 20 thousands of lines , Thus, I think this method is not applicable to my case.(unfortunately)

Hi Mehrdad,

mmh... I am still unsure what the issue is. One set rounding instruction would propagate until the next set rounding instruction. This would imply that you either have multiple rounding instructions in your program or that you wish that only several movements are accurate? If that's the case how do you decide which movement is accurate and which is continous?

If you wish to make all movements accurate without deleting existing rounding instructions the easiest solution would be to override the setZoneData method like this:

Code:
def setZoneData(self, zone_mm):
   pass
This way all rounding instructions would be ignored and every movement gets the default value of CNT_VALUE which is FINE.
  




Users browsing this thread:
1 Guest(s)