DataLogger?
-
- Posts: 40
- Joined: Sat Jun 02, 2012 7:43 am
DataLogger?
Can I do anything with a DataLogger besides show it in a TrendViewer? Can I accessthe records of a DataLogger in a script?
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: DataLogger?
You can access the data via a report, export it using an action to a csv file, or directly query the database using SQL. I have attached a project that shows you how to query the databse via a script.
An example of how to create an Excel Report Template and generate a report that queries the database can be found in the samples section of the initial iX Developer startup screen. It is called "Sample_Report".
The action to export the datalogger data to a csv file is under the Database action listing.
An example of how to create an Excel Report Template and generate a report that queries the database can be found in the samples section of the initial iX Developer startup screen. It is called "Sample_Report".
The action to export the datalogger data to a csv file is under the Database action listing.
- Attachments
-
- Script_Database_Export.zip
- (192.23 KiB) Downloaded 3221 times
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
-
- Posts: 40
- Joined: Sat Jun 02, 2012 7:43 am
Re: DataLogger?
Using the example file you posted, I have in my script:
using System.Data.SqlServerCe;
I'm getting an error message that SqlServerCe doesn't exist in System.Data.
I try using intellisense. I type "using System.Data.", and intellisense says I have Sql, SqlClient, and SqlTypes, but then if I say
using System.Data.Sql, it says Sql is not part of System.Data!
And no matter what I do, I can't resolve the type "SqlCeConnection" which appears in the example project you posted.
using System.Data.SqlServerCe;
I'm getting an error message that SqlServerCe doesn't exist in System.Data.
I try using intellisense. I type "using System.Data.", and intellisense says I have Sql, SqlClient, and SqlTypes, but then if I say
using System.Data.Sql, it says Sql is not part of System.Data!
And no matter what I do, I can't resolve the type "SqlCeConnection" which appears in the example project you posted.
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: DataLogger?
You need to add a Reference assembly to your project. If you open up the Script_Database_Export project and go to the Reference Assemblies, you will see that it has one.
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
-
- Posts: 40
- Joined: Sat Jun 02, 2012 7:43 am
Re: DataLogger?
Yes, I went there and clicked "Add", but System.Data.SqlServerCe.dll isn't in the list.
-
- Posts: 40
- Joined: Sat Jun 02, 2012 7:43 am
Re: DataLogger?
I found the dll under
C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices
C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices
-
- Posts: 40
- Joined: Sat Jun 02, 2012 7:43 am
Re: DataLogger?
The database example works perfectly in simulate, and in the debugger, but crashes to the T7A screen on the flat panel.
In the main screen, if I just add
using System.Data;
using System.Data.SqlServerCe;
using System.IO;
using System.Reflection;
the program runs.
But if I then declare inside the partial class:
private SqlCeConnection m_SqlConnection;
the project won't start. It says: Missing Method Exception
Same thing if I say
private SqlCeConnection m_SqlConnection = null;
I'm picking up System.Data.SqlServerCe from
C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices
In the main screen, if I just add
using System.Data;
using System.Data.SqlServerCe;
using System.IO;
using System.Reflection;
the program runs.
But if I then declare inside the partial class:
private SqlCeConnection m_SqlConnection;
the project won't start. It says: Missing Method Exception
Same thing if I say
private SqlCeConnection m_SqlConnection = null;
I'm picking up System.Data.SqlServerCe from
C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices
-
- Posts: 824
- Joined: Tue Mar 13, 2012 9:53 am
Re: DataLogger?
Below is code that works on my Main screen. I think the issue is that you need to use the system.data.sqlserverce.dll contained in the attached zip file. I tried using the same one you are, and it is not working.
Code: Select all
namespace Neo.ApplicationFramework.Generated
{
using System.Windows.Forms;
using System;
using System.Drawing;
using Neo.ApplicationFramework.Tools;
using Neo.ApplicationFramework.Common.Graphics.Logic;
using Neo.ApplicationFramework.Controls;
using Neo.ApplicationFramework.Interfaces;
using System.Data;
using System.Data.SqlServerCe;
using System.IO;
using System.Reflection;
public partial class Screen1
{
private SqlCeConnection m_SqlConnection;
}
}
- Attachments
-
- system.data.sqlserverce.zip
- (92.83 KiB) Downloaded 2119 times
Best Regards,
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer
Mark Monroe
Beijer Electronics, Inc. | Applications Engineer