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?
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…
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.