Sharing global variable between multiple tasks

pacijent
✭✭
in RobotStudio
Hello to all, I would need some help regarding rapid programming. If we have two or more tasks how can we share some bool variable between them, where to declare them, since they are visible only in task in which they are created. Thanks in advance.
0
Comments
-
Hi Pacijent,I think if you declare it like:PERS BOOL yourName := FALSE;In your main task and like:PERS BOOL yourName;In all the other task, it should be the same value across all tasks.Hope it will workRegards, LarsLars Glud
Danrob A/S1 -
Thanks a lot Lars, that works
.
0 -
It does not seems to work with a clock.
0 -
Persistent declaration is not allowed in routine"error
0 -
You need to declare PERS out of the routine, as a global, in all the tasks you want to share with. That works fine.
Un saludo, kind regards,
Daniel Aguilar
Automation Engineering
0
Categories
- All Categories
- 5.6K RobotStudio
- 399 UpFeed
- 20 Tutorials
- 14 RobotApps
- 300 PowerPacs
- 406 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 336 IRC5
- 67 OmniCore
- 8 RCS (Realistic Controller Simulation)
- 828 RAPID Programming
- 12 AppStudio
- 4 RobotStudio AR Viewer
- 19 Wizard Easy Programming
- 107 Collaborative Robots
- 5 Job listings