GeoCOM Reference Manual
General Concepts of Using GeoCOM
Leica TPS1200 / TS30 / TM30 – Version 1.50
8
terminator). As a common shortcut ‘^m’ will be used in examples.
Example:
The following example uses the RPC CSV GetDateTime to query the current date and time of the instrument:
%R1R,5008:1^m (1^m denotes the terminator)
Note:
Additional characters at the beginning of a request, between parameters or at the end are not allowed. They
might lead to errors during interpretation.
Syntax of an ASCII reply:
%R1P,<RC_COM>[,<TrId>]:<RC>[,<P0>,<P1>, ...]<Term>
Optional items are in brackets []. The angled-brackets <> surround names or descriptions. These names have variable
values as described in the types they have. The angled-brackets themselves are not a part of the communication text.
Characters not surrounded by angled-brackets are literal text and are part of the GeoCOM protocol.
%R1P
GeoCOM reply type 1.
<RC_COM>
GeoCOM return code. This value denotes the success of the communication.
GRC_OK
= 0 means the communication was successful.
Refer to ‘3.7 Common Communication Errors’ for further information.
<TrId>
Transaction ID - identical to that of the request. If the request had no
Transaction ID then it will be 0.
:
Separator between protocol header and following parameters.
<RC>
Return code from the called RPC and denotes the successful completion if it is
set to 0 (see table ‘RPC return codes’ in the appendix for further information).
<P0>,<P1>,...
Parameter 0, Parameter 1, … These parameters will be valid only if
<GRC>
is
equal to 0 (GRC_OK).
<Term>
Terminator string (default CR/LF, use
COM_SetTerminator
to change the
terminator).
Example:
The following example shows the reply to the RPC 5008 -
CSV_GetDateTime.
%R1P,0,0:0,1996,'07','19','10','13','2f'^m
¦ ¦ ¦ ----------------------------
¦ ¦ ¦ ¦
The values for month, day, hour,
¦ ¦ ¦ +---
minute and second are replied in the byte-
¦ ¦ ¦
format (see table communication parameter
¦ ¦ ¦
for further information)
¦ ¦ +------
Return code from the RPC: 0 means
no error
¦ ¦
(see RPC return codes for further
information)
¦ +-----
The Transaction ID of the request. If there was
no ID
¦
the value returned is 0.
+----
Return code from GeoCOM: 0 means no error
(see
GeoCOM return codes for further information)
2.4
FUNCTION CALL PROTOCOL - C/C++
The implementation of GeoCOM for C/C++ conforms to normal function calls. GeoCOM itself handles all necessary
communication. No intervention of the programmer in respect to the communication is necessary with one exception. If
the GeoCOM reports a communication error the programmer has to make sure that either the problem will be solved -
by calling GeoCOM support functions - or no further RPC’s will be called - by terminating the running task.
Nevertheless, the programmer has to initialise GeoCOM and set up the port’s settings to make sure that communication
can take place. Moreover the user has to make sure that the TPS1200 instrument is well connected.
Example:
An example code fragment for using
TMC_GetSimpleMea
could be the following. We do not take care of the necessary
initialisation and set up of GeoCOM here. Please refer to chapter 3.2.3 Basic GeoCOM Application Frame for C/C++
for this information.