Leica TPS1200 Series Reference Manual page 15

Geodetic measurement instruments
Hide thumbs Also See for TPS1200 Series:
Table of Contents

Advertisement

GeoCOM Reference Manual
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,
If (RetCode = GRC_OK) Then
bOpenAndRunning = True
End If
End If
' optionally set up other comm. parameters here
If (RetCode = GRC_OK)
' 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.
Leica TPS1200 / TS30 / TM30 – Version 1.50
OnlyAngle,
SlopeDistance,
TMC_AUTO_INC)
NUM_OF_RETRIES)
Then
Fundamentals of Programming GeoCOM
15

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tm30Ts30Tps1200+

Table of Contents