I would like to try to better understand how persistent variables work.
I created some boolean variables in the PersistentVars section initialized to the value TRUE.
I have tied these boolean variables to toggle switches placed inside the HMI interface pages.
Once the PLC program is started, the lever selectors, if operated, change their state, at least at a graphical level, but the persistent variables do not undergo any variation.
Initially the above variables were declared as simple global variables, in this case the operation with the levers was correct; I then tried to transform them into persistent ones with the aim of using them as "settings saver"
Thank you for support
Bye
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Bonjour,
est-ce que les espaces de noms des variables sont bien indiqu dans les commutateurs ?
Je viens de faire un petit essai: OK
{attribute 'qualified_only'}
VAR_GLOBAL PERSISTENT RETAIN
xBit1: BOOL:=1;
xbit2: BOOL:=1;
hello everyone
I would like to try to better understand how persistent variables work.
I created some boolean variables in the PersistentVars section initialized to the value TRUE.
I have tied these boolean variables to toggle switches placed inside the HMI interface pages.
Once the PLC program is started, the lever selectors, if operated, change their state, at least at a graphical level, but the persistent variables do not undergo any variation.
Initially the above variables were declared as simple global variables, in this case the operation with the levers was correct; I then tried to transform them into persistent ones with the aim of using them as "settings saver"
Thank you for support
Bye
Bonjour,
est-ce que les espaces de noms des variables sont bien indiqu dans les commutateurs ?
Je viens de faire un petit essai: OK
{attribute 'qualified_only'}
VAR_GLOBAL PERSISTENT RETAIN
xBit1: BOOL:=1;
xbit2: BOOL:=1;
END_VAR
Déclaration de variable dans le commutateur (et aussi dans un voyant pour le test) :PersistentVars.xBit1
Bon développement!