Campbell Scientific LoggerNet Server SDK User Manual

Page 58

Advertising
background image

Section 11. Developing an Application Using the CsiDataSource Control

11-4

Private Sub DSource_onAdviseRecord(ByVal myAdvisor As Object, _
ByVal myRecord As Object)

'Declare

Variables

Dim val As Value
Dim rec As Record

Set rec = myRecord

'Display the Advisor and record information to the user
WriteMessage

""

WriteMessage "OnAdvise ready event occurred"
WriteMessage "Advisor Name: " & CurrentAdvisor.advisorName
WriteMessage "FileMarkNo. " & rec.fileMarkNo
WriteMessage "RecordNo. " & rec.recordNo
WriteMessage "TimeStamp. " & rec.TimeStamp

'Display the values for all columns in the record
For Each val In rec
WriteMessage val.columnName & ": " & val.Value
Next

End Sub

The Advisor will continue displaying new records as they are received until the
stopAdvisor() method is called to stop the Advisor. The following code
illustrates the use of this method:

Private Sub cmdStopAdvisor_Click()

'Stop the Advisor.
CurrentAdvisor.stop
WriteMessage "Advisor Stopped"

End Sub

Additional functionality, error handling, and objects should be added as
necessary beyond the example interface and code listed above to meet the
specific requirements of your application. Complete examples using the
CsiDataSource control are included in the LoggerNet SDK installation.

Advertising