정의
set_mode_tool_analog_input(ch, mod)
기능
티치펜던트에 등록된 Tool Analog Input의 지정된 채널에 속성을 설정 합니다.
인수
|
인수명 |
자료형 |
기본값 |
설명 |
|---|---|---|---|
|
ch |
integer |
- |
Tool Analog Input 채널 번호
|
|
mod |
integer |
- |
Tool Analog Input 속성 0: 전류 모드 1: 전압 모드 |
리턴
|
값 |
설명 |
|---|---|
|
0 |
성공 |
|
음수값 |
오류 |
예외
|
예외 |
설명 |
|---|---|
|
DR_Error (DR_ERROR_TYPE) |
인수들의 데이터형 오류 시 |
|
DR_Error (DR_ERROR_VALUE) |
인수의 값이 유효하지 않을 시 |
|
DR_Error (DR_ERROR_RUNTIME) |
C Extension 모듈 에러 발생 시 |
|
DR_Error (DR_ERROR_STOP) |
프로그램 강제 종료 시 |
예제
Python
TOOL_CURRENT = 0
TOOL_VOLTAGE = 1
channel = 1
mode = TOOL_VOLTAGE
val = set_mode_tool_analog_input (ch=channel, mod=mode)
if val < 0:
tp_log("set_mode_tool_analog_input error: " + str(val))
else:
val = get_tool_analog_input(ch=channel)
if val < 0:
tp_log("get_tool_analog_input error: " + str(val))
else:
tp_log("get_tool_analog_input ch[" + str(channel) + "]: " + str(val))
if mode == TOOL_VOLTAGE:
tp_log(" V")
elif mode == TOOL_CURRENT:
tp_log(" mA")