Synchronizing to controller cycle
mkatliar
✭
Dear colleagues,
I want some code to be executed on each controller cycle. This is what I have in mind:
MODULE SomeModule
PROC MyProc()
WHILE TRUE DO
! do something important
DoSomething;
! here I want to wait until the next controller cycle, how can I do that?
WaitUntilNextControllerCycle;
ENDWHILE
ENDPROC
ENDMODULE
The thing is that I can't find a way in RAPID to wait for the next controller cycle; does it exist?
I could use WaitTime, but then a) it is not synchronized to the controller cycle; b) the time of the WHILE cycle will be equal to the wait interval + the execution time of DoSomething, but I want DoSomething to be executed at regular intervals.
What would you suggest?
I want some code to be executed on each controller cycle. This is what I have in mind:
MODULE SomeModule
PROC MyProc()
WHILE TRUE DO
! do something important
DoSomething;
! here I want to wait until the next controller cycle, how can I do that?
WaitUntilNextControllerCycle;
ENDWHILE
ENDPROC
ENDMODULE
The thing is that I can't find a way in RAPID to wait for the next controller cycle; does it exist?
I could use WaitTime, but then a) it is not synchronized to the controller cycle; b) the time of the WHILE cycle will be equal to the wait interval + the execution time of DoSomething, but I want DoSomething to be executed at regular intervals.
What would you suggest?
Tagged:
0
Comments
-
I don't really understand your question, do you want this to be used as a continiously running proc while the robot is doing something else?If so, is this meant a second task?0
-
VictorAx said:I don't really understand your question, do you want this to be used as a continiously running proc while the robot is doing something else?If so, is this meant a second task?0
-
Then you could do something like this;PROC main()Set StartMonitor; !StartMonitor is configured as a digital outputWaitUntil StartMonitor = 0;DoSomething;ENDPROCPROC Monitor();WaitUntil StartMonitor = 1;Reset StartMonitor;DoSomethingElse;ENDPROC0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 783 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings