How can I retain the value of configuration parameter for the function blocks for example PID during application download in Unity Pro
Using Unity Pro whenever you transfer project in PLC it will erase all the data in PLC and download new application and data from PC.
If you want to retain certain data in PLC for example function block configuration parameters then there are following methods.
1. Before Downloading new application in PLC. Connect PLC with Unity Pro (do not perform Transfer)
2. When Unity Pro is connected to PLC, go to PLC option and select the option Save Data from PLC to File.
3. Select the data value you want to save and click on browse button to put the file name and location to save the data. Make sure you save the file in DTX format.
4. After successfully save the data. You can now transfer new application into the PLC.
5. Before putting the application into Run Mode, again go to PLC option and select the option Restore Data from File to PLC.
6. Select the file location saved earlier and press ok. It will save data from File to PLC with all the previous data.
7. Now you can run the PLC and PLC will have previously saved data.
Create the variable which you want to use PID and in Elementary Variable table under Value field put whatever value you want to have as initialization value. So whenever PLC will get a cold restart or restart after application download it will have that value.
You can use Operate block and move the value in variable for ex you have assigned para_pid variable to PARA input of PIDFF then in Operate instruction you can write para_pid.out_inf:=100.0 to put the value or Out_Inf or Pidff to 100.0.
It will always have the same value not matter you download the application or Power cycle the PLC.