Hello everyone
i had an issue of sending string from my cognex d905c camera using in-sight vidi suite software to my UR robot over TCP/IP using tcpclient function on vidi suite
the connection is established but i’m still getitng (0,nan,nan) in my robot !
does any one know how to fix this issue
thanks in advance
my script :
Connect to a Cognex camera, tested on UR Firmware 3.3
Configuration of camera settings; adjust where needed
port = 23
ip = “10.146.97.8”
socket_name = “Cognex”
Connect to camera and return status
socket = socket_open(ip, port, socket_name)
textmsg("Connection successful?: ", socket)
After connecting, the camera first sends a welcome message and asks for username and password
receive = socket_read_string(socket_name)
textmsg(receive)
Send username
socket_send_string(“admin”, socket_name)
socket_send_byte([13,10], socket_name) # Send Enter key
Receive request for password
receive = socket_read_string(socket_name)
textmsg(receive)
Send password
socket_send_string(“”, socket_name)
socket_send_byte(13, socket_name) # Empty password
socket_send_byte(10, socket_name)
Check status after sending credentials
status = socket_read_line(socket_name)
textmsg(status)
popup(status)
Expected format of data string: “(x, y)” where x and y are floats or integers
value_count = 2
timeout = 5
target_point = socket_read_ascii_float(value_count, socket_name, timeout)
Clear any remaining data in the camera buffer
buf = socket_read_string(socket_name)
Show the resulting list
textmsg(“Received list:”, target_point)
popup(target_point)
Close socket
socket_close(socket_name)