Please how do i export HISTORICAL DATA from clearscada to a CSV file. I want it to be in form of a button, when the user wants to export he can click the button and inputs the period for which he wants to export the historical data. Please is this possible?
Solved! Go to Solution.
Sure, lots of ways, the best way really depends what you want to do with the CSV file afterwards
* Use the CSV Export driver, but may not be as flexible that you need
* Use logic, use VAR INPUT to define the time and %S to query the data from CDBHistoric, then use and FILE_WRITE() functions. This will store the file on the server and has the advantage that it can be both scheduled and manually triggered, but again lose some flexibility on defining the source point
* Use scripting on mimics. Use the Form object or similar to prompt for date inputs, Server.Query to get the data from CDBHistoric and create a COM object to fso to write files to the local workstation's disk. Probably lots more flexibility with this one but more coding required
The issue about parameters - noted!
Filenames - you can use trip characters to add parts of the date/time stamp, e.g. %Ddd MMM yyyy% %THH:mm:ss%
Sure, lots of ways, the best way really depends what you want to do with the CSV file afterwards
* Use the CSV Export driver, but may not be as flexible that you need
* Use logic, use VAR INPUT to define the time and %S to query the data from CDBHistoric, then use and FILE_WRITE() functions. This will store the file on the server and has the advantage that it can be both scheduled and manually triggered, but again lose some flexibility on defining the source point
* Use scripting on mimics. Use the Form object or similar to prompt for date inputs, Server.Query to get the data from CDBHistoric and create a COM object to fso to write files to the local workstation's disk. Probably lots more flexibility with this one but more coding required
I am new to clearscada, but i'm gonna try your 3rd option , i think it would work. Thanks!
The first option - the facility is called 'SQL Expert' - find the object in the Create ... New ... Other menu.
Any SQL can be written which exports that data in CSV (or tab) into a file. This can be scheduled or triggered from the client.
Note that option 1 may or may not work on WebX, and on Virtual ViewX will write a file on the web server.
(This thread should be in the Geo SCADA forum, but I don't see an option to move a thread. 🙂 )
Yeah i have tried the SQL export, but its not as flexible as i want, the Client cannot specify the date range in which he wants to export the historical data and also, it doesnt save each export in a new CSV file, it overwrites the old one.
The issue about parameters - noted!
Filenames - you can use trip characters to add parts of the date/time stamp, e.g. %Ddd MMM yyyy% %THH:mm:ss%
When i do this, does it export in a new csv file with the new time specification? Although i tried this format"%Ddd MMM yyyy% %THH:mm:ss%" and it kept giving me "Invalid OPC relative time for trip sequence", this was the format that worked e.g D-2D or H
Yes, it creates a new file, leaving the old file in place.
You can use the time/date sequences in both file and folder names.
It worked!, so i used the %THH mm ss% format in the Output filename. It creates a new file now. Thanks! Prolly try to figure out how the client can specify the Date range he/she wants.
Hi, does this topic relate to https://www.se.com/ww/en/faqs/FA312272/
Also, does a .HRD / .csv file contain historic data relating to all points with historic data? I have not seen one of these files structure just yet.
(I notice, by week, yes?)
Thanks,
While using the raw historic files is possible, I don't recommend this method for an application, just for diagnostic purposes.
Hello Experts,
Can anyone share a sample SQL query for pulling out data from the database for two tags for a a time period .
I am kind of stuck at this portion.
Kindly share a sample code
I won't give you the exact SQL Query... because learning to fish will be more rewarding.
If you find one of the points that you are interested in, and right click to bring up the context menu, there is an option called 'Display Historic List'. This will provide you with a List Window which will have the SQL Query to display the historical data for that point.
This is a good leap-pad into SQL queries in particular. There is also an entire 'Queries' pane available from the View Ribbon that is worthwhile looking at for any future queries that you might be interested in. You will almost always want to customise them in some way, but you can right click in the List Window (once you've selected a query) and select 'Edit Query' to see exactly what the SQL is. Then if you edit it and select OK the window will update with your new query expression shown.
PS: In forums, unless you have extra information to add to a particular thread (i.e. a solution, or additional context to the problem the original poster encountered etc), you should be creating a new thread with your new problem / question to ask.
Thank you for the lead.
I finally made it using the method mentioned.
Created from and to date picker and finally exported it as CSV.
Please can you share your steps/procedure with me, i am still having issues on this. Thank you
User | Count |
---|---|
188 | |
53 | |
16 | |
16 | |
15 |
Discuss challenges in energy and automation with 30,000+ experts and peers.
Find answers in 10,000+ support articles to help solve your product and business challenges.
Find peer based solutions to your questions. Provide answers for fellow community members!