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
84646members
353985posts

Export Data in CSV every 15 minutes in GEO SCADA

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.

917_Kuntal
Ensign
Ensign
11
1053

Export Data in CSV every 15 minutes in GEO SCADA

Hi All,

Can anyone help me with how to export data in CSV from GEO SCADA Expert at the interval of every 15 min?

I have tried the SQL Export function but it overwrites the existing raw.

I need to export10 nos of parameters data in every 15 min with the specific file name. Attached is the CSV format for the same.

 

It is good if anyone shares a sample code/project.

 

Thanks a lot.

 

11 Replies 11
917_Kuntal
Ensign
Ensign
0 Likes
10
1045

Re: Export Data in CSV every 15 minutes in GEO SCADA

Refer Below query and format of CSV.

 

Query:

SELECT "FullName","Name","CurrentValueAsReal"

FROM

CDBPOINT

where ("FullName" = 'Z_SQL_Test.Copy of New Analog Point')

 

CSV Format:

DateTimeGII-W/m2GHI-W/m2Mod.Temp.-Deg.CAmb.Temp.-Deg.CWind Speed-km/hr
12.00.13 AM0036.4261
12.15.13 AM0035.1425.10.8
12.30.13 AM0037.126.50.8

 

Tags (1)
sbeadle
Janeway Janeway
Janeway
0 Likes
6
1031

Re: Export Data in CSV every 15 minutes in GEO SCADA

If you need unique time-based filenames, you can specify the filename with trip characters to include time.

See: https://tprojects.schneider-electric.com/GeoSCADAHelp/Geo%20SCADA%202020/Default.htm#SQLExportDriver...

 

917_Kuntal
Ensign
Ensign
0 Likes
5
1023

Re: Export Data in CSV every 15 minutes in GEO SCADA

I got it, but I didn't need a unique time-based file.

What I want is, a single CSV for the day with a time interval of 15 minutes.

DateTimeGII-W/m2GHI-W/m2Mod.Temp.-Deg.CAmb.Temp.-Deg.CWind Speed-km/hrWind Dir.-Deg.
12.00.13 AM0036.4261196.9

 

 

 

 

BevanWeiss
Spock
Spock
4
1004

Re: Export Data in CSV every 15 minutes in GEO SCADA

When you have your CSV format columns, what 'values' should they actually contain?

 

You say you want 15 minute intervals, there may be anywhere from 0 to millions of actual data records during the 15 minute interval.  So you probably want one of the:

  • First
  • Last
  • Average
  • Minimum
  • Maximum
  • Total (time weighted?)

 

Hence you probably want to look into Historic Aggregates and Historic Views.

https://tprojects.schneider-electric.com/GeoSCADAHelp/Geo%20SCADA%202020/Content/ServerAdministratio...

 

You'd need to configure one with the right aggregates for what you want, and the right time intervals.

Then you'd run the CSV Export once a day and have it execute the appropriate SQL query (using OPC time references I assume).


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..
917_Kuntal
Ensign
Ensign
0 Likes
3
999

Re: Export Data in CSV every 15 minutes in GEO SCADA

Hello,

What I want is, that the current value of that particular time means 15 minutes. 

Mean If parameter X has a value YY at the time 09.15 AM then this Value (YY) should be logged in the CSV with the time stamp(09.15 AM).

 

Hope the question is clear.

BGedco2022
Lt. Commander
Lt. Commander
0 Likes
1
990

Re: Export Data in CSV every 15 minutes in GEO SCADA

for such customization, it is better to export from out of the GEO Scada.

You can develop an ASP.net C# application that be connected to the GEO Scada  using ODBC and make query that loops every 15 minute

 

First, define ODBC connection using ODBC Data Sources tool in both version (32bit and 64 bit)

odbc data source toolodbc data source tool

 

then define it in the web.config file

 

<connectionStrings>
<add name="ConnectionString" connectionString="Dsn=scada;uid=scada_username;pwd=user_password;LOCALTIME=True;" providerName="System.Data.Odbc"/>
</connectionStrings>

 


 then in any web page (c# code sample)

 

 

//define odbc object
OdbcConnection conn = new OdbcConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ToString());
//start connection
conn.Open();
//define query string
string query = "select valueasreal, RecordTime from cdbhistoric where id=10101 and recordtime =";
DateTime time = DateTime.Now.AddDays(-15);
//loop
while(DateTime.Compare(time, DateTime.Now)<0){
query += time.toString("yyyy-MM-dd HH:mm:ss");
using (OdbcCommand com = new OdbcCommand(query , conn))
{
using (OdbcDataReader reader = com.ExecuteReader())
{
while (reader.Read())
{
DateTime tt = reader.GetDateTime(1);
double r = reader.GetDouble(0) + "";
//write date to csv

} //end while
} //end reader
} // end com
time.AddMinutes(15); //add 15 minutes interval
}// end while (time)

 


hope this will help

917_Kuntal
Ensign
Ensign
0 Likes
0
985

Re: Export Data in CSV every 15 minutes in GEO SCADA

Can we achieve this kind of functionality via the FILE_WRITE function inside geo scada or any mimic scripting ??

If yes, then share with me a sample example project/script for the same.

BevanWeiss
Spock
Spock
0 Likes
0
949

Re: Export Data in CSV every 15 minutes in GEO SCADA


@917_Kuntal wrote:

Hello,

What I want is, that the current value of that particular time means 15 minutes. 

Mean If parameter X has a value YY at the time 09.15 AM then this Value (YY) should be logged in the CSV with the time stamp(09.15 AM).

 

Hope the question is clear.


So you want the 'Last' historic aggregate.

Did you look into the Historic Views?

 

This should be quite trivial with a Historic View (using the Last aggregate).  Then just the SQL Export to CSV.

 

Don't do your own CSV stuff using FILE_WRITE if you can avoid 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..
murrayclay
Ensign
Ensign
0 Likes
2
944

Re: Export Data in CSV every 15 minutes in GEO SCADA

If your data is already / only coming back to GeoSCADA at 15 min intervals then I would think you just need to add the last 24 hour time range to your query above. That would give you the data for one day. run the SQL export once per day and use the trip characters (as per sbeadle post) to get the date appended to the filename to get one unique file for each day.  If your data is not already in 15 minute intervals then I would configure a historic view to generate 15 min interval data based on a suitable algorithm (as per bevan weiss post). Join that table and update column in your query to get the 15 minute interval data. All of that should give you a single CSV file per day that doesn't get overwritten each day which has one day worth of 15 min interval data. That's how we are doing it on our system. I think File Write and C# is overcomplicating it.

917_Kuntal
Ensign
Ensign
0 Likes
1
936

Re: Export Data in CSV every 15 minutes in GEO SCADA

Thank @Murrayclay for your input.

I need to clarify some points first, data are continuously updating in my SCADA based on the dead band set-by customer.

Second, I didn’t want 15 min interval data (aggregate, Min, Max, AVG), I need the actual value of the parameters as shown in the below table based on the respected time.

Time

Parameter X

Parameter Y

00:00

1.23

5.32

23:45

523.65

1365.36

 

If these can be possible via any historic view/algorithm then can you just share with me an idea/sample of how can I achieve these?

BevanWeiss
Spock
Spock
0 Likes
0
843

Re: Export Data in CSV every 15 minutes in GEO SCADA

There is no 'actual value' at these exact 15 minute intervals.  There might be a sample shortly before, and shortly after, but you are almost certainly guaranteed that those points will NOT have timestamps at the same time.

 

What research have you done into Historic Views? and into Historic Aggregates?


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