Skip to main content
Skip table of contents

wait_analog_input(ch, condition, val, timeout=None)

Features

It waits until the signal value of the analog input channel of the controller becomes val (float value). The wait time can be changed with the timeout setting, and the result is returned as soon as the wait state ends after the specified amount of time has elapsed. However, if timeout is not set, it will wait indefinitely.

Parameters

Parameter NameData TypeDefault ValueDescription

ch

int

-

1 : channel 1

2 : channel 2

condition

int

-

Analog value comparison condition

  • DR_ANALOG_CONDITION_UPPER: 0
    • Wait until the received analog input is greater than or equal to the val parameter.
  • DR_ANALOG_CONDITION_LOWER : 1
    • Wait until the received analog input is less than or equal to the val parameter
valfloat-
  • current mode : 4.00 ~ 20.00(mA)
  • voltage mode : 0.00 ~ 10.00(V)
timeoutfloatNone

waiting time [sec]

If not set, wait indefinitely


Return

ValueDescription

0

Success

-1

Failed(time-out)

Exception

ExceptionDescription

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

PY
wait_analog_input(1, DR_ANALOG_CONDITION_UPPER, 5.0, 4) ## Wait until analog data received through ch 1 is equal to or greater than 5.0
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.