Universal Robots Forum

Update TCP in real time

Hello,

I have developed a program to send a function of multiple poses via port 30001. I would like to change the TCP during the motion via set_TCP. I do this by sending a secondary function (sec func()), but I would like to constantly change the tcp, It only seems to work once.

Is it possible to send multiple secondary functions to update the TCP?

Why not include a thread in your main program (the one sent over 30001), that waits for your new TCP data, and updates this dynamically in this program.
E.g. by receiving the data over RTDE.

Thanks for the reply, I am not sure what you mean. Would I be sending set_TCP in this thread? At the moment I send all poses in one go as a function, I then run the motion and stream data via MODBUS (pose position, current TCP) I can change the TCP but I can’t seem to get it to update more than once.

def myFunction():
   thread mySetTCPThread():
      while (no new TCP available somewhere):
         sync()
      end
      set_tcp(values read somewhere)
      sync()
   end
   threadID = run mySetTCPThread()
   while ( True ):
      # Your other motion commands
   end
end
1 Like