Is it common for values in a downloaded DB to be overridden by the "actual" column in the offline DB at the beginning of the PLC cycle? I have several DBs that require downloading, but I am concerned about the values constantly being written into the DB. Will these values be lost for a single cycle or preserved?
Siemens typically operates by downloading blocks without enabling them. The block is stored in memory, similar to the older S5 system. At the end of the program scan, the old block's header or file allocation table is deleted, and the address of the new block is inserted. The memory is then compressed to remove old blocks, similar to how a hard disk functions. However, unlike hard disks where old files remain until purged or overwritten, the old blocks are completely deleted. In earlier S5 systems, these blocks were not deleted, and the memory had to be compressed manually when full. This process may still be in place, allowing for multiple blocks to be transferred in run mode compared to other PLC systems. It is possible that Siemens now has a designated load memory area where blocks are initially downloaded before being moved into the main memory at the end or before the scan.
When downloading a database, the online database will update to match the values of the offline database, potentially causing the loss of previous online values. This means that the PLC program can then overwrite values in the online database. Are you worried about the possibility of values being temporarily lost during this process? Could an HMI display values from the offline project for a brief period? I am more concerned about all online values being reset to match the offline values.
When dealing with PLC programming, it is important to understand how data is managed and stored. In the case of Siemens S5 and S7 PLCs, the process of writing to the database (DB) during the scan cycle differs. While the old S5 model loaded blocks into spare RAM and updated the header with the location of the updated function block (FB) or DB, the newer S7 model may utilize a load memory to prevent issues with code or data replacement while in use. In the early days of PLC programming, memory management was crucial as blocks were not automatically removed after use, leading to potential memory issues. In the case of S5 PLCs, a file allocation table (FAT) structure was used to organize code on disk. This was evident in a critical process scenario involving a printer connected to an S5 155 PLC, where a dedicated DB was created to store critical events in case of printer failure. To prevent memory overload, it was necessary to carefully manage the download process of blocks, ensuring they were loaded in the correct order (DBs, FBs, FCs, OBs). Additionally, the use of relative addressing in code could pose challenges, requiring manual adjustments to jump locations if changes were made to a function block. Overall, understanding the intricacies of PLC programming and memory management is essential for ensuring smooth operation and preventing potential issues in industrial settings.
If you're concerned about whether the database will be locked during STEP7 download, it's similar to an Excel file on a server being locked when someone else is editing it. If this is the situation, then your explanation is spot on.
In Siemens PLC programming, when a block is downloaded in S5, it is saved in spare memory before being allocated to the new block during PLC maintenance. This process involves overwriting the FAT table or compressing the memory to remove old blocks. Similarly, in S7, blocks are loaded into memory before being updated during PLC scans. Although the exact process is not clear, there are various undocumented ways to manipulate programs. One useful technique involves extracting and processing data from DB files in S5 programs. These DB files, which can be quite large, store alarm texts and pointers for displaying on graphic interfaces. By extracting and compiling this data into a configuration file, engineers can quickly update alarm information if the DB files are out of sync. Another experiment involved inputting MC5 codes into a DB to run programs, allowing for the creation of self-modifying code. Overall, while these techniques may be unconventional and time-consuming compared to traditional programming methods, they highlight the flexibility and creativity possible within Siemens PLC systems.
It's indeed common depending on your synchronization and update strategy. If your offline DB is perceived as the "source of truth", the initial values from it will overwrite any downloaded DB at the start of the PLC cycle. However, the PLC should write the overridden values back into the offline DB for preservation, ensuring no data is lost. If there's any concern about losing data for a single cycle, I recommend synchronizing your DBs closer to the end of the cycle, or re-evaluating your validation and overwrite rules.
This issue can indeed occur; the primary work around comes down to the design of your PLC program. A good PLC program ensures that the values needed in the DB are either preserved, or updated as required by the machine state. Investing time in structured and smart programming can save a lot of future headaches. Always remember, the PLC should serve your purpose, not the other way around.
✅ Work Order Management
✅ Asset Tracking
✅ Preventive Maintenance
✅ Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: 1. Question: Is it common for values in a downloaded DB to be overridden by the "actual" column in the offline DB at the beginning of the PLC cycle? Answer: Yes, it is common for the values in a downloaded DB to be overwritten by the "actual" column from the offline DB when the PLC cycle starts.
Answer: Answer: The values in the downloaded DB are typically preserved for the duration of a single cycle, but they may be overwritten when the PLC cycle restarts.
Answer: Answer: Siemens Step7 PLC may prioritize the values in the offline DB's "actual" column over those in the downloaded DB at the beginning of a cycle, potentially leading to the overwriting of values in the downloaded DB.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.