11/30/2023 9:50 AM | |
Joined: 8/10/2020 Last visit: 11/30/2023 Posts: 1 Rating: (0) |
Hello, I am trying to write some data from PLC (S7 1500) tags to two MS SQL databases using VB script in two standalone instances of Wincc RT Professional (V15 UPD4) when PLC triggers (requests) data to be written. VB script is executed every 4 seconds, there is logic to prevent script from running if the previous script call was not completed. In runtime settings "SmartTags reads PLC values via cache" option is set (I am afraid to turn it off now). Project has about 5300 tags. Principle of operation follows. In the PLC data block there is "ArchiveData" variable which is array of udt "S_ArchiveEntry" which is written by different "objects" in the PLC program and inside them triggers are set for archiving "TRIG_PC_1" and "TRIG_PC_2". Initially VB script was triggered by these triggers, and data was read from the "ArchiveData" array. Since there was a problem with this approach further steps were taken to rectify the issue. So "ArchiveQueue" array was added together with a function that moves data from the "ArchiveData" array to the "ArchiveQueue". Also triggers are handled by this function as well. Variables "TRIG_PC_1" and "TRIG_PC_2" are used to trigger data writing to the database for each of two PCs we have. These tags are reset by VB script when queue entry is processed regardless if data writing to SQL database was successful or not. But this didn't solve the issue we had in the first place. All the archive queue tags that are in Wincc tag table are displayed as hidden on some screen. Issuethat we have from the beginning is that in the database some of the entries are written two times. So we have the same data in sql, only time is different by 4 seconds (which is script call interval). Initially this problem was present on both PCs but for different archive entries. Since yesterday after adding this acknowledgement bits only one PC has this issue. Questionis how we can synchronize this so the logic is working or what would be the better way to achieve desired functionality ? (attachment) Best regards
AttachmentArchiving.zip (164 Downloads) |
12/13/2023 1:36 PM | |
Joined: 1/22/2009 Last visit: 4/30/2024 Posts: 81 Rating: (14) |
HI I would recommend you to create a support request to clarify this behavior https://sieportal.siemens.com/en-de/support BR Fess |
Last edited by: The Helping Hand at: 12/13/2023 13:53:57Link optimized |
|
This contribution was helpful to1 thankful Users |
12/19/2023 8:40 AM | |
Joined: 8/3/2009 Last visit: 5/6/2024 Posts: 12884 Rating: (1645)
|
Hello AutoGen_6342160 you can also considering writing the data drectly from the PLC to the SQL Server databases: https://support.industry.siemens.com/cs/ww/en/view/109779336 Bye Murof |
If this Information really helps, you could use the Rate function |
|
This contribution was helpful to1 thankful Users |
Follow us on