Bypassing I/O wait

  • Hello,


    Wondering if anyone has a simple way without using Karel to bypass a wait for a digital input signal if an operation times out. I would like to wait for a certain amount of time to receive the signal. If the signal is not received within that time I would like to jump to a lbl in the program. I'm probably overlooking something simple but I haven't come up with anything.


    Thanks,


    Craig

  • No need for KAREL, TP supports this:

    Code
     $WAITTMOUT=150 ;
     WAIT RI[1]=ON TIMEOUT,LBL[100] ;

    IIRC, the $WAITTMOUT variable is set in 0.01sec, so that "150" would be 1.5sec. You'll need to set it to the value you want in your program. The TIMEOUT is a standard option of the WAIT command. If the timeout, er, "times out" before the WAIT condition is satisfied (RI 1 in this example), then the program will jump to LBL 100.

  • No need for KAREL, TP supports this:

    Code
     $WAITTMOUT=150 ;
     WAIT RI[1]=ON TIMEOUT,LBL[100] ;

    IIRC, the $WAITTMOUT variable is set in 0.1sec, so that "150" would be 15sec. You'll need to set it to the value you want in your program. The TIMEOUT is a standard option of the WAIT command. If the timeout, er, "times out" before the WAIT condition is satisfied (RI 1 in this example), then the program will jump to LBL 100.

    Are sure about the 15 sec?

    May I'm wrong but I think 150 = 1,5 sec

Advertising from our partners