# Wait timeout on an input

**URL:** <https://forum.universal-robots.com/t/wait-timeout-on-an-input/14352>\
**Category:** URScript\
**Created:** [May 17, 2021, 10:42am UTC](https://forum.universal-robots.com/t/wait-timeout-on-an-input/14352 "2021-05-17T10:42:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.hammerton](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@m.hammerton](https://forum.universal-robots.com/u/m.hammerton)\
**Post date:** [May 17, 2021, 10:42am UTC](https://forum.universal-robots.com/t/wait-timeout-on-an-input/14352/1 "2021-05-17T10:42:56Z")

</div>

As their is no option available in the Polyscope to have a timeout on an Input I’m trying to write a script to do the function  
I’m struggling a little with syntax.  
line 2 gives a syntax error when the program is run.  
however when entered into the main program via Polyscope the syntax looks the same!

def Wait\_Input\_Timeout(DI\_Num,Timeout):  
timer\_1: Reset  
timer\_1: Start  
if get\_standard\_digital\_input[DI\_Num]== False:  
wait timer\_1 == Timeout  
timer\_1: Stop  
return False  
else:  
return True

end

---

<div class="post-metadata">

**Author:** ![anon8732348](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@anon8732348](https://forum.universal-robots.com/u/anon8732348)\
**Post date:** [May 17, 2021, 3:39pm UTC](https://forum.universal-robots.com/t/wait-timeout-on-an-input/14352/2 "2021-05-17T15:39:27Z")

</div>

Create a loop condition for a timeout

`Loop not (input or Timeout = 8)`  
`wait 0.25`  
`Timeout = Timeout +1`
