Hi,
OK, I would not recommend using ROS. Only suitable for a PC based application and an academic project in my humble opinion. I would go for your ‘second’ approach. Create a robot program that is a consumer of commands from the PLC. It would be a state machine of sorts. IF the goal is to control every aspect of the robot from the PLC (and/or it’s HMI) then I would use ProfiNet or EthernetIP and the PLC will need to get status of the robot from the fieldbus interface and send commands as appropriate. You could have the PLC talk to the dashboard server directly via tcp/ip socket commands but this is cumbersome too (I recently learned of a colleague that spent two days just doing this part of the communications on a B&R PLC). The less cumbersome approach is to use a URcap from a URplus partner called Robot27. The product is called Robot27-Connect and here is a link to it : Products-Connect | Robot27
It will allow the PLC to simply send commands to the robots dashboard server via an integer register (for doing all the things you normally do manually via the teach pendant).