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

M_RunCodes are consistently commented out for Staubli robot

#1
Hi guys, 
I've been trying to figure out how to properly setup the M code functionality for my situation. I have a Staubli Rx160L, running a CS8C controller. I'm using it for laser cutting. I am using the machining  project to import Gcode to RoboDK. I've setup a program on my controller named M_RunCode that triggers the laser on when it receives MRun_Code (3), and off with M_RunCode (5). The codes are present in the Gcode, and RoboDK passes them into the VAL3 program file, but they are commented out no matter what I do. How do I get RoboDK not to comment out the M_RunCodes?

Thanks
#2
I call my (sub)programs something like M100 M101 M102 and so on, and in program events I set M%1
#3
I've tried exactly that. No matter what I set in program events, I get the result commented out like this:
Code:
  // Program generated by RoboDK v5.9.0 for Staubli RX160L on 15/03/2025 18:19:39
  // Using nominal kinematics.
  mNomSpeed.tvel = 1000.000
  // Show laser cutter head assembly 6 in
  movej(t1,tTool1,mNomSpeed)
  movel(p1,tTool1,mNomSpeed)
  //call prog:MRunCode(9)
  //call prog:MRunCode(5)
  movel(p2,tTool1,mNomSpeed)
  //call prog:MRunCode(3)
  mNomSpeed.tvel = 100.000
  movel(p3,tTool1,mNomSpeed)
  movel(p4,tTool1,mNomSpeed)
  movel(p5,tTool1,mNomSpeed)
#4
By looking at your sample code I assume you are using a Staubli robot controller. Correct?

If so, you should customize the Staubli post processor to ouptut calls to robot programs or to implement the corresponding code you would like to have.

This is the default behavior for generating programs for Staubli robot controllers:
Code:
    def RunCode(self, code, is_function_call = False):
        """Adds code or a function call"""
        if is_function_call:
            if not code.endswith(')'):
                code = code + '()'
            #call prog:start()
            #self.addline('call prog:%s' % code)# add as a call
            self.addline('//call prog:%s' % code)# add as a comment
        else:
            self.addline(code)
You can find more information about how to customize a post processor here:
https://robodk.com/doc/en/Post-Processor...amesFilter
  




Users browsing this thread:
1 Guest(s)