thank you very much for your help Jim, the vi you made was far better than mine. Iam looking foward (if you dont mind) to ask you in case I come across any other problem.
about the state machines, I do not know much about them, I though the sequence structures were good enough.
I have to admit there are many things I need to learn, sometimes I see a piece of code (VI) from one of you guys here in the forum, and there are cases where i keep finding new things, which make me spend so much energy even trying to figure out what they are.
I followed you advise and downloaded the JKI State Machine software and installed, the video on it looks good.
Once again thanks for the help
regards
Pedro E.