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

Adding detach logic to post processor

#1
Jeremy,

I am trying to figure out how to update the Fanuc post processor to insert custom logic instead of the "Detach from Tool" generic logic that is currently generated. I understand (in general) how the post processor works and would have expected to see something like 

def detach(self):
   io_var = '! Detach from Tool;"
   self.addline('io_var')


but can't find any references in the post file for the word "detach".
    
Thanks

Kevin
#2
Hi Kevin,

You should take a look at the RunCode function of your post processor and implement something like this:

Code:
   def RunCode(self, code, is_function_call):
       """Adds code or a function call"""
       if not is_function_call:
           if "attach to " in code.lower():
               self.addline("CustomFunction(param);")
#3
(04-24-2020, 11:17 AM)Albert Wrote: Hi Kevin,

You should take a look at the RunCode function of your post processor and implement something like this:

Code:
   def RunCode(self, code, is_function_call):
       """Adds code or a function call"""
       if not is_function_call:
           if "attach to " in code.lower():
               self.addline("CustomFunction(param);")

Thanks. I will give that a look.
  




Users browsing this thread:
1 Guest(s)