GeoCOM Reference Manual
Fundamentals of Programming GeoCOM
Leica TPS1200 / TS30 / TM30 – Version 1.50
15
OnlyAngle,
SlopeDistance,
TMC_AUTO_INC)
3.4.2
Basic GeoCOM Application Frame for VBA
Like in section 3.3.2 - Basic GeoCOM Application Frame for C/C++ - a VBA GeoCOM application consists at least of
the following parts:
- Initialise GeoCOM
- Open a connection to the server
- One or more GeoCOM RPC’s
- Close the active connection to the server
- Finalise GeoCOM
A sample implementation of above points could be:
CONST NUM_OF_RETRIES = 1
DIM RetCode As Integer
DIM bOpenAndRunning as Integer
DIM bAvailable as BOOLE
' initialize GeoCOM
bOpenAndRunning = False
RetCode = VB_COM_Init()
If (RetCode = GRC_OK) Then
' open a connection to the TPS1200 instrument
RetCode = VB_COM_OpenConnection(COM_1, COM_BAUD_19200,
NUM_OF_RETRIES)
If (RetCode = GRC_OK) Then
bOpenAndRunning = True
End If
End If
' optionally set up other comm. parameters here
If (RetCode = GRC_OK) Then
' functionality of the application
' we just test if communication is up
RetCode = VB_COM_NullProc()
If (RetCode <> GRC_OK) Then
' handle error
End If
End If
If (bOpenAndRunning) Then
' close channel
RetCode = VB_COM_CloseConnection ()
If (RetCode <> GRC_OK) Then
' handle error
End If
End If
' finalize and reset GeoCOM
RetCode = VB_COM_End()
If (RetCode <> GRC_OK) Then
' handle error
End If
3.4.3
VBA Development System Support
This interface has been written for Microsoft Visual Basic for Applications 5.0 and higher only. Hence, no other
development environment will be supported.
3.4.4
Programming Hints
Output Parameters of String Data Type
The internal representation of strings is not directly compatible between C/C++ and VBA. Therefore the one has to pre-
and post-process such an output parameter. In the following example, we know that the output parameter will be less
than 255 characters in length from the description of the RPC.
Содержание TM30 Series
Страница 1: ...Leica TPS1200 Leica TS30 TM30 GeoCOM Reference Manual Version 1 50 English...
Страница 120: ...GeoCOM Reference Manual File Transfer FTR Leica TPS1200 Version 1 50 120 while bLast TRUE FTR_AbortList...
Страница 136: ...GeoCOM Reference Manual Motorisation MOT Leica TPS1200 Version 1 50 136 handle error...