beautypg.com

Echelon i.LON SmartServer 2.0 User Manual

Page 379

background image

i.LON SmartServer 2.0 Programmer’s Reference

21-27

iLON_SmartServer_System.

messageProperties_system

systemInfo =

new

iLON_SmartServer_System.

messageProperties_system

();

string

staticData =

"SI_STATIC"

;

string

staticResult = SmartServer.SystemService_Read_Info(

ref

systemInfo, staticData);

Console

.Out.WriteLine(staticResult);


Console

.Out.WriteLine(

"\r\n Changing the SmartServer's System Time\r\n"

);


iLON_SmartServer_System.

messageProperties_system

revisedTime =

new

iLON_SmartServer_System.

messageProperties_system

();

string

revisedTimeData =

""

;

string

revisedTimeResult = SmartServer.SystemService_Write_Info(

ref

revisedTime,

revisedTimeData);

Console

.Out.WriteLine(revisedTimeResult);


Console

.Out.WriteLine(

"\r\nTake a 10-second break to see if time updates properly \r\n"

);

Thread

.Sleep(10000);

iLON_SmartServer_System.

messageProperties_system

newTime =

new

iLON_SmartServer_System.

messageProperties_system

();

string

newTimeData =

"SI_TIME"

;

string

newTimeResult = SmartServer.SystemService_Read_Info(

ref

newTime, newTimeData);

Console

.Out.WriteLine(newTimeResult);


Console

.In.ReadLine();

}

finally

{

iLON_SoapCalls

.CloseBindingToSmartServer();

}

}
}
}

Web Service Instantiation in iLON_SoapCalls Class for NET 3.5 Framework

using

System;

using

System.Collections.Generic;

using

System.Linq;

using

System.Text;

using

System.ServiceModel;

namespace

SystemServiceExample

{

class

iLON_SoapCalls

{

// your SmartServers's IpAddress

public

static

string

_iLonEndpointIpAddress =

"your SmartServer's IP address"

;


// your SmartServer’s web service reference

static

public

iLON_SmartServer_System.

iLON100portTypeClient

_iLON =

null

;



///

///

Instantiates the i.LON web service for

///

.NET 3.5

///

static

public

void

BindClientToSmartServer()