Danger for user and machinery
When downloading changes with connected periphery, programming errors may present a danger for both users and machinery.
You can download small program changes into the CPU in online mode without having to switch to PROG mode. However, the following restrictions apply:
The PLC configuration must not have been changed.
Use
to switch to offline modeMake program changes
Use
to switch to online modeYou will be asked to compile the project. You can cancel the process if the compilation was not successful.
The dialog Download project to PLC appears. Here you can choose to download the complete project or only the program code differences to the PLC in RUN mode.
The program is compiled and then downloaded to the PLC. A message will confirm the successful completion of the changes.
Restrictions:
For FP3, FP5, FP10, FP10SH, FP2, FP2SH, FP0, FPe, FPS (12K, 16K), FPxLowCost, FPX0: Program code changes may not exceed the number of steps which can be downloaded during one scan (128 steps). Therefore, make small changes only or spread out the changes in small bits.
For all other PLCs: The entire program code will be downloaded. This may take several scans. The PLC switches to the new program after the download has been completed.
For FP2SH (120K), FP10SH (120K): The programs in the task Programs 2 are downloaded in a separate second step. If the changes affect programs in both of the two tasks Programs 1 and Programs 2, the PLC maybe in an inconsistent state between the downloads.
For FP7, ELC500: The program in the task Periodic interrupt is downloaded in a separate second step. If the changes affect programs in both of the two tasks Programs and Periodic interrupt, the PLC maybe in an inconsistent state between the downloads.
For FP7, ELC500: If you need to change the maximum number of program steps for periodic interrupt (see Compile options), the changed program code capacity cannot be downloaded to the PLC in RUN mode.
Data of the Configurator PMX are not downloaded in RUN mode.
The project will be compiled with the variable address information from the latest download of the project.
With this variable address information, the addresses of existing variables are kept, and the addresses of deleted variables are freed.
New variables will be assigned one of the free addresses and are initialized with their initial values.
Variables with changes in declaration class, data type, element order, or element number are deleted, and a new variable with the same name is added. The new variable is initialized.
Variables which have been renamed are deleted, and a new variable with the new name is added. The new variable is initialized.
Variables with explicit user addresses will additionally be treated as changed variables if the explicit user address is changed, but are not initialized.
Changes in a DUT type declaration will lead to the change of all its instance variables as the data types of the instance variables have been changed. All instance variables are deleted and added as new variables. The newly added variables are initialized.
Changes in an FB declaration are handled in a different way than DUT type declarations. While DUT instances are deleted and re-created, all function block instances are kept and their variables are updated, e.g. added, modified, or deleted as appropriate.
Changes to the initial values of variables are not detected.
To clear the variable address information, use
.If new variables have been added, the program may be downloaded in two steps. The system variable sys_bIsFirstScanAfterDownloadChangesDuringRun will be set to TRUE for two times. However, after the first time sys_bIsFirstScanAfterDownloadChangesDuringRun is set to TRUE, the final program will already be running on the PLC.
If the process of downloading changes to the PLC is interrupted due to power failure or an operation error, the program code on the PLC will be in an inconsistent state. After power up or clearing the operation error, download the complete program again with Download program code and PLC configuration to PLC.
When you want to update SFC programs by downloading program code changes and a changed step structure, it is recommended to program the SFC program together with SFC control instructions (e.g. StartStopSFC) and stop the SFC before downloading any program code changes.
SFC steps including step number and step flag are treated like variables i.e., they keep their addresses and states unless they are renamed or deleted.
Before you download SFC program with deleted steps, you must ensure that the following conditions are met:
The machine is not in the step you want to delete.
There are no active steps that lead to or from the step you want to delete.
Deleting steps when the conditions are not met could set the complete SFC to an unknown state and may even require a restart of the PLC!
Adding steps may also be very critical when the structure of the SFC changes and parallel processing (left or right divergences) is added to the currently active steps or jumps, and labels are inserted around the currently active step. We recommend to set the SFC program of the machine into a state where the process is not affected, e.g., in the initial state.
Make sure that the program differences do not affect currently running processes (such as state machines, SFCs, positioning, etc.) and that your machine is in a safe state for the download.
The download of the program code changes can only be started with a button from the dialog Download project to PLC. The button starting the download shows possible errors, warnings, and hints as texts. Please check the texts on the button carefully.