02-22-2023, 09:43 AM
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:
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:
一种选择,以防止基因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)
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:
- SelectTools-Options
- Select theProgramtab
- Check the optionInline subprograms