Change to MAIN.RESTORE_POSITIONS and MAIN.STORE_PERSISTENT
Bug fix: add check in MAIN.RESTORE_POSITIONS to check whether
an axis was moving at shutdown.
Variable name changes to acommodate moving the persistent variables
from MAIN to a DUT in the generic structure.
Added a check in MAIN.SHUTDOWN that makes sure the restore has been
done first before starting to save values again.
Probably should change the name from MAIN.SHUTDOWN to MAIN.SAVEVALUES or something.
This created a problem in that MAIN.STARTUP wasn't working correctly
because it takes a couple of cycles to complete and MAIN.SHUTDOWN
was overriding the values stored after a power loss. Thus the restore won't work
for a user cold reset. It can be catered for by adding it back into the ordinary PLC
cycle but only executing if bPositionRestoreDone is set.
gvl.axes[i].Axis.Status.Moving doesn't seem to work if the axis isn't enabled.
Therefore added a check to see whether gvl.axes[i].Axis.NcToPlc.ActVelo <> 0.
If it's non-zero then don't restore the encoder value on restart.
MAIN.SHUTDOWN also added to the normal operation cycle, this is to allow restart
after a "Reset Cold" command in Visual Studio, otherwise the only time position is
restored is an actual lose of power. It might be also useful when a user restarts
the PLC program manually.
Also modified a few comments in MAIN.STARTUP.
Motivation: after the position restore code has executed successfully
there is no point running any of the code again and wasting PLC cycles.
Thus the first step in the MAIN.STARTUP is a check whether the code has
been completed or not. If it is has completed successfully ignore everything else.
No longer required in the restore position state machine code.
If the read parameter function block isn't successful it will go back
a set in the case statement and try again.
The read parameter function block, fbReadEncRefSys, reads the type of axis
either inc or abs.
"The 4024 release apparently shipped with the 4023.119
internal build for engineering"
It seems as if the *.Tc* files ue a different version numbering than
the *.tsproj files.
Adapt twincat_version_manager.py to handle different versions
for different file types (technically file names) and
check that the *.tsproj file have version "3.1.4023.119"