aamirawan91
Member
Hello Experts
I am working on a project with WinCC Unified v16 PC system and want to create an option on the screen to export logs to the computer storage in CSV format. I created a button, and in the events, I am using the built-in JavaScript snippet 'Export tag log as CSV' since I have no knowledge of JavaScript whatsoever. In the snippet, the date & time and tag name have to be edited as per your project. I somehow managed to do that, and it kinda works, but I am confused about the start and end date and time. I thought 'Let start' would have the date from where the export will start and 'Let end' would have the date where the export ends, but it's not how it works. Instead, when I reversed the dates, then it works how I want. Can somebody please explain because I am doing it using the hit-and-trial method and don't exactly know how it should be done.
Now, I have the following questions:
1. What dates should be put in the following lines of the snippet if I want it to export logs of the last 3 days? I set this like the following when i wanted it to export from 2024-04-25, 23:43 to 2024-04-26, 15:00:00. Still don't know why the previous date has to be set at "Let end" and the date where it should stop should be set at "let start"
let start = new Date("2024-04-26T15:00:00Z");
let end = new Date("2024-04-25T23:43:00Z");
2. What exactly is the 'Log time period' in the Logs? Does it affect the export start and stop time
3. What is 'Segment start time'? If I have set a back date, does that mean it will never start a new segment?
A screenshot of the snippet has also been attached.
I am working on a project with WinCC Unified v16 PC system and want to create an option on the screen to export logs to the computer storage in CSV format. I created a button, and in the events, I am using the built-in JavaScript snippet 'Export tag log as CSV' since I have no knowledge of JavaScript whatsoever. In the snippet, the date & time and tag name have to be edited as per your project. I somehow managed to do that, and it kinda works, but I am confused about the start and end date and time. I thought 'Let start' would have the date from where the export will start and 'Let end' would have the date where the export ends, but it's not how it works. Instead, when I reversed the dates, then it works how I want. Can somebody please explain because I am doing it using the hit-and-trial method and don't exactly know how it should be done.
Now, I have the following questions:
1. What dates should be put in the following lines of the snippet if I want it to export logs of the last 3 days? I set this like the following when i wanted it to export from 2024-04-25, 23:43 to 2024-04-26, 15:00:00. Still don't know why the previous date has to be set at "Let end" and the date where it should stop should be set at "let start"
let start = new Date("2024-04-26T15:00:00Z");
let end = new Date("2024-04-25T23:43:00Z");
2. What exactly is the 'Log time period' in the Logs? Does it affect the export start and stop time
3. What is 'Segment start time'? If I have set a back date, does that mean it will never start a new segment?
A screenshot of the snippet has also been attached.