DataLogger?

Discussion of application development using iX Developer, including but not limited to getting started, using the functions tab, properties, objects and installation.
Post Reply
charliehbeijer
Posts: 40
Joined: Sat Jun 02, 2012 7:43 am

DataLogger?

Post by charliehbeijer »

Can I do anything with a DataLogger besides show it in a TrendViewer? Can I accessthe records of a DataLogger in a script?

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: DataLogger?

Post by mark.monroe »

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.
Attachments
Script_Database_Export.zip
(192.23 KiB) Downloaded 3220 times
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

charliehbeijer
Posts: 40
Joined: Sat Jun 02, 2012 7:43 am

Re: DataLogger?

Post by charliehbeijer »

Very nice.

charliehbeijer
Posts: 40
Joined: Sat Jun 02, 2012 7:43 am

Re: DataLogger?

Post by charliehbeijer »

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.

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: DataLogger?

Post by mark.monroe »

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.
Snap 2012-08-29 at 08.00.32.jpg
Snap 2012-08-29 at 08.00.32.jpg (68.5 KiB) Viewed 52846 times
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer

charliehbeijer
Posts: 40
Joined: Sat Jun 02, 2012 7:43 am

Re: DataLogger?

Post by charliehbeijer »

Yes, I went there and clicked "Add", but System.Data.SqlServerCe.dll isn't in the list.

charliehbeijer
Posts: 40
Joined: Sat Jun 02, 2012 7:43 am

Re: DataLogger?

Post by charliehbeijer »

I found the dll under
C:\Program Files\Microsoft SQL Server Compact Edition\v3.5\Devices

charliehbeijer
Posts: 40
Joined: Sat Jun 02, 2012 7:43 am

Re: DataLogger?

Post by charliehbeijer »

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

mark.monroe
Posts: 824
Joined: Tue Mar 13, 2012 9:53 am

Re: DataLogger?

Post by mark.monroe »

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

Post Reply