RoboDK Forum
Sending POPUP command from RoboDK API to robot driver可打印版本

+- 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: Sending POPUP command from RoboDK API to robot driver (/Thread-Sending-POPUP-command-from-RoboDK-API-to-robot-driver)



Sending POPUP command from RoboDK API to robot driver-Robotux-04-07-2023

Hi, I have made a custom robot driver would like to pass some pass POPUP commands from RoboDK Python script when working in online mode.
I only managed to pass them through a program with "Show message instruction". But I would like to do that without creating programs with these instructions. Is there a way to send POPUP command directly to robot driver through Python API? Same as you can send other commands like MOVJ (and other commands) using `robot.MoveJ( joints )`.


RE: Sending POPUP command from RoboDK API to robot driver-Albert-04-07-2023

You can trigger the POPUP command in your driver by calling RunMessage from the RoboDK API:
//www.sinclairbody.com/doc/en/PythonAPI/robodk.html#robodk.robolink.Robolink.RunMessage

For example, this code:

Code:
robot.RunMessage("Your popup message")

Will send this command to your driver:

Code:
POPUP Your popup message



RE: Sending POPUP command from RoboDK API to robot driver-Robotux-04-07-2023

Hi Albert,
Thank you for a response. I have tried this but I am getting an error:


Code:
item.RunMessage( json.dumps( commands, separators=(',', ':') ) )
Attribute error: 'Item' object has no attribute 'RunMessage'

item.Type() returns 2 which isITEM_TYPE_ROBOT


Is this a bug or I am doing something wrong? My RoboDK version is v5.5.3 currently.