EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-04-18 11:20 PM . Last Modified: 2023-05-02 11:56 PM
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.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-04-18 11:29 PM
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:
DateTime | GII-W/m2 | GHI-W/m2 | Mod.Temp.-Deg.C | Amb.Temp.-Deg.C | Wind Speed-km/hr |
12.00.13 AM | 0 | 0 | 36.4 | 26 | 1 |
12.15.13 AM | 0 | 0 | 35.14 | 25.1 | 0.8 |
12.30.13 AM | 0 | 0 | 37.1 | 26.5 | 0.8 |
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-04-19 03:21 AM
If you need unique time-based filenames, you can specify the filename with trip characters to include time.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-04-19 05:04 AM
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.
DateTime | GII-W/m2 | GHI-W/m2 | Mod.Temp.-Deg.C | Amb.Temp.-Deg.C | Wind Speed-km/hr | Wind Dir.-Deg. |
12.00.13 AM | 0 | 0 | 36.4 | 26 | 1 | 196.9 |
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-04-19 06:00 PM
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:
Hence you probably want to look into Historic Aggregates and Historic Views.
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).
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-04-19 09:35 PM
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.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-04-19 11:36 PM . Last Modified: 2022-04-19 11:40 PM
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)
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
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-04-20 12:27 AM
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.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-04-20 08:41 PM
@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.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-04-20 09:08 PM . Last Modified: 2022-04-20 09:14 PM
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.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-04-20 10:49 PM
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?
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-04-25 06:12 PM
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?
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.