Technical FAQs

Ask a Question

How do you change a standard variable to a remanent variable in SoMachine?



Note: M238 and XBTGC use an internal battery. So in this case remanent variables are retained only if the internal battery is sufficient. M258/LMC058/ATV use flash technology and hence the remanent variables do not depend on the battery life.

The declaration of these remanent variables are made as below.

VAR RETAIN
RET1:INT;
END_VAR

Persistent variables however have to be declared in a different way. They have to be declared on a special list, called Persistent Variables as they are related to the hardware being used.

Right-click on Application and select Persistent variables. The persistent variables need to be declared there. They will need to be on that list.


VAR GLOBAL PERSISTENT
RET2 INT;
END_VAR

VAR GLOBAL PERSISTENT RETAIN
RET3:INT;
END VAR

Was this helpful?
What can we do to improve the information ?