TCP position control via OPC-UA


I have a robot which is controlled by a beckhoff PLC (the PLC sends XYZ positions to the robot).

i have VC professional 4.0 and i wish to simulate the commands sent from the PLC using OPC-UA.

Are there variables i can map to control the TCP xyz/RxRyRz positions directly and not the joints?


Recommend to use joints instead of TCP.

  1. VC inverse-kinematics is not 100% the same as real robot.
  2. Can assign J1, J2, J3, J4... to VC robot directly.

@Chungmin - thanks for the comment,

as i mentioned, the PLC sends X,Y,Z coordinates as well as Rx orientation. is there a way for me to get a specific robot’s inverse kinematics?

if not , as a first step, sending TCP coordinates directly will help as i will be able to extract mid points in the robot’s path to help avoid collisions in the real robot’s path.


You will need to make separate variables of type double for x, y, z and rx on the PLC and then expose those through the Beckhoff’s OPC UA server.

On the simulation side you need to create properties or signals of type real for the x, y, z, rx, and make a Python script in the robot component that reads the signal / property values and uses the robot controller behavior to update the robot’s pose.

If having multiple properties / signals feels too unwieldy, you can put them into a string on the PLC and parse that in the script.

Thanks @TSy ,

after watching additional videos (there are really alot) i got to the same conclusion and implemented what you suggested and it works).

Do you have experience with such applications? (PLC to Robot and simulating that). I have a bunch of questions and i don’t want to overflow the forums here :slight_smile:



i have the same issue. I want to send the TCP coordinates via OPC UA. How did you implemented the Python script? I can access the variable but the values are not changing during runtime. The values are read just once in the beginning of the simulation. But I need to change the TCP coordinates during runtime. Could you may send me the part of your python script where you are updating the TCP coordinates?

Thanks for your help.

I’d be interested in this as well. Is it possible to change robot program statements that are in a while loop during runtime?


Same question - sending pose data to a robot from variables. Further question: we can assign a joint value, but it makes the robot “snap” to the new pose in an unrealistic way. Can you create a pose from variables and then have the robot move to the pose using the usual Linear Move or Joint Move?


Here’s an attached model that does something similar that some of you are asking for. White robot has properties PosX/Y/Z/RX/RY/RZ taht you can change (with OPC UA) and python script inside robot drives to the given position.

Orange robot has a program that you can offset using properties. Logic for offset is written in a python process handler in the robot.


PLC_robot_control.vcmx (1.1 MB)