Add check when resetting bRestoreOnStartup flag to only reset
if the UPS is OK. Otherwise during a power loss it is set and then reset before
getting to the end of the PLC cycle.
This was a result of moving some code that was previously in MAIN to an ACT
and the RETURN command does not work the same. I believe it only returns
from the current act and not the whole code. Originally it was supposed to
prevent the rest of the code from executing in the event of a power failure but
this is no longer the case.
Add CHECK_UPS action to house monitoring of the UPS global status
Modify RESTORE_POSITIONS state machine to remove numerical enumeration
usage
Add device identity functionblock to check whether local simulation or
CX
Add POSITION RECOVERY action to check device type and determine whether
to run
position restore and ups checking
Add solution/_Config/ folder to gitignore to remove NC and IO
It was decided in a code review that mode 2 wasn't doing exactly as we wanted
and that it probably wasn't required, at least for now.
Changes to logic so that the position restore is only done after a power cycle and
not a download, reset cold or reset origin.
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.