Hey guys, thanks a lot for the all the help. It worked really good after removing the "do...while" structure. Now i'm updating the code with new features for the system, like an automatic and manual mode, valve and working days, trying to make an interaction with the operator. I think it'll look good. Thanks a lot for the help!