Campbell Scientific LoggerNet Server SDK User Manual

Page 49

Advertising
background image

Section 9. Developing an Application Using the Datalogger Control

Private Sub cmdRetrieve_Click()

'Get the current program from the datalogger
If DataLogger.serverConnected Then
DataLogger.programReceiveStart

txtRetrieve

WriteMessage "Retrieving Program from the Datalogger"
Else
WriteMessage "Not connected to the LoggerNet server"

End

If

End Sub

The programSendStart() method sends a program to the specified datalogger
and calls the onProgramSendProgress() event, the onProgramSent() event, and
the onProgramSendComplete() event respectively. The following table
contains example code for the programSendStart() method:

Private Sub cmdSend_Click()

'Send a program to the datalogger
If DataLogger.serverConnected Then
If txtSend = "" Then
WriteMessage "Enter a Program to Send"
Else

DataLogger.programSendStart txtSend, ""
WriteMessage "Sending Program " & txtSend
End

If

Else
WriteMessage "Not connected to the LoggerNet server"
End

If

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
CsiDatalogger control are included in the LoggerNet SDK installation.

9-7

Advertising