Skip to main content
Skip table of contents

get_input(port_type, index)

기능

컨트롤러/플랜지의 디지털/아날로그 접점에서 수신 된 신호를 확인하기 위한 명령어입니다.

주의

현재 플랜지 보드 버전 및 로봇 모델에 따라 파라미터가 변경될 수 있습니다. 매뉴얼 숙지 바랍니다.

인수

인수명자료형기본값설명

port_type

int

-

명령어를 적용할 포트 타입

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

index

int

-

출력할 I/O의 번호(Analog 출력을 위한 Chnnel 역할도 수행)

  • port_type이 DR_CONTROLLER_DIGITAL일 경우
    • 1 ~ 16
    • -16 ~ -1(val이 None일 경우) : 양수는 ON / 음수는 OFF
  • port_type이 DR_FLANGE_DIGITAL일 경우
    • 구 플랜지 M/H 모델의 경우
      • 1 ~ 6
      • -6 ~ -1(val이 None일 경우) : 양수는 ON / 음수는 OFF
    • 구 플랜지 / 신규 플랜지 A 모델일 경우
      • 1 ~ 2
      • -2 ~ -1(val이 None일 경우) : 양수는 ON / 음수는 OFF
    • 신규 플랜지 M/H 모델의 경우
      • 1 ~ 4
      • -4 ~ -1(val이 None일 경우) : 양수는 ON / 음수는 OFF
  • port_type이 DR_CONTROLLER_ANALOG 일 경우
    • 1 ~ 2(channel)
  • port_type이 DR_FLANGE_ANALOG일 경우(신규 플랜지에서만 사용 가능)
    • 1 ~ 2(A 모델일 경우)
    • 1 ~ 4(M/H 모델일 경우)


리턴

설명
1

(디지털)

ON

0

(디지털)

OFF

float

(아날로그)

전류 모드인 경우 4.0 ~ 20.0(mA)

전압 모드인 경우 0.0 ~ 10.0(V)

음수값

실패

예외

예외설명

DR_Error (DR_ERROR_TYPE)

인수들의 데이터형 오류 시

DR_Error (DR_ERROR_VALUE)

인수의 값이 유효하지 않을 시

DR_Error (DR_ERROR_RUNTIME)

C Extension 모듈 에러 발생 시

DR_Error (DR_ERROR_STOP)

프로그램 강제 종료 시

예제

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.