Javascript Snippet in WinCC Unified

aamirawan91

Member
Join Date
Feb 2024
Location
Karachi
Posts
33
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.
 

Attachments

  • Export Log Snippet.JPG
    Export Log Snippet.JPG
    74.4 KB · Views: 11

Similar Topics

Newbie question for an EXOR Jmobile javascript problem. I want to access at least one of the system values, but I am stumped on which javascript...
Replies
3
Views
1,710
Hi gents, I'm building an Beckhoff HMI where I have to set an array of booleans to true by pressing a button. Therefore I created the following...
Replies
3
Views
2,242
Hi all ; if someone here can help me to convert this code to python code: public static libnodave.daveOSserialType fds; public static...
Replies
11
Views
3,927
This is another question for the Red Lion guys out there. I am working on the custom website for my Data Station Plus and have a question about...
Replies
2
Views
1,857
is there any free trial version available for step7 professional and wincc comfort v17. i searched and downloaded TRIAL Download STEP 7...
Replies
1
Views
87
Back
Top Bottom