In a PI (or PID) control loop, the integral part is computed by:
Ki*T*e(k)
where Ki is your constant, T is the control loop sampling period, and e(k) is the current error between your desired and actual output.
e(k) = s(k) - m(k)
where s(k) is the set value and p(k) is the measured value