Definition
tp_get_user_input(message, input_type)
Features
This function receives the user input data through the Teach Pendant.
Parameters
|
Parameter Name |
Data Type |
Default Value |
Description |
|---|---|---|---|
|
message |
string |
- |
Character string message to be displayed on the TP user input window
|
|
input_type |
int |
- |
TP user input message type
|
Return
|
Value |
Description |
|---|---|
|
User input data |
User input data received from the TP |
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
q1 = posj(10, 10, 10, 10, 10, 10)
q2 = posj(20, 20, 20, 20, 20, 20)
q3 = posj(30, 30, 30, 30, 30, 30)
q4 = posj(40, 40, 40, 40, 40, 40)
q5 = posj(50, 50, 50, 50, 50, 50)
q6 = posj(60, 60, 60, 60, 60, 60)
int_y= tp_get_user_input("message1", input_type= DR_VAR_INT)
if int_y==1: # Moves to q1 if the TP user input is 1.
movej(q1, vel=30, acc=30)
else: # Moves to q2 if the TP user input is not 1.
movej(q2, vel=30, acc=30)
float_y= tp_get_user_input("message2", input_type= DR_VAR_FLOAT)
if float_y==3.14: # Moves to q3 if the TP user input is 3.14.
movej(q3, vel=30, acc=30)
else: # Moves to q4 if the TP user input is not 3.14.
movej(q4, vel=30, acc=30)
str_y= tp_get_user_input("message3", input_type= DR_VAR_STR)
if str_y=="a": # Moves to q5 if the TP user input is "a".
movej(q5, vel=30, acc=30)
else: # Moves to q6 if the TP user input is not "a".
movej(q6, vel=30, acc=30)
bool_y= tp_get_user_input("message3", input_type= DR_VAR_BOOL)
if bool_y==True: # Moves to q5 if the TP user input is "True or 1".
movej(q5, vel=30, acc=30)
else: # Moves to q6 if the TP user input is "False or 0"
movej(q6, vel=30, acc=30)
Keyword
tp / tp_ / tp_get / user_input / get_user_input