A controller for controlling a valve is disclosed including a manifold assembly, a valve position indicator and a trigger assembly. An operating media distribution system is disposed in the manifold assembly and an electronic control unit is disposed in the controller. The electronic control unit operates at least one electromagnetic valve to control operating media flow via the operating media distribution system to activate an actuator which opens or closes the valve. The trigger assembly includes a cylinder adapted to receive an actuator shaft and provide a self setting mechanism corresponding to the stroke length of the actuator shaft.