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.6K RobotStudio
- 399 UpFeed
- 20 Tutorials
- 14 RobotApps
- 301 PowerPacs
- 406 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 338 IRC5
- 67 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 832 RAPID Programming
- 14 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 107 Collaborative Robots
- 5 Job listings