Comet system forum

Discussion forum about Comet system products

Temperature, Humdity,

Pressure Transmitters

and Data Loggers

You are not logged in.

#1 15-10-2012 16:09:39

sppelletier
Member
Registered: 22-08-2012
Posts: 5

T3510 writing directly in SQL server database

Hi,

Does the T3510 can write directly in a SQL server 2008 database?  If yes, how do I setup it to do this?  I would like the datalogger to write directly in the database in order that no software would be required.

Thank you,

T3510 with 02.47 / 1-5-2.04 firmware

Offline

 

#2 16-10-2012 06:59:08

HonzaD
Administrator
Registered: 11-08-2008
Posts: 294

Re: T3510 writing directly in SQL server database

Hello,

T3510 is not able to write directly into SQL database. For this purpose can be use SOAP protocol.

You need to only install on your web server a small C# script. SOAP example:

Code:

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using System.IO;
using System.Text;
using System.Web.Services.Description;

namespace TransmittersWebService
{
    /// <summary>
    /// Example of web service for obtaining values from Tx5xx transmitters
    /// </summary>

    [SoapDocumentService(RoutingStyle = SoapServiceRoutingStyle.RequestElement)]

    [WebService(Namespace = "http://cometsystem.cz/schemas/soapTx5xx_v2.xsd")]

    public class TransmittersSoap : System.Web.Services.WebService
    {

        [WebMethod(Description = "Example of processing sample from Tx5xx sensor.")]
        public bool InsertTx5xxSample(string passKey, string device, string temp, string relHum, string compQuant, string pressure, string alarms, string compType, string tempU, string pressureU, string timer)
        {
            string data =   "Time: " +  DateTime.Now.ToString()
                          + ", serial number: " + passKey
                          + ", Temp: " + temp
                          + ", RH: " + relHum
                          + ", alarms: " + alarms;

            FileStream fs = new FileStream("d:\\temp\\soap.log", FileMode.Append);
            StreamWriter w = new StreamWriter(fs, Encoding.ASCII);
            w.WriteLine(data);
            w.Flush();
            w.Close();
            fs.Close();

            return true;
        }

    }
}

This code create file with values on your server. You can insert your SQL code instead writing to file.

Jan

Offline

 

#3 16-10-2012 18:25:07

sppelletier
Member
Registered: 22-08-2012
Posts: 5

Re: T3510 writing directly in SQL server database

Thank you, but what do you mean to install on my web server?

Offline

 

#4 17-10-2012 06:35:41

HonzaD
Administrator
Registered: 11-08-2008
Posts: 294

Re: T3510 writing directly in SQL server database

You need to add C# source file into your IIS ASP .NET server. SOAP you can also use with Apache + PHP. Introduction into SOAP protocol you find here: http://www.w3schools.com/soap/default.asp. Also you can buy a database solution from us: www.cometsystem.cz/products/reg-DBS

Offline

 

Board footer

Powered by PunBB | CZ / SK
© Copyright 2002–2005 Rickard Andersson