Since the hydraulic cylinder is analog, you would do the calculations in the PLC. If IN set the value to 0, if OUT set the value to 100 (or your max setting) & have the PLC check to make sure both are not on, if so set a bit & have an object on the HMI become visible or change color.
Being a cylinder there will probably be times the cylinder is neither IN nor OUT while travelling, I would check that both were off after a time delay to give the cylinder time to reach the other limit, then turn on a warning bit.