3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish
3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish

set_analog_output()

Definition

set_analog_output(ch, val)

Features

This function outputs the channel value corresponding to the controller analog output.

Parameters

Parameter Name

Data Type

Default Value

Description

ch

int

-

  • 1 : channel 1

  • 2 : channel 2

val

float

-

analog output value

  • Current mode: 4.0~20.0 [mA]

  • Voltage mode: 0~10.0 [V]

Return

Value

Description

0

Success

Negative value

Failed

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

Python
set_mode_analog_output(ch=1, mod=DR_ANALOG_CURRENT) #out ch1=current mode
set_mode_analog_output(ch=2, mod=DR_ANALOG_VOLTAGE) #out ch1=voltage mode

set_analog_output(ch=1, val=5.2)   # Outputs 5.2 mA to channel 1
set_analog_output(ch=2, val=10.0)  # Outputs 10V to channel 2

Keyword

set / analog / output / set_analog / analog_output