Hello everyone,
I am using a UR10e with a Cognex 8402C. The firmware on the UR10e is 5.5.
I am unsure on how to format my camera to receive and send data base off the UR Script code I have pasted below. I am very new to using these two systems so any help will be very much appreciated.
Credit to this link for the code: Communication between UR and Cognex - #4 by Sibel
Code:
port = 23586
ip = “192.168.0.10”
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)
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 string and list of bytes gave some problems in the past, sending them seperate
socket_send_byte(10, socket_name)
receive = socket_read_string(socket_name)
textmsg(receive)
socket_close(socket_name)
socket_send_string(“GVA009”, socket_name)
socket_send_byte([13,10], socket_name)
# Expected format of data string: “(x, y, z)” where x, y, and z are floats or integers
value_count = 4
timeout = 5
receive_list = socket_read_ascii_float(value_count , socket_name, timeout)
### There is still some data remaining in the camera buffer, we should empty it.
buf = socket_read_string(socket_name)
### Show the resulting list
textmsg("Received list:", receive_list)