OLP program structure of workpiece storages——革命制度党ntable Version +- RoboDK Forum (//www.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN) + - - -论坛:通用RoboDK问题(//www.sinclairbody.com/forum/Forum-General-questions-about-RoboDK) +--- Thread: OLP program structure of workpiece storages (/Thread-OLP-program-structure-of-workpiece-storages) |
OLP program structure of workpiece storages-maexbecks-02-12-2023 Hi all, I'd like to use RoboDK for offline programming of pick-and-place and machining projects. I have a question regarding a common task and how you would do it in RoboDK and if it is at all feasible in RoboDK. When you have a workpiece storage or a workpiece tray, how do you structure your programs for program generation? In the tutorial videos and in the examples it is mostly done with one program for each workpiece which is very inflexible. I don't want to create 20 programs with the same instructions except for a different target. My goal would be to get a generated function with the workpiece number as the argument. I know, that I could use the Python API to achieve this in the simulation but the generated programm would either create a programm with all movements to all the parts or I would need to generate the programs part by part. Is there a better way? RE: OLP program structure of workpiece storages-Olivier-02-13-2023 You can use the same program and instruction but set a different frame to have it work on another workpiece. With the API we are also able to copy/past programs and manipulate frames and targets. Let me know if you have a specific example that you need help with. RE: OLP program structure of workpiece storages-maexbecks-02-13-2023 (02-13-2023, 02:53 PM)Olivier Wrote:You can use the same program and instruction but set a different frame to have it work on another workpiece. Hi Olivier, thank you very much for your proposal. I started the way that you proposed but with huge storages (>40 workpieces) it is very repetitive and in the end I want a function like
Code:
getWorkpiece(workpieceNum)
I guess the best solution will be to generate the programs with the API and generate a "MainProgram" with a SWITCH statement in it which includes all the generated programs as subprograms. Is there a way to add arguments to the generated procedures except for hardcoding it into the post processor? Is it possible to tell AddProgram to create the program in a specific folder in the tree? |