IF else commands in Robodk- Printable Version +- RoboDK Forum (//www.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN) +--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API) +--- Thread: IF else commands in Robodk (/Thread-IF-else-commands-in-Robodk) |
IF else commands in Robodk-kri5too-02-12-2021 Hello RDK People Im really new in roboDK. Regarding that i have maybe a really "stupid" question, but i havent found a soultion from robodk help to solve it . I have made 2 diffrent movement programs in robodk. Let´s call them Prog1 and Prog 2. Now i want make condition if and else. How i can do it in RoboDK ? I can generate main program, that will run first Prog1 then Prog2, and edit it by hand and add the conditions. Like that, but i hope RoboDK has better solution inside the program how to do it
Code:
% % %
RE: IF else commands in Robodk-Albert-02-12-2021 If/then/else statements are not supported when you use the UI. Your workaround is the best way to go unless you want to use the API. For example, you could write a small script that emulates your logic and triggers the corresponding program. I'm sorry we can't be of more help at this moment. RE: IF else commands in Robodk-Jeremy-03-31-2021 Hi, If you download the latest version of RoboDK, you can use "IF" and "WHILE" statement. For it to work, you need to activate "Flow control statement" in "Tools"->"Options"->"Station" I attached an example station. Let us know if you have any comments. Jeremy RE: IF else commands in Robodk-Hiroe-07-01-2021 Dear Jeremy, My colleague tried a project using "IF" and "WHILE" statements, but he found something wrong in his project as attached. Could you specify what the cause is about not working well IF statement in his project? Best Regards, Hiroe RE: IF else commands in Robodk-Jeremy-07-02-2021 For it to work, you need to activate "Flow control statement" in "Tools"->"Options"->"Station". I forgot to mention it in my first comment, I edited it. RE: IF else commands in Robodk-malacasse-03-04-2022 Hi Jeremy Is there a reason why theFlow control statementis not enabled by default ? RE: IF else commands in Robodk-Albert-03-06-2022 Flow control statements in RoboDK is an experimental feature. To properly support this feature we would have to improve all our post processors to properly generate these flow control statements when generating robot programs. |