If you need accurate level control with on/off valve then feel free to read about pulse width modulation
But most likely Robb B and robertmee absolutely right.
If current_level > max_level then valve_open_comand = 0
If current_level < min_level then valve_open_comand = 1
in any other case
current_level (current scan) = current_level (previous scan)
Aren't you asking us to do your homework?
Who forces you to use a PID controller?
What will be the PID Output when level of the tank = setpoint ( ie input of the PID = set point to the PID) ?
As I written, steady-state (PV=SP) PID-out = I-term out, it is obvious.
But I suppose your question is formulated as follows:
How is the output value of the PID controller related to the valve position (eg at steady-state)?
Answer:
PID (steady-state) out is a number that, taking into account the “conversion factor,” corresponds to the inflow value that exactly compensates for the outflow.
I would suggest that you think carefully before asking the next question (I suppose I can guess what the question will be)