Problem simulating waitDI using API- Printable Version +- RoboDK Forum (//www.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN) +--- Forum: RoboDK bugs (//www.sinclairbody.com/forum/Forum-RoboDK-bugs) +--- Thread: Problem simulating waitDI using API (/Thread-Problem-simulating-waitDI-using-API) |
Problem simulating waitDI using API-Aimar-03-16-2021 Hi, I have some problem when simulating the statement waitDI using the RoboDK API. I attach a rdk file. In the station there is a python program called "IO Test", is the one I have the issue with. Prog2 is just added to check WaitDI instruction using the GUI (which works fine). When executing "IO Test" the robot is suposed to wait the activation of some DI during the simulation but it just jumps that instruction. SetDO works properly as I am able to see how outputs change value while simulating. I will highly appreciate any help with this problem. Thank you. Aimar RE: Problem simulating waitDI using API-Aimar-03-16-2021 I think I did not make properly the rdk file attachment. I attach it in this post. RE: Problem simulating waitDI using API-Vineet-03-16-2021 Hello Aimar, Thanks for writing in. RDK.waitDI() function cannot be used from the API, for the time being for simulation purposes. This is something we will definitely improve in the future. However, there is an easy way to go around it. We can retrieve the Station Parameters using the RDK.getParam('in1') and simulate the DI being made 1 by the user by clicking 'Okay' on the message box pop up. By clicking on 'Cancel', an exception will be raised. Comments in the program below explain further.
Code:
def WaitForBox():
Another important thing here is to check for the RDK.RunMode(), else you wont be able to generate program for the robot.Find attached the .rdk file. Hope this helps. |