Skip to main content
Skip table of contents

get_input(port_type, index)

Features

This function sends a signal at the digital / analog contact point of the controller / flange. 

Caution

Depending on the current flange board version and robot model, the parameters may change. Please familiarize yourself with the manual.


Parameters

Parameter NameData TypeDefault ValueDescription
port_typeint-

type of contact point

  • DR_CONTROLLER_DIGITAL : 0
  • DR_FLANGE_DIGITAL : 1
  • DR_CONTROLLER_ANALOG : 2
  • DR_CONTROLLER_FLANGE : 3

index

int

-

I/O contact number mounted on the controller(It also serves as a Chnnel for the Analog output)

  • when the port_type is DR_CONTROLLER_DIGITAL
    • Val argument existing: A number between 1 and 16
    • No val argument: 1 ~ 16 , -1 ~ -16(A positive number means ON while a negative number means OFF.)
  • when the port_type is DR_FLANGE_DIGITAL
    • when the model of robot is M/H with old flange
      • Val argument existing: A number between 1 and 6
      • No val argument: 1 ~ 6 , -1 ~ -6(A positive number means ON while a negative number means OFF.)
    • when the model of robot is A
      • Val argument existing: A number between 1 and 2
      • No val argument: 1 ~ 2 , -1 ~ -2(A positive number means ON while a negative number means OFF.)
    • when the model of robot is M/H with new flange
      • Val argument existing: A number between 1 and 4
      • No val argument: 1 ~ 4, -1 ~ -4(A positive number means ON while a negative number means OFF.)
  • when the port_type is DR_CONTROLLER_ANALOG
    • 1 ~ 2(channel)
  • when the port_type is DR_FLANGE_ANALOG(Only available on new flanges)
    • 1 ~ 2(A model)
    • 1 ~ 4(M/H model)


Note

If val is omitted, positive numbers become ON and negative numbers become OFF depending on the sign (+/-) of the index.

Return

ValueDescription

1

(Digital)

ON

0

(Digital)

OFF

float

(Analog)

Current mode : 4.0 ~ 20.0(mA)

Voltage mode : 0.0 ~ 10.0(V)

Negative value

Failed

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
res1 = get_input(0, 1) ## get_digital_input(1)
res2 = get_input(2, 1) ## get_analog_input(1)
res3 = get_input(3, 1) ## get_tool_analog_input(1)
JavaScript errors detected

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

If this problem persists, please contact our support.