Changing initial value of persistent variable without restarting the System
Hi everybody,
when I change the initial value of persistent variables such as workobjects in RS, they are not updatet until I restart the controller (using the "apply" button does not work).
Is there an easier way to update the initial values?
Cheers
Kris
when I change the initial value of persistent variables such as workobjects in RS, they are not updatet until I restart the controller (using the "apply" button does not work).
Is there an easier way to update the initial values?
Cheers
Kris
0
Comments
-
Hi,one way to update the value of persistent variable is to run program code in which new value is assigned to the variable.PERS num nTest:=1;
PROC Temp()
nTest:=2;
stop;
ENDPROC
0 -
Have you tried right click -> refresh as below?
0 -
Sorry for the late reply and thanks for the two suggestions, both of which work great!In my case, however, the problem was that the persistent variables were defined in two different tasks, where they were both assigned a value. So obviously the variables were not updated, even though I changed them using FlexPendant...Best RegardsKris0
-
The Multitasking manual states:
A persistent variable is global in all tasks where it is declared.
The persistent variable must be declared as the same type and size (array dimension) in all tasks. Otherwise a runtime error will occur.
It is sufficient to specify an initial value for the persistent variable in one task. If initial values are specified in several tasks, only the initial value of the first module to load will be used.
So as long as the above is followed the value of the variable will change in all tasks - in RobotStudio you will probably have to refresh each task to see it update.
0
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)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings