RoboDK Forum
How to use RUNMODE_QUICKVALIDATE?- 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: How to use RUNMODE_QUICKVALIDATE? (/Thread-How-to-use-RUNMODE-QUICKVALIDATE)



How to use RUNMODE_QUICKVALIDATE?-j_cso-12-05-2022

I can't find example code anywhere or anything in the docs.


RE: How to use RUNMODE_QUICKVALIDATE?-Albert-12-05-2022

RoboDK performs the simulation of your programs by default. However, you can change the "RunMode" by triggering the setRunMode call at the top of your programs.

Example:
Code:
RDK.setRunMode(RUNMODE_QUICKVALIDATE)
This example shows how to change the RunMode:
//www.sinclairbody.com/doc/en/PythonAPI/examples.html#offline-programming-gui

When you run in this mode, it will allow you to quickly validate if your program is feasible. This behavior is similar to right click a program and selecting "Check path". Singularity and target reach errors errors should be displayed/raised via the API.


RE: How to use RUNMODE_QUICKVALIDATE?-j_cso-12-07-2022

That example uses ProgramStart() / MoveJ() / Finish() to create a program on the fly (which is useful, since I was also confused about ProgramStart()). But in my case I have a program in the tree which I don't think I can run with that approach? I normally use RunProgram(), but with RUNMODE_SIMULATE I get a modal dialog box about "Target at instruction MoveJ (Target 1) is not reachable", which blocks my code until I click. If I use QUICKVALIDATE it doesn't give me any indication that there's a problem.

Is RUNMODE_QUICKVALIDATE only intended for use with ProgramStart() / Finish() and not RunProgram/MakeProgram?

Steps to reproduce:
New station, load UR10e model, create a program, create a MoveJ, then:

>>> t = rdk.Item("Target 1")
>>> t.Valid()
True
>>> t.setPoseAbs(robomath.transl(5000,0,0)) # Move target out of reach of robot
RoboDK item (93857965933680) of type 6
>>> rdk.RunProgram("Prog1")
0
>>> # ^ Here I get a modal dialog in the GUI about the unreachable target
>>> rdk.setRunMode(robolink.RUNMODE_QUICKVALIDATE)
>>> rdk.RunProgram("Prog1")
0
>>> # ^ Here I get no indication there's anything wrong

Also, if I don't dismiss the dialog box soon enough, the API drops:

Traceback (most recent call last):
File "", line 1, in
File "/home/j/RoboDK/Python/robodk/robolink.py", line 2226, in RunProgram
prog_status = self.RunCode(fcn_param, True)
File "/home/j/RoboDK/Python/robodk/robolink.py", line 2254, in RunCode
prog_status = self._rec_int()
File "/home/j/RoboDK/Python/robodk/robolink.py", line 918, in _rec_int
buffer = self.COM.recv(4)
socket.timeout: timed out

Huh, looks like maybe calling Update() and checking the valid_ratio does what I want? But the modal dialog still seems like a bug and messed up a long batch job of mine.


RE: How to use RUNMODE_QUICKVALIDATE?-Albert-12-07-2022

I'm unable to reproduce this issue. Can you share an RDK project file and sample code?

On the other hand, the run mode is more intended to work when your script drives the robot directly. For example, moving the robot using move commands. Not so much when you trigger program simulations using RunProgram. If your goal is to check if your program is valid you should use Update. There should be no dialogs when you use the API. I was unable to reproduce this issue but if you can share an example we can fix it.


RE: How to use RUNMODE_QUICKVALIDATE?-j_cso-12-07-2022

Here's code that produces a station from scratch and reproduces the problem.


RE: How to use RUNMODE_QUICKVALIDATE?-j_cso-12-13-2022

Following up, did that reproduce for you?


RE: How to use RUNMODE_QUICKVALIDATE?-Albert-12-14-2022

我们刚刚出版了一本新的Windows更新lows you to do the following:
Code:
RDK.Command("Popups","0")
So you can do the following to avoid any blocking popups:
Code:
RDK.Command("Popups","0")
RDK.RunProgram("p")
This applies to all popups, including the ones you provoke through the API via the same connection or other Robolink connections.

We should be releasing Mac and Linux versions before the end of the year.


RE: How to use RUNMODE_QUICKVALIDATE?-j_cso-12-14-2022

Fantastic, thanks!


RE: How to use RUNMODE_QUICKVALIDATE?-Albert-12-22-2022

For your information, Mac and Linux versions of RoboDK have now been updated with this fix.