(0)| 12/27/2025 4:34 PM | |||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Joined: 12/13/2023 Last visit: 12/29/2025 Posts: 1 Rating:
|
I found this code on here, and I'm trying to manipulate it to show the Time Stamp in the left column, and then Ambient 1, Ambient 2, Wood Core 1, Wood Core 2 in the columns beside it. I've noticed that each tie I generate the report, the columns are randomly displayed. Not always in the order of Ambient 1, Ambient 2, Wood Core 1, Wood Core 2. So that is another question. Any help is greatly appreciated! Thank you. The screen is a 7" Unified Basic - 6AV2 123-3GB32-0AW0 Hello, here is my code for reference: export async function Button_3_OnTapped(item, x, y, modifiers, trigger) { let timeStamp = new Date().toLocaleDateString("pt-PT").replace(/[/]/g,"_"); let path = "C:\\Users\\Public\\Export_" + date + ".csv";
HMIRuntime.Trace(loggedTagsMatrix.length); for (i = 0; i < loggedTagsMatrix.length; i++) { array[i][j] = loggedTagValue.Value; for (n = 0; n < j; n++) {
The Result:
------------------------------------------------------------------------------------------ |
||||||||||||||||||||||||||||||||||||||||||||||||||||
Last edited by: Moderator_Lan at: 12/28/2025 17:48:15New subject after splitting Last edited by: JCB_Craig at: 12/29/2025 15:21:28Last edited by: JCB_Craig at: 12/29/2025 15:25:46Last edited by: JCB_Craig at: 12/29/2025 15:28:12Added data to show it in a spreadsheet, instead of just a text blob Last edited by: JCB_Craig at: 12/29/2025 15:30:01Making the code look better. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12/30/2025 3:38 PM | |
|
Joined: 1/21/2013 Last visit: 12/30/2025 Posts: 4372 Rating:
|
Hi JCB_Craig, In SIMATIC WinCC Unified, tag logging is designed to log only changed values. Even when configured for cyclic logging with the same cycle time for all tags, the timestamps for the logged values will likely differ due to the 100 ns resolution of the timestamps. Therefore, it is impossible to have a value for each timestamp. You must find a suitable way to aggregate the logged values. In SIMATIC WinCC Unified, reporting uses interpolation or the preceding value for this aggregation. Unfortunately, you will need to create your own solution using an aggregation method of your choice. So, you would need to create a series of timestamps and aggregate a value for each one corresponding to a logged value. Kind regards |
Follow us on