Can the time being counted down in a WaitTime comand be displayed on the teach pendent?
I have several programs that have WaitTimes within them and my boss has asked if the time can be displayed. I do not know how to progran this.
Best Answer
-
I have created a procedure that prints out the remaining waiting time on the FlexPendant. Perhaps you can use it as a starting point.
Here is the source code.
MODULE WaitTimeModule
PROC TPWaitTime(num waitingTime)
CONST num timeStep:=0.2;
VAR num currentTimeStep;
VAR num timeLeft:=0;
VAR string displayString;! Initialization;
displayString:="Executing WaitTime "+NumToStr(waitingTime,1)+": Time left : ";
timeLeft:=waitingTime;WHILE timeLeft>0 DO
IF timeLeft<timeStep THEN
! Check if the remaining time is smaller than the time step
currentTimeStep:=timeLeft;
timeLeft:=0;
ELSE
! Remaining time is larger than time step.
Add timeLeft,-timeStep;
currentTimeStep:=timeStep;
ENDIF
TPErase;
TPWrite displayString+NumToStr(timeLeft + currentTimeStep,1);
WaitTime currentTimeStep;
ENDWHILE
TPErase;
TPWrite "WaitTime completed";
ENDPROCPROC main()
TPWaitTime 5;
ENDPROC
ENDMODULEPost edited by Henrik Berlin onHenrik Berlin
ABB0
Answers
-
Thanks. I will give this a try and see what happens.
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings