Vba - Programming - Leica TPS1200 Series Reference Manual

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

Advertisement

GeoCOM Reference Manual

3.4 VBA - PROGRAMMING

Similar to C/C++ programming the programming of VBA is based on the DLL concept. To enable access to GeoCOM
the special module
COM_StubsPub.bas
data types and function prototypes, which are available in GeoCOM.
3.4.1 Data Types in VBA - General rules for derivation
This subsection gives a summary of general derivation rules VBA-parameters from C-data types. Basically the C/C++ -
data types are given in a C/C++ notation before they are used in a RPC-description.
If the appearance of a VBA data type does not follow the general rules then they are described explicitly.
In general, the following rules can be applied:
Numerical data type
The numerical data types correspond to the C/C++-parameters in value and range as close as possible. If it
cannot be replaced directly then the best possible replacement will be taken.
String data type
Character and string types are replaced by
directly interchangeable, the programmer has to take certain care of the necessary pre- and post-processing of
variables of this data type. Please refer to the example below.
Enumeration data type
Conceptually VBA does not have enumeration data types. Therefore,
enumeration values will be defined by constants. Using the numerical value is also valid. Notice that some of the
enumeration values are reserved words in VBA. That is why we had to define different identifiers. Enumerated
return values are numerical values and correspond to the position of the enumeration value in the C/C++-
definition. For clarification, also the numerical values are given in the description of an enumeration data type.
Structures and Arrays
They are defined as in C/C++.
Example for Enumeration Data Types and Structures
The following example gives the data type declaration and the procedure declaration usually used in this manual
for an example procedure (
VBA-Declaration
VB_TMC_GetSimpleMea(
WaitTime
OnlyAngle
SlopeDistance
Mode
In the file
COM_StubsPub.bas
Global Const TMC_MEA_INC = 0
Global Const TMC_AUTO_INC = 1
Global Const TMC_PLANE_INC = 2
Global Const TMC_APRIORI_INC = 3
Global Const TMC_ADJ_INC = 4
Global Const TMC_REQUIRE_INC = 5
Type TMC_HZ_V_ANG
dHz
As Double
dV
As Double
End Type
Obviously all enumeration values are encoded as global constants. The VBA structure definition equals to the C
structure definition. A valid procedure call would be:
Dim WaitTime
Dim OnlyAngle
Dim SlopeDistance
WaitTime = 1000
VB_TMC_GetSimpleMea( WaitTime,
Leica TPS1200 / TS30 / TM30 – Version 1.50
has to be included in the project.
data types. Since string data types of C/C++ and VBA are not
string
from the subsystem Theodolite Measurement and Calculation):
TMC_GetSimpleMea
As Long,
As TMC_HZ_V_ANG,
As Double,
As Long)
the corresponding items are defined:
As Long
As TMC_HZ_V_ANG
As Double
Fundamentals of Programming GeoCOM
includes all constants,
COM_StubsPub.bas
data types will be used instead. The
Long
14

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tm30Ts30Tps1200+

Table of Contents