GeoCOM Reference Manual
General Concepts of Using GeoCOM
Leica TPS1200 / TS30 / TM30 – Version 1.50
7
2
G
ENERAL
C
ONCEPTS OF
U
SING
G
EO
COM
2.1
INTRODUCTION
Here we will describe several aspects of using GeoCOM. One of them is how to execute a function at a TPS1200
instrument.
The current implementation of GeoCOM supports two (three) kinds of usage. We can distinguish between a rather
rudimentary ASCII protocol and a high-level function call interface.
The former - ASCII protocol - is made up of requests and replies. Using GeoCOM in this way means that an application
assembles a request, sends it over the serial line to the listening TPS1200 instrument, wait for the answer and decode
the received reply.
The latter uses normal function calls either in C/C++ or in VBA. For explanation purposes we will split it into two
categories because the two supported programming environments differ in relation to their type systems. Using
GeoCOM in this way means calling a function. GeoCOM will handle any necessary communication implicitly.
2.2
GENERAL CONCEPT OF OPERATION
Fundamentally, GeoCOM is implemented as a point-to-point communication system. The two communication
participants are known as the client (external device) and the server (TPS1200 instrument). One communication unit
consists of a request and a corresponding reply. Hence, one communication takes place when the client sends a request
to the server and the server sends a reply back to the client.
Picture 2-1: Basic communication
GeoCOM is implemented as synchronous communication. A request/reply pair cannot be interrupted by another
request/reply. Instead, a communication unit must be completed successfully before a new communication unit may be
initiated. An indicator for completion is the receiving of the return code.
Although the ASCII protocol allows sending the next request before the corresponding reply has been received, it is not
recommended to do that. Of course, subsequent request will be buffered when the previous request has not been
finished so far. But if the buffer content reaches its limit in size then data may be lost.
2.3
ASCII PROTOCOL
In sequence we will define the syntax first and then give some information about how to use the ASCII protocol to call
a function on the TPS1200 instrument.
The ASCII protocol is a line protocol; hence it uses a line terminator to distinguish between different requests (replies).
One request must be terminated by one terminator.
2.3.1
ASCII Protocol Syntax
Syntax of an ASCII request:
[<LF>]%R1Q,<RPC>[,<TrId>]:[<P0>][,<P1>,...]<Term>
Optional items are in brackets []. The angled-brackets <> surround names or descriptions. These names have variable
values depending on their types and meanings. The angled-brackets themselves are not part of the transferred text.
Characters not surrounded by brackets are literal text and are part of the GeoCOM protocol.
<LF>
An initial line feed clears the receiver buffer.
%R1Q
GeoCOM request type 1.
<RPC>
Remote Procedure Call identification number in between 0 to 65535.
<TrId>
Optional transaction ID: normally incremented from 1 to 7. Same value in
reply.
:
Separator between protocol header and following parameters.
<P0>,<P1>,...
Parameter 0, Parameter 1, ...
<Term>
Terminator string (default CR/LF, use
COM_SetTerminator
to change the
request
Client
Server
reply