Timer Values in AC500 eco is not getting retained
Dear Sir,
We are using AC500 eco cpu and Wonderware scada, we are communicating them via Modbus TCP. Now there are some timer set points to be given from Scada. The variables are defined as Global retain variables. When PLC is switched off and on, the value of those variables are becoming 0. We want to retain the values after power up. Please help. Thanks is advance.
We are using AC500 eco cpu and Wonderware scada, we are communicating them via Modbus TCP. Now there are some timer set points to be given from Scada. The variables are defined as Global retain variables. When PLC is switched off and on, the value of those variables are becoming 0. We want to retain the values after power up. Please help. Thanks is advance.
Answers
Hi,
First you can try to declare the time variables as RETAIN PERSISTENT, not only retain.
Note that %MW variables could not be retain directly! Make you local variables RETAIN PERSISTENT, and transfer %MW-> retain and retain ->%MW according to your needs.
If that doesn't help, you can try to use %RB / %RW area of the CPU.
It works fine for me for similar case, where I set the variables from HMI by serial communication and %MW variables, and need to keep them in the CPU.
In this case create a code to read from %RB/%RW area only at first cycle of the application, and after that write your values in %RB/%RW area continuously.
Don't forget to declare RB area in the hardware settings of the CPU.
As the time format is not applicable directly for RB/RW, you have to convert time to dword or similar, as you did in your code.
First you can try to declare the time variables as RETAIN PERSISTENT, not only retain.
Note that %MW variables could not be retain directly! Make you local variables RETAIN PERSISTENT, and transfer %MW-> retain and retain ->%MW according to your needs.
If that doesn't help, you can try to use %RB / %RW area of the CPU.
It works fine for me for similar case, where I set the variables from HMI by serial communication and %MW variables, and need to keep them in the CPU.
In this case create a code to read from %RB/%RW area only at first cycle of the application, and after that write your values in %RB/%RW area continuously.
Don't forget to declare RB area in the hardware settings of the CPU.
As the time format is not applicable directly for RB/RW, you have to convert time to dword or similar, as you did in your code.
Add new comment