If there are mechanical limits on the machine, the type of the limit switch and the input number for this switch on the controller is set as shown in the example below.
For example, the minus limit sensor is applied to the controller input 5, and the positive limit sensor is applied to the 8 input of the controller. Both shoots are normally closed.