DoF - a Robotiq Community
Warning sign
The Dof Community was shut down in June 2023. This is a read-only archive.
If you have questions about Robotiq products please reach our support team.
RobTop

30003

RobTop

Ok I deliver now detailled information
my python code:

# Echo client program
import socket
import time
import struct
HOST = "192.168.80.128" # The remote host
PORT_30003 = 30003
print "Starting Program"
count = 0
home_status = 0
program_run = 0

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(10)
s.connect((HOST, PORT_30003))
s.setblocking(0)

while (True):
    if program_run == 0:
        try:
            get_active_tcp(s)
            get_active_tcp(s)
            get_active_tcp(s)
            get_active_tcp(s)
            get_active_tcp(s)
            get_active_tcp(s)
    
        except socket.error as socketerror:
            print("Error: ", socketerror)
 
home_status = 1
program_run = 0
s.close()
print "Program finish"


//And the get_active_tcp:

def get_active_tcp(s):
    time.sleep(1.00)
    print ""
    packet_1 = s.recv(4)
    packet_2 = s.recv(8)
    packet_3 = s.recv(48)
    packet_4 = s.recv(48)
    packet_5 = s.recv(48)
    packet_6 = s.recv(48)
    packet_7 = s.recv(48)
    packet_8 = s.recv(48)
    packet_9 = s.recv(48)
    packet_10 = s.recv(48)
    packet_11 = s.recv(48)
    packet_12 = s.recv(8)
    packet_12 = packet_12.encode("hex") #convert the data from \x hex notation to plain hex
    x = str(packet_12)
    x = struct.unpack('!d', packet_12.decode('hex'))[0]
    print "X = ", x * 1000
    packet_13 = s.recv(8)
    packet_13 = packet_13.encode("hex") #convert the data from \x hex notation to plain hex
    y = str(packet_13)
    y = struct.unpack('!d', packet_13.decode('hex'))[0]
    print "Y = ", y * 1000
    packet_14 = s.recv(8)
    packet_14 = packet_14.encode("hex") #convert the data from \x hex notation to plain hex
    z = str(packet_14)
    z = struct.unpack('!d', packet_14.decode('hex'))[0]
    print "Z = ", z * 1000
    packet_15 = s.recv(8)
    packet_15 = packet_15.encode("hex") #convert the data from \x hex notation to plain hex
    Rx = str(packet_15)
    Rx = struct.unpack('!d', packet_15.decode('hex'))[0]
    print "Rx = ", Rx
    packet_16 = s.recv(8)
    packet_16 = packet_16.encode("hex") #convert the data from \x hex notation to plain hex
    Ry = str(packet_16)
    Ry = struct.unpack('!d', packet_16.decode('hex'))[0]
    print "Ry = ", Ry
    packet_17 = s.recv(8)
    packet_17 = packet_17.encode("hex") #convert the data from \x hex notation to plain hex
    Rz = str(packet_17)
    Rz = struct.unpack('!d', packet_17.decode('hex'))[0]
    print "Rz = ", Rz
   
    packet_18 = s.recv(624)


// UR5-Simulator is running in the VMWare and is in the remote running.

// If I move the Roboter with another script, the Roboter is moving, but no change in the received message.
// But it is a different message because the timestamp in the received message is changing!

// So what is my mistake? Do I have to execute a URScript in the Roboter to get the current tcp?

RobTop

I try it today