I am trying to use an X home limit from the PLC. I would like to use it as part of the normal X home function, but I can't configure it appropriately in ports and pins. Is it possible to add a modbus IO in ports and pins?
Are you sure you want to use Modbus for a home input?
Lets say that you are using 25Hz update for you Modbus Comms. That's 40ms worse case between updates. How far can your axis move in that time?
You also need to know how often the PLC is checking the switch. I don't know what PLC you are using, but lets say that it checks the switch 100 times per second. If so thats a 10ms delay between checking. Worst case is thatthe PLC checks the switch just before the switch is activated. It has to wait another 10ms for the hit is detected. Now your maximum delay is up to 50ms
Worse still, the delay is not deterministic. Sometimes it will be 50ms, sometimes when all the planets are aligned it will be only a couple of ms. This means your home position will change and not be consistent.
PLC can be used for limit switches as a slight overrun and inaccuracy and be tolerated with the correct sort of switches (non contact), but you need to do your sums carefully for home switches.
Lets say that you approach the home switch at 20 ipm. That's;
20/60= 333 thou per second
or 333/1000 = .333 thou per milli-second
So with a delay of 50ms your worst case error in your home position will be .333 *50 = 16.667 thou.
You need to decide whether this is an acceptable error for your machine and the type of work you are doing.
You could slow the speed that the axis approaches the home switch to 10 ipm. That will reduce your error to 8 thou.
Note this doesn't take into account any other errors in your system or delays in Mach.
If you are using the Macropump then that's another delay to take into account.
Cheers,
Peter.