RTDE connection reset by peer error 104

Hello,

I’am trying to constantly update data on the robot with the RTDE protocol (while true loop). Now I am having a problem. I get the error unable to negotiate protocol version. What you see in my code is that I open the connection send the data and close the connection. If I don’t open and close my connection I get another error namely: connection reset by peer. How can I fix these problems? Anyone a suggestion?

Piece of code:
counter = 0
while True:
robot = robot_class.robot_ur5e(robot_ip,30004,“…/Smart_cobot/control_loop_configuration.xml”)
counter += 1
print(counter)
list_setp = [0.0,0.0,0.0,0.0,0.0,0.0]
robot.send_setpoint(list_setp)
robot.stop_communication()