[Solved] How to control UR through PLC

Hi, I’m looking for a way to connect a PLC to a UR10 (running firmware 1.8) so I can tell the robot what to do. The robot needs to go to a pose, wait for a signal from the PLC and then move to a different pose. Each specific action always results in the same pose.
Is there a way to do this? If yes, is documentation or a tutorial available?

You can do this with TCP communication.

In the PLC you will need to use TSEND_C. With that instruction you can send information to the UR. Visit the following URL for a configuration example: https://support.industry.siemens.com/cs/ww/en/view/67196808. You can also find more information in the help file of TIA Portal (Press the F1 key with the instruction selected or via Help -> Show help).

On the UR side you need to receive the information. Depending on what you have send, you can use “socket_read_string”, “socket_read_ascii_float” or “socket_read_binary_integer”. You can find more information about these instruction in the UR scripting manual. I could not find an example, but there is one about sending data from the UR: http://www.zacobria.com/universal-robots-zacobria-forum-hints-tips-how-to/script-client-server-example/. You can change this example so it can receive data.

Alternately you can also try to use Modbus/TCP. This is easier to setup, but I’ve seen some problems with it in the UR. Sometimes it just won’t work.
PLC: https://support.industry.siemens.com/cs/nl/en/view/102020340
UR: https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/modbus-communication-16357/ and https://www.universal-robots.com/how-tos-and-faqs/how-to/ur-how-tos/modbus-signals-in-robot-programs-16363/