Skip to main content
Skip table of contents

get_analog_input(ch)

Features

This function reads the channel value corresponding to the controller analog input.

Parameters

Parameter NameData TypeDefault ValueDescription

ch

int

-

  • 1 : channel 1
  • 2 : channel 2

Return

ValueDescription

float

The analog input value of the specified channel

  • Current mode: 4.0~20.0 [mA]
  • Voltage mode: 0~10.0 [V]

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
set_mode_analog_input(ch=1, mod=DR_ANALOG_CURRENT)  #input ch1=current mode
set_mode_analog_input(ch=2, mod=DR_ANALOG_VOLTAGE)  #input ch2=voltage mode

Cur = get_analog_input(1)  # Reads the analog input current value of channel 1
Vol = get_analog_input(2)  # Reads the analog input voltage value of channel 2
JavaScript errors detected

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

If this problem persists, please contact our support.