Choose speeddata
Hi,
i'm a mechatronics student and i'm learning robotstudio and rapid programming.
I have a question: i would develop a interface command that allow to choose the speed of the movemente
I have a problem, there are an error when i declare the speeeddata, in particular with the speedata vel_con_pezzo,
what is the cause? is the variabile v?
Waiting for a reply,
best regards
Edoardo
i'm a mechatronics student and i'm learning robotstudio and rapid programming.
I have a question: i would develop a interface command that allow to choose the speed of the movemente
I have a problem, there are an error when i declare the speeeddata, in particular with the speedata vel_con_pezzo,
what is the cause? is the variabile v?
Waiting for a reply,
best regards
Edoardo
<div> ! DEFINIZIONE VELOCITA' PERS num v; PERS speeddata vel_avuoto:=[200,200,0,0]; PERS speeddata vel_conpezzo:=[v,v,0,0]; CONST listitem elenco{3} := [ ["","50"], ["","100"],["","200"] ]; VAR num list_item; VAR btnres button_answer; PROC selezioneVelocita()</div><div> list_item := UIListView (\Result:=button_answer\Header:="Selezione velocita",elenco\Buttons:=btnOKCancel\Icon:=iconInfo\DefaultIndex:=1);</div><div> IF button_answer = resOK THEN</div><div> IF list_item = 1 THEN</div><div> v:=50;</div><div> ELSEIF list_item = 2 THEN</div><div> v:=100;</div><div> ELSEIF list_item = 3 THEN</div><div> v:=200;</div><div> ENDIF</div><div> ELSE</div><div> ! User has select Cancel</div><div> ENDIF</div><div> ENDPROC</div>
0
Comments
-
Hello,Your PERS variables have to be initialized with a value:
PERS num v:=0;
☑️2024 - RobotStudio® User Group1 -
Hi,in my understanding you cannot declare data using another data. Instead of trying to declare vel_conpezzo.v_tcp and vel_conpezzo.v_ori using another variable v, you can reassign these values in the program code.! DEFINIZIONE VELOCITA'
PERS num v;
PERS speeddata vel_avuoto:=[200,200,0,0];
PERS speeddata vel_conpezzo:=[0,0,0,0];
CONST listitem elenco{3}:=[["","50"],["","100"],["","200"]];
VAR num list_item;
VAR btnres button_answer;
PROC selezioneVelocita()
list_item:=UIListView(\Result:=button_answer\Header:="Selezione velocita",elenco\Buttons:=btnOKCancel\Icon:=iconInfo\DefaultIndex:=1);
IF button_answer=resOK THEN
IF list_item=1 THEN
v:=50;
ELSEIF list_item=2 THEN
v:=100;
ELSEIF list_item=3 THEN
v:=200;
ENDIF
! reassign two values of vel_conpezzo
vel_conpezzo.v_tcp:=v;
vel_conpezzo.v_ori:=v;
ELSE
! User has select Cancel
ENDIF
ENDPROChopefully this helps!-Jeppe
1 -
Another way for your consideration is to use UINum or TPReadNum to allow the user to input using the numeric keypad. Also, there is an instruction SpeedRefresh to allo speeding up or slowing down an ongoing movement if you use it with an interrupt.Lee Justice1
-
edorobot said:Hi,
i'm a mechatronics student and i'm learning robotstudio and rapid programming.
I have a question: i would develop a interface command that allow to choose the speed of the movemente
I have a problem, there are an error when i declare the speeeddata, in particular with the speedata vel_con_pezzo,
what is the cause? is the variabile v?
Waiting for a reply,
best regards
Edoardo
Please give feedback !! speed definitionsPERS speeddata vEmpty:=[200,500,1000,5000];PERS speeddata vWithPart:=[0,500,1000,5000];CONST listitem lstSpeeds{3}:=[["","50"],["","100"],["","200"]];VAR num noChoice;VAR bool bOk;VAR string strValue;VAR btnres button_answer;PROC selezioneVelocita()! Show the differetns choices! In this case, likelemster has said, you can use UINumEntry with a respond directly as numnoChoice:=UIListView(\Result:=button_answer\Header:="Please select a speed",lstSpeeds\Buttons:=btnOKCancel\Icon:=iconInfo\DefaultIndex:=1);IF button_answer=resOK THEN! Convert the text from list to a value! and store this value inside the v_tcp speed.bOk:=StrToVal(lstSpeeds{noChoice}.text,vWithPart.v_tcp);ELSE! User has select Cancel! Default valuevWithPart:=vEmpty;ENDIFENDPROC
Note : I have translate all data in english1 -
Hi to all,
thank you very much for the support.
Now i would try all replies.
Have a nice day and good work
Edoardo0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 799 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings