Popup messages send via Script from a PC.
The UR script manual mention this syntax.
But as “ (apostrophe) is a protected character in Python – then it is neseccary to insert in \ from of “ in order to actually send the “ when using Python.
Python program running on PC.
Echo client program
import socket
import time
HOST = “192.168.0.9” # The remote host
PORT = 30002 # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.send (“set_digital_out(2,True)” + “\n”)
time.sleep (1)
s.send (“popup(\”Messages\”, title=\”The Headline in the Blue box\”, blocking=True)” + “\n”)
time.sleep (1)
s.send (“set_digital_out(2,False)” + “\n”)
time.sleep (1)
data = s.recv(1024)
print “Good bye!”
Provides this result on the Robot.
Echo client program
import socket
import time
HOST = “192.168.0.9” # The remote host
PORT = 30002 # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.send (“set_digital_out(2,True)” + “\n”)
time.sleep (1)
s.send (“popup(\”Messages\”, title=\”The Headline in the Blue box\”, warning=True, error=False)” + “\n”)
time.sleep (1)
s.send (“set_digital_out(2,False)” + “\n”)
time.sleep (1)
data = s.recv(1024)
print “Good bye!”
Provides this result on the Robot.
Echo client program
import socket
import time
HOST = “192.168.0.9” # The remote host
PORT = 30002 # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
s.send (“set_digital_out(2,True)” + “\n”)
time.sleep (1)
s.send (“popup(\”Messages\”, title=\”The Headline in the Blue box\”, warning=False, error=True)” + “\n”)
time.sleep (1)
s.send (“set_digital_out(2,False)” + “\n”)
time.sleep (1)
data = s.recv(1024)
print “Good bye!”
Provides this result on the Robot.
Disclaimer: While the Zacobria Pte. Ltd. believes that information and guidance provided is correct, parties must rely upon their skill and judgement when making use of them. Zacobria Pte. Ltd. assumes no liability for loss or damage caused by error or omission, whether such an error or omission is the result of negligence or any other cause. Where reference is made to legislation it is not to be considered as legal advice. Any and all such liability is disclaimed.
If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
Author:
By Zacobria Lars Skovsgaard
Accredited 2015-2018 Universal Robots support Centre and Forum.