First of all, thanks for the answer.
I am very new to this, and not sure how to exactly write the commands you are talking about. Can you give me an example? Like how do i specifically write the command i need. And i dont know which ports you are talking about, is it the robot in/outputs to which i connect the PLC variables? I guess im just not sure how to write this in the correct way.