Variable accessible in multitasking
ko414du4
✭
in RobotStudio
Hello,
I am using multitasking and there are currently 2 tasks in my RAPID code. How can I share a variable declared in 1 task and use it in another? I thought PERS var declared in a module is global but I got Reference Error when I applied the change. Can anyone help please?
Thank you.
0
Best Answer
-
You have to declare the variable in both tasks. For instance:task 1:PERS bool testBool:=TRUE;task 2:PERS bool testBool;5
Answers
-
I had the same problem. Thanks for de solution.
But I have other problem about global variables.
I can't share a variable type SPEEDDATA in two tasks.
I always get a Rapid error.
I have used this code:
Example 1:task 1:PERS speeddata speed:=V1000;task 2:PERS speeddata speed;
Does someone help me?
Is possible to do that?
Thanks a lot
0 -
Hi V1000 is a constant variable declared in the system so you need to
either declare your variable with values or assing them later in the program
Per Svensson
Robotics and Vision Specialist
Consat Engineering1 -
Thank you.
I am going to test it...
0
Categories
- All Categories
- 5.5K RobotStudio
- 395 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