Campbell Scientific LoggerNet-SDK Software Development Kit User Manual
Page 47

Section 9. Developing an Application Using the Datalogger Control
Private Sub cmdCheck_Click()
'Check the clock on the datalogger.
If DataLogger.clockBusy Then
WriteMessage "Clock check already in progress"
Else
If DataLogger.serverConnected Then
DataLogger.clockCheckStart
WriteMessage "Clock Check Started"
Else
WriteMessage "Not connected to the LoggerNet server"
End
If
End
If
End Sub
Private Sub cmdSet_Click()
'Set the clock on the
If DataLogger.clockBusy Then
WriteMessage "Clock set already in progress"
Else
If DataLogger.serverConnected Then
DataLogger.clockSetStart
WriteMessage "Clock Set Started"
Else
WriteMessage "Not connected to the LoggerNet server"
End
If
End
If
End Sub
Private Sub DataLogger_onClockComplete(ByVal successful _
As Boolean, ByVal response_code As _
CSIDATALOGGERLibCtl.clock_outcome_type, ByVal _
current_date As Date)
'Clock check complete
If successful Then
WriteMessage "Current Datalogger Clock: " & _
current_date
Else
WriteMessage "Clock Check/Set failed. Code: " & _
response_code
End
If
End Sub
The
manualPollStart()
method connects to the datalogger and retrieves
data. The
manualPollCancel()
method can be called to cancel a polling
event in progress. Both of these methods trigger the
onManualPollComplete()
event, which returns the appropriate response
code if the poll succeeded, failed, or was cancelled. The following tables
contain code illustrating the use of these methods and event:
9-5