Definition
set_mode_tool_analog_input(ch, mod)
Features
Set of activated tool analog input's mode in the Teach Pendant.
Parameters
|
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
|
ch |
integer |
- |
The channel number of Tool Analog Input
|
|
mod |
integer |
- |
The mode of Tool Analog Input 0: Current mode 1: Voltage mode |
Return
|
Value |
Description |
|---|---|
|
0 |
Success |
|
Negative value |
Error |
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
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")