Well I got it to a point where it was working but it only reversed and went the full way if you covered the first sensor the whole time it travelled back to the second sensor, so I was testing as much as I could... If my programming is a bit scruffy, like I said I've been messing with both my programming and my circuit to try and get the second half to work how I want it to but it just wasn't happening. I might have pasted a scuffed version so I apologise. I figured you'd get the gist of what I was doing and might have a suggestion
When the first sensor is triggered by the head of the ram it should reverse direction until it hits the second sensor and reverse again. However as far as I can tell the sensor resets as soon as the ram moves away from it and so does the output which triggers it to reverse. This causes the ram to just move back and forth into and out of the range of the first sensor.
Ah,I had been trying to use an output to disable one of the sensors, but for obvious reasons that didn't work. I don't know why I didn't think of using a line with boolean. Thanks for that, I'll try and give that a run through tomorrow and tidy up some of the scruff.... Cheers for the help