Universal Robots Forum

Problem with textmsg sent through script

In my python daemon I use this script to log messages into GUI log-tab:

#!/usr/bin/env python
import socket
msg = "my message"
__socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
__socket.connect(('', 30002))
__socket.send("textmsg(\"" + msg + "\")\n")

this will produce this on CB3 simulator:

and this on eSeries simulator:

As you can see I cannot log through script in eSeries simulator.
I’ve also tried to wrap the textmsg function into “def my_wrap_function()” (paying attention to the \nend\n) but the results are the same: I can see in the GUI log-tab the messages “Program my_wrap_function started” but no textmsg log.

I’m using for the tests the simulator and the

Robot has to be powered on to execute this program.
On eSeries simulated robot is powered off by default after you start it.
I tried it, and your script works fine.

1 Like