In some cases need to perform a cold restart or IO reconfiguration which leads to IO status lost especially the outputs status, is there any method to restore them quickly? Store the status in the hard drive before and retrieve them again? Is this possible?
Digital IO restoration
-
Sakya -
April 22, 2016 at 10:51 AM -
Thread is marked as Resolved.
-
-
use *.dat to store theri value.
-
You can initialize the outputs you want in submit interpreter declaration section. Or, you can declare variables in config.dat file with a value assignment. For example, DECL INT MY_INTEGER=0. So after the cold restart, the variable will retain its value to the last assigned value before the restart.
I hope it helps you.
Thanks
-
use *.dat to store theri value.
Can you give an example? -
sorry for the answer, it is not possible store output's values in the *.dat . I tested just now.
please consider @RS 's solution .
-
You can initialize the outputs you want in submit interpreter declaration section. Or, you can declare variables in config.dat file with a value assignment. For example, DECL INT MY_INTEGER=0. So after the cold restart, the variable will retain its value to the last assigned value before the restart.I hope it helps you.
Thanks
Maybe I didn't explain my point well, I mean the digital outputs of the symbol table, e.g. $OUT[1]... -
Maybe I didn't explain my point well, I mean the digital outputs of the symbol table, e.g. $OUT[1]...Ok, for OUT, you need to initialize them in submit interpreter in the declaration section. You can give whatever values they should have after the cold restart.
-
Ok, for OUT, you need to initialize them in submit interpreter in the declaration section. You can give whatever values they should have after the cold restart.
Hello RS, perhaps not every time the robot is in home, e.g. the robot is running a subprogram and several IO status has been changed, is that possible to restore them right at that moment, the IO status may depends on where the robot program stops -
May be its a weird idea but I thought it for quite sometime and partially implemented it in one of my projects....
You can create some bools in config.dat like:
Now in your programs, you can set these bools instead of directly using OUTs. And in submit, create a sub-program setting the respective Outputs to the values of these bools and you can do the same in declaration section and call the sub-program in a loop statement like:
Code
Display More;FOLD DECLARATIONS ;FOLD BASISTECH DECL ;Automatik extern DECL STATE_T STAT DECL MODUS_T MODE ;ENDFOLD (BASISTECH DECL) ;FOLD USER DECL ;----------Variables Declaration-------- OUT[1]=MY_BOOL1 OUT[2]=MY_BOOL2 OUT[3]=MY_BOOL3 ;ENDFOLD (USER DECL) ;ENDFOLD (DECLARATIONS) ;------------------------------------------------------------------------------------- LOOP ;FOLD USER PLC OUTPUTS_VALIDATION ( ) ;ENDFOLD (USER PLC) ENDLOOP ;---------------------------- DEF OUTPUTS_VALIDATION ( ) OUT[1]=MY_BOOL1 OUT[2]=MY_BOOL2 OUT[3]=MY_BOOL3 ... END
Thus, the sub-program will assign the values to your outputs whatever values your internal bools will hold but there may be a little lag because of sps scan cycle. Also, you have to be smart and call this sub-program as a last function in the loop because these are outputs and should be set after all the processing is done.
The declaration section will help you to reinitialize the outputs to the last values held by your internal bools before the controller restart. In this way, I hope you will be able to retain the values of outputs in case of a controller restart.
The only shortcoming to this approach, as I can see, is the scan cycle of submit interpreter which would be 4 ms or 12, whatever is set, depending on the size of your sps code. It may be that the actual outputs will be set after this short delay.
Our experts may share some more light on this approach.
Good Luck.