wait(time)
Features
This function waits for the specified time.
Parameters
Parameter Name | Data Type | Default Value | Description |
---|---|---|---|
Time | Float | - | Time [sec] |
Return
Value | Description |
---|---|
0 | Success |
Negative value | Error |
Exception
Exception | Description |
---|---|
DR_Error (DR_ERROR_TYPE) | Parameter data type error occurred |
DR_Error (DR_ERROR_VALUE) | Parameter value is invalid |
DR_Error (DR_ERROR_RUNTIME) | C extension module error occurred |
DR_Error (DR_ERROR_STOP) | Program terminated forcefully |
Example
wait(1.3) # Waits for 1.3 seconds.
while 1: # Checks contact no. 1 every 0.1 second.
if get_digital_input(1) == ON:
set_digital_output(1, ON)
wait(0.1)