How to get sensor/variable data while controlling via PLC?

I would like to connect SIMATIC S7-1200 to UR3e. As a person who never used PLC before, I am still learning it, hence I have a question.

I need to record all network traffic between PLC and UR3e. I am thinking duplicating the traffic via network switch. What is the correct way of doing this?

Hi,
I am not sure why you would want to do this but one tool that might be useful is WireShark.

The first method I would recommend (in general) for communicating to the robot would be ProfiNet, if using a Siemens PLC.

Hi @bba thanks for the reply. I will have a look. I think I do not have enough knowledge about these, I will have a more detailed look than provide update. By the way the use case is, I will attack to arm and try to detect via PC that runs intrusion detection system.

Update: The communication will be done over OPC-UA.

I guess I will go with these two:
https://uk.rs-online.com/web/p/plcs-programmable-logic-controllers/8251685 &
https://uk.rs-online.com/web/p/iot-gateways/1244038.