Welcome Guest ( Login | Register )



All times are UTC - 7 hours [ DST ]



Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: DataLogger?
PostPosted: Tue Aug 21, 2012 2:56 pm 

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

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


 Profile  
 
 Post subject: Re: DataLogger?
PostPosted: Tue Aug 21, 2012 3:28 pm 

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

Offline
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 1787 times

_________________
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer
 Profile  
 
 Post subject: Re: DataLogger?
PostPosted: Tue Aug 21, 2012 4:29 pm 

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

Offline
Very nice.


 Profile  
 
 Post subject: Re: DataLogger?
PostPosted: Tue Aug 28, 2012 5:43 pm 

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

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


 Profile  
 
 Post subject: Re: DataLogger?
PostPosted: Wed Aug 29, 2012 8:02 am 

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

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

Attachment:
Snap 2012-08-29 at 08.00.32.jpg
Snap 2012-08-29 at 08.00.32.jpg [ 68.5 KiB | Viewed 16212 times ]

_________________
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer


 Profile  
 
 Post subject: Re: DataLogger?
PostPosted: Wed Aug 29, 2012 8:49 am 

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

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


 Profile  
 
 Post subject: Re: DataLogger?
PostPosted: Wed Aug 29, 2012 8:54 am 

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

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


 Profile  
 
 Post subject: Re: DataLogger?
PostPosted: Mon Sep 03, 2012 6:52 am 

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

Offline
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


 Profile  
 
 Post subject: Re: DataLogger?
PostPosted: Tue Sep 04, 2012 9:24 am 

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

Offline
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:
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 1102 times

_________________
Best Regards,
Mark Monroe

Beijer Electronics, Inc. | Applications Engineer
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 7 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron