Default value, Com return values, 2 methods – Campbell Scientific LoggerNet-SDK Software Development Kit User Manual

Page 128: Dsource.connect(), Name, Description, Dsource.createadvisor(), Connect m, Connect method

Advertising
background image

Section 18. CsiDataSource Control Reference

Default Value

This property is set to FALSE by default.

COM Return Values

Table of Possible Values

Code Meaning

S_OK

Success: Normal return.

18.1.2 Methods

DSource.connect()

Name

DSource.connect()

Description

This method allows you to connect to the LoggerNet server. When you invoke
this method, the control will attempt to connect to the specified LoggerNet
server. If it succeeds, you will receive the event onControlReady. If you are
already connected, you will receive the COM error
E_CSI_ALREADY_CONNECTED. If the serverName and/or serverPort
properties cannot be resolved or are incorrect, then you will receive the error
code E_CSI_BAD_HOST_OR_PORT.

COM Return Values

Table of Possible Values

Code Meaning

S_OK

Success: Normal return

E_CSI_ALREADY_CONNECTED

Error: Already connected to the server

E_CSI_BAD_HOST_OR_PORT

Error: Server hostname or port is
incorrect

DSource.createAdvisor()

Name

DSource.createAdvisor()As Object

Description

This method creates a new advisor object. Keep a reference to the advisor so
that it will not go out of scope. If you create and start an advisor but don't get
any data, then you are probably letting the advisor go out of scope. When
handling multiple advisors, use a collection or list. The property advisorName
is provided for convenience when using a collection to hold names of the
advisors you create.

18-4

Advertising