beautypg.com

Programming samples, Programming samples -12, 4 programming samples – Echelon i.LON 100 e2 Internet Server User Manual

Page 29

background image

Input Parameters

For descriptions of the input parameters that you

must supply to the function, see
DataPointResetPriority on page 3-10.

Returns: The function returns a string containing the name of the data point reset by the
function.

3.6.4 Programming Samples

The following programming sample, written in Microsoft Visual Basic .NET, invokes all

three of the DataPoint functions. It uses the DataPointWrite function to write to the value of
a data point called NVL_nvo01Switch. It then uses DataPointResetPriority to reset the

priority level assigned to the data point, so that other applications can write to its value
later.
Once the data point has been updated, the DataPointRead function is called. Each property

included in the object returned by the function is then extracted and displayed in a text box.


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e _

As System.EventArgs) Handles Button1.Click

'Create an instance of the

i.

LON 100 Web service, and return

'objects for the three functions to be called. The WSDL file

'defines a return type for DataPointRead and DataPointWrite. The

'DataPointResetPriority returns a string containing the name of the

'data point reset by the function.

Dim ilon As New WebReference1.iLON100()

Dim retRead As New WebReference1.DataPointReadReturnType()

Dim retWrite As New WebReference1.DataPointWriteReturnType()

Dim retPriority As String

'Create variables to store the input for each function.

Dim S As String

Dim pointName As String

Dim fieldName As String

Dim value As String

Dim propagate As String

Dim priority As String

'Specify the IP location of the

i.

LON 100 by replacing the default

' “localhost” with the IP address of the

i.

LON 100.

S = ilon.Url

ilon.Url = S.Replace("localhost", "10.5.0.50")

'Define the data point to be written to, and the value to assign

'it. In this case, the field name is left blank, as the data point

'the program is writing to is not a structure.

pointName = " NVL_nvo01Switch "

fieldName = ""

value = "0.0 0"

propagate = "1"

priority = "50"

i.

LON 100 Internet Server Program

3-12

mer’s Reference