Analysis of the problem of requiring the program to be re downloaded during on-site debugging of Online Change
On-site debugging, where engineers modify code while the equipment is in production and operation.This is an occasion where downtime and material costs are significant.
Test content
1 The number of OnlineChange or the impact of code
changes
2 How to shorten the compilation and download time of
OnlineChange
3 How to avoid recompiling and redownloading
3.1 The role of TwinCAT 2's .ci and .ri files
Recommended operation habits to avoid downtime caused
by program download
4 The possibility of downtime caused by Online Change
1. The number of Online Changes or the impact of code
changes
This test did not find any limitations on the number
of Online Changes or the amount of code changes, such as what modifications
were made, that would require a program to be re-downloaded.
When the CPU utilization is above 75%, these Online
Change operations still cannot trigger the The programhas changed!issue.This
includes modifying individual numbers, adding several lines of code, adding
variables, adding arrays, and even adding function blocks.
Due to various tests not being able to reproduce the
issue, the source code of another PLC was imported on top of the original
Pro.After compiling, Login prompted to load the program.The alarm code was
1302, due to referencing a library that had not been referenced in the
controller previously, requiring the download of the complete project.
2 How to shorten the compilation and download time
during Online Change
Usually, the code only requires small changes, but if
the program is slightly larger, it will take time to compile and prepare
symbols before downloading. Modifying the TwinCAT option in the Project Option
can shorten this time:
Change the default Symbol download option from Dynamic
Symbols to Static Symbols, and uncheck all the ticked options.In order not to
affect other devices communicating with PLC, the default settings can be
restored when the first download and final debugging are completed.
3. How to avoid downtime caused by program
re-downloading
3.1 The role of TwinCAT 2's .ci and .ri files
This test found a correlation between the intermediate
files.ri and.ci and the recompilation and download issues of the program.The
preferred timing of the generation and refreshing of the TwinCAT 2.ci and.ri
files, as well as their respective roles.
Therefore, the basic principle for avoiding program
download alarms is to maintain the mutual matching of .pro, .ci, .ri, and
TCPLC_P_x.wbp.
3.2 Recommended operating habits to avoid downtime
caused by program downloads
Usually, the code and path in the controller will not
change, only the files on the programming computer side will change.For backup
purposes, renaming, saving as, and debugging on a different computer are all
possible.When logging in again, a warning may appear saying "The program
has changed! Download the program?".If you choose to download, the PLC
program will definitely stop, and if you choose not to download, you will not
be able to log in to continue debugging.
To avoid this problem, the recommended operation is as
follows:
When making backups during on-site debugging, do not
use Save As, but instead copy the current file and rename the backup by
date.This is to ensure that all intermediate files remain available.
When changing computers or debugging, it is necessary
to copy the entire folder, especially the.pro, .ci, and.ri files.
When archiving a project, the .pro, .ci, .ri, and
TCPLC_P_x.wbp files should be consistently kept in the latest version.The
recommended practice is to perform the following steps before finishing the
work: Login - Create Boot Project - Save.Then, back up the entire project
folder on the programming PC;also back up the entire \TwinCAT\Boot folder on
the controller.
4 The possibility of downtime caused by Online Change
Previously, a customer reported that when debugging
on-site, changing a small amount of code in Online Change would cause the PLC
to stop, while the CPU configuration was low and the CPU utilization was high.In
order to further analyze the cause of this issue, please confirm the following
three points when reporting such issues based on the previous description:
Confirm that the PLC program on the programming
computer has not been renamed or relocated, and that the ri and ci files have
not been moved or deleted;
Confirm that TwinCAT has been set to Static Symbol in
Project| Option of TwinCAT PLC Control and uncheck all Global and Local
options;
Switch to another computer and retry the operation to
rule out any problems with the programming computer itself
If the problem persists, please provide CPU
utilization and controller model and report the issue to Beckhoff engineers.