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

Python subprograms do not get generated

#2
Python programs should be generated separately as they won't be included with the main UI program.

一种选择,以防止基因rating too many programs is to have a Python script that moves relative to the current position of a robot or based on an index and some criteria.

For example, if you want a relative move to the current position:
Code:
# Take the current position:
current_pose = robot.Pose()
# Move relative 100 mm along the tool Z axis
new_pose = current_pose * transl(0,0,100)
robot.MoveL(new_pose)
You would need to create a similar program on the robot controller side as generating this program won't work for generic program generation.

Another example that can integrate better with generic program generation is to use an index based on some criteria. For example, if you have different trays and different part numbers, you can create program numbers based on the corresponding indexes. It would be easy to use the API to generate all these programs automatically. But I agree it would be a messy station with many programs. You can still place them in a folder and hide them but all these programs should be available in the controller.

Also, you can inline subprograms in the same main program recursively by following these steps in RoboDK:
  1. SelectTools-Options
  2. Select theProgramtab
  3. Check the optionInline subprograms


Messages In This Thread
RE: Python subprograms do not get generated - byAlbert- 02-22-2023, 09:43 AM



Users browsing this thread:
1 Guest(s)