Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84865members
354354posts

Historic Data Export

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

Solved
jen6190
Ensign Ensign
Ensign
18
7400

Historic Data Export

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?


Accepted Solutions
AdamWoodland
Commander Commander
Commander
0 Likes
17
7398

Re: Historic Data Export

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

See Answer In Context

sbeadle
Janeway Janeway
Janeway
0 Likes
13
7364

Re: Historic Data Export

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%

See Answer In Context

18 Replies 18
AdamWoodland
Commander Commander
Commander
0 Likes
17
7399

Re: Historic Data Export

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

jen6190
Ensign Ensign
Ensign
0 Likes
16
7394

Re: Historic Data Export

I am new to clearscada, but i'm gonna try your 3rd option , i think it would work. Thanks!

sbeadle
Janeway Janeway
Janeway
0 Likes
15
7373

Re: Historic Data Export

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. 🙂  )

jen6190
Ensign Ensign
Ensign
0 Likes
14
7367

Re: Historic Data Export

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.

sbeadle
Janeway Janeway
Janeway
0 Likes
13
7365

Re: Historic Data Export

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%

jen6190
Ensign Ensign
Ensign
0 Likes
12
7361

Re: Historic Data Export

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

sbeadle
Janeway Janeway
Janeway
0 Likes
11
7359

Re: Historic Data Export

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.

jen6190
Ensign Ensign
Ensign
0 Likes
0
7355

Re: Historic Data Export

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.

DavidSkilbeck
Lt. Commander
Lt. Commander
0 Likes
9
6096

Re: Historic Data Export

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,

Tags (1)
sbeadle
Janeway Janeway
Janeway
0 Likes
8
6090

Re: Historic Data Export

While using the raw historic files is possible, I don't recommend this method for an application, just for diagnostic purposes.

Tags (1)
CHRN
Ensign
Ensign
0 Likes
7
4976

Re: Historic Data Export

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 


BevanWeiss
Spock
Spock
5
4970

Re: Historic Data Export

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.


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
BevanWeiss
Spock
Spock
0 Likes
0
4969

Re: Historic Data Export

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.


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
CHRN
Ensign
Ensign
4
4395

Re: Historic Data Export

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.

jen6190
Ensign Ensign
Ensign
0 Likes
2
4294

Re: Historic Data Export

Please can you share your steps/procedure with me, i am still having issues on this. Thank you

arun36
Crewman
Crewman
0 Likes
1
2000

Re: Historic Data Export

hi, how about this topic, did you have solved your problem ? i have same problem here. thank you if you can share step by step how to export to CSV

BevanWeiss
Spock
Spock
0 Likes
0
1986

Re: Historic Data Export

You should post this as a new thread/topic, and detail what you have tried already.

If you search in the Geo SCADA Expert online help for "export CSV" then you should get some hits to follow up on learning more about. 

 

As Geo SCADA Expert provides numerous ways to perform such requirements, you would need to consider which is the most suited for your needs, and research more on it.


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..
jen6190
Ensign Ensign
Ensign
0 Likes
0
1767

Re: Historic Data Export

Hi Please, can you share a sample program on how you did this?