Topcon .theo file
Posted: Fri Nov 25, 2011 4:48 pm
I recently had the pleasure of meeting Nigel Talamo in Indonesia. While attending to his homologation duties, he demonstrated to me how he uses the RS232 interface to upload each instrument reading from his Leica total station to Emmanuel's Homologation Program on his laptop and explained some of the workings. Inspired by what Nigel had showed me, I determined to try to connect a Topcon GTS-6A in a similar way. I have the advantage of possessing a copy of the Topcon Interface manual, which was cajoled with difficulty from a Topcon Rep some years ago. A relevant page is attached, which fully explains the format of the measurement string in slope distance mode.
I took one of the provided ".theo" files and modified it to suit the Topcon.
Like most instruments, there are a number of instrument settings which determine the form of the uploaded data string. Examples are:
There are a number of data formats; slope distance mode, horizontal distance mode, vertical and horizontal angle mode, NEZ coordinates mode and 4 others not likely to be of interest here. I usually work in slope distance mode and have developed the attached ".theo" file on that basis. Note that the horizontal distance is included in the string produced in the slope distance mode.
There is a setting which allows the user to choose whether a CR/LF sequence is output at the end of each data string. I have this switched off and have developed the attached ".theo" file on that basis.
The instrument can be set to read in metres or feet which changes the character used as a delimiter or start string for the vertical angle. I use metres and have developed the attached ".theo" file on that basis.
The instrument can be set to read angles in degrees, minutes and seconds, grads or mils. I use degrees, minutes and seconds and have developed the attached ".theo" file on that basis
In relation to the format of Emmanuel's ".theo" files, I make the following points;
The ".theo" files expects a point number. There is no point number in the Topcon string. This does not seem to be a problem.
The measurement string is sent 10 times before an error is generated at the instrument. This does not appear to upset the program. The interface manual indicates that a return sting of ASCII ACK ETX or 06h 03h will confirm the validity of the received data. Alternatively, NAK ETX or 15h 03h will denote invalid data and presumably request a re-send. I included a Return of 06h 03h in the ".theo" file. Never the less, I get 10 copies of the string followed by an error on the instrument. While annoying and requiring additional buttons to be pressed, this does not prevent the system from working.
The data order is different to the entries in the ".theo" file. I assume this does not matter if there is a unique delimiter or start string. It may matter if we have to go to position in the string to extract the horizontal angle.
In relation to the test ".theo file;
The measurement string is being read by the program using the test ".theo" file. The slope distance and vertical angle are being correctly extracted and the correct horizontal distance calculated and inserted into the correct cell.
The extraction of the horizontal angle is the main problem I need to solve. The ".theo" files expect a unique delimiter or start string for each field.The Topcon string uses "+" as a delimiter a number of times and in particular there is no unique start string for the Horizontal Angle. "+" appears at the start of slope distance, horizontal angle, horizontal distance, atmospheric correction and instrument offset. The program is finding the first "+" which occurs before the slope distance and inserting this as the horizontal angle. I need a way to identify the horizontal angle. One way could be an offset from the front of the string. Any suggestions?
It appears that I am unable to upload txt files so will include the sample data and theo file here:
;Topcon BDW 23/11/2011 for GTS-6A
[Com]
; communication parameters. Port is set by dialog from software.
; Baudrate=300 to 115200, databits(or bytesize)=8 or 7, Stopbits=1 or 2, Parity=None, Even, or Odd
;
Baudrate=1200
Databits=7
Stopbits=1
Parity=Even
[Data]
; This total station sends data like this in slope distance mode: See p5 of the interface manual for an explaination.
?+00002162m0940557+2532715d+00002156t60+14+00098
;
;
; Length represent the full length of one set of data, with all angles
; Start and end string should also be counted in length.
; if Length is variable, let it to 0 and define Start and End string
;
; Start string is used to recognize where the data starts.
; if no fix string are used, let it blank
;
; End string is used to recognize where the data ends.
; if not define, then Length should be defined: otherwise, how should I know where it stops ?
;
; Return string should be used if the theodolite needs to know that all data arrived.
;
; use {$0D} (hexadecimal) or {13} (decimal) for ascii char 13
;
Length=50
Start={$3F}
End={$03}
Return={$06}{$03}
[SlopeDistance]
; same as HorzAngle
; "?+" together make a unique start string for slope distance. It is imported correctly.
Start=?+
Length=08
Factor=1000
[VertAngle]
; same as HorzAngle
; Mode=H if 0 on horizon, V if 0 vertical
Start=m
Length=07
Factor=10000
Mode=V
[HorzAngle]
; Start is the string to recognize HorzAngle in data.
; length is the length of the portion of string where HorzAngle should be read,
; starting right after "start"
; Factor is the division factor: if data read 1234567 for angle 123.4567, then Factor should be 10000
; The "+" at the start of the horizontal angle is not unique. It is not imported correctly.
; We need an offset or some other solution.
Start=+
Length=07
Factor=10000
[PointNumber]
; Start is the string to recognize PointNumber in data.
; length is the length of the portion of string where PointNumber should be read
; starting right after "start"
; The topcon string does not have a point number.
Horizontal and Vertical Distance Mode. (1 measurement string repeated 10 times)
R+00002157m0940433+2532714d-00000154t60+14+00013R+00002157m0940433+2532714d-000
00154t60+14+00013R+00002157m0940433+2532714d-00000154t60+14+00013R+00002157m09
40433+2532714d-00000154t60+14+00013R+00002157m0940433+2532714d-00000154t60+14+0
0013R+00002157m0940433+2532714d-00000154t60+14+00013R+00002157m0940433+2532714
d-00000154t60+14+00013R+00002157m0940433+2532714d-00000154t60+14+00013R+000021
57m0940433+2532714d-00000154t60+14+00013R+00002157m0940433+2532714d-00000154t60
+14+00013
Slope Distance Mode. (1 measurement string repeated 10 times)
?+00002162m0940557+2532715d+00002156t60+14+00098?+00002162m0940557+25
32715d+00002156t60+14+00098?+00002162m0940557+2532715d+00002156t60+14+00098?+0
0002162m0940557+2532715d+00002156t60+14+00098?+00002162m0940557+2532715d+000021
56t60+14+00098?+00002162m0940557+2532715d+00002156t60+14+00098?+00002162m09405
57+2532715d+00002156t60+14+00098?+00002162m0940557+2532715d+00002156t60+14+0009
8?+00002162m0940557+2532715d+00002156t60+14+00098?+00002162m0940557+2532715d+0
0002156t60+14+00098
I took one of the provided ".theo" files and modified it to suit the Topcon.
Like most instruments, there are a number of instrument settings which determine the form of the uploaded data string. Examples are:
There are a number of data formats; slope distance mode, horizontal distance mode, vertical and horizontal angle mode, NEZ coordinates mode and 4 others not likely to be of interest here. I usually work in slope distance mode and have developed the attached ".theo" file on that basis. Note that the horizontal distance is included in the string produced in the slope distance mode.
There is a setting which allows the user to choose whether a CR/LF sequence is output at the end of each data string. I have this switched off and have developed the attached ".theo" file on that basis.
The instrument can be set to read in metres or feet which changes the character used as a delimiter or start string for the vertical angle. I use metres and have developed the attached ".theo" file on that basis.
The instrument can be set to read angles in degrees, minutes and seconds, grads or mils. I use degrees, minutes and seconds and have developed the attached ".theo" file on that basis
In relation to the format of Emmanuel's ".theo" files, I make the following points;
The ".theo" files expects a point number. There is no point number in the Topcon string. This does not seem to be a problem.
The measurement string is sent 10 times before an error is generated at the instrument. This does not appear to upset the program. The interface manual indicates that a return sting of ASCII ACK ETX or 06h 03h will confirm the validity of the received data. Alternatively, NAK ETX or 15h 03h will denote invalid data and presumably request a re-send. I included a Return of 06h 03h in the ".theo" file. Never the less, I get 10 copies of the string followed by an error on the instrument. While annoying and requiring additional buttons to be pressed, this does not prevent the system from working.
The data order is different to the entries in the ".theo" file. I assume this does not matter if there is a unique delimiter or start string. It may matter if we have to go to position in the string to extract the horizontal angle.
In relation to the test ".theo file;
The measurement string is being read by the program using the test ".theo" file. The slope distance and vertical angle are being correctly extracted and the correct horizontal distance calculated and inserted into the correct cell.
The extraction of the horizontal angle is the main problem I need to solve. The ".theo" files expect a unique delimiter or start string for each field.The Topcon string uses "+" as a delimiter a number of times and in particular there is no unique start string for the Horizontal Angle. "+" appears at the start of slope distance, horizontal angle, horizontal distance, atmospheric correction and instrument offset. The program is finding the first "+" which occurs before the slope distance and inserting this as the horizontal angle. I need a way to identify the horizontal angle. One way could be an offset from the front of the string. Any suggestions?
It appears that I am unable to upload txt files so will include the sample data and theo file here:
;Topcon BDW 23/11/2011 for GTS-6A
[Com]
; communication parameters. Port is set by dialog from software.
; Baudrate=300 to 115200, databits(or bytesize)=8 or 7, Stopbits=1 or 2, Parity=None, Even, or Odd
;
Baudrate=1200
Databits=7
Stopbits=1
Parity=Even
[Data]
; This total station sends data like this in slope distance mode: See p5 of the interface manual for an explaination.
?+00002162m0940557+2532715d+00002156t60+14+00098
;
;
; Length represent the full length of one set of data, with all angles
; Start and end string should also be counted in length.
; if Length is variable, let it to 0 and define Start and End string
;
; Start string is used to recognize where the data starts.
; if no fix string are used, let it blank
;
; End string is used to recognize where the data ends.
; if not define, then Length should be defined: otherwise, how should I know where it stops ?
;
; Return string should be used if the theodolite needs to know that all data arrived.
;
; use {$0D} (hexadecimal) or {13} (decimal) for ascii char 13
;
Length=50
Start={$3F}
End={$03}
Return={$06}{$03}
[SlopeDistance]
; same as HorzAngle
; "?+" together make a unique start string for slope distance. It is imported correctly.
Start=?+
Length=08
Factor=1000
[VertAngle]
; same as HorzAngle
; Mode=H if 0 on horizon, V if 0 vertical
Start=m
Length=07
Factor=10000
Mode=V
[HorzAngle]
; Start is the string to recognize HorzAngle in data.
; length is the length of the portion of string where HorzAngle should be read,
; starting right after "start"
; Factor is the division factor: if data read 1234567 for angle 123.4567, then Factor should be 10000
; The "+" at the start of the horizontal angle is not unique. It is not imported correctly.
; We need an offset or some other solution.
Start=+
Length=07
Factor=10000
[PointNumber]
; Start is the string to recognize PointNumber in data.
; length is the length of the portion of string where PointNumber should be read
; starting right after "start"
; The topcon string does not have a point number.
Horizontal and Vertical Distance Mode. (1 measurement string repeated 10 times)
R+00002157m0940433+2532714d-00000154t60+14+00013R+00002157m0940433+2532714d-000
00154t60+14+00013R+00002157m0940433+2532714d-00000154t60+14+00013R+00002157m09
40433+2532714d-00000154t60+14+00013R+00002157m0940433+2532714d-00000154t60+14+0
0013R+00002157m0940433+2532714d-00000154t60+14+00013R+00002157m0940433+2532714
d-00000154t60+14+00013R+00002157m0940433+2532714d-00000154t60+14+00013R+000021
57m0940433+2532714d-00000154t60+14+00013R+00002157m0940433+2532714d-00000154t60
+14+00013
Slope Distance Mode. (1 measurement string repeated 10 times)
?+00002162m0940557+2532715d+00002156t60+14+00098?+00002162m0940557+25
32715d+00002156t60+14+00098?+00002162m0940557+2532715d+00002156t60+14+00098?+0
0002162m0940557+2532715d+00002156t60+14+00098?+00002162m0940557+2532715d+000021
56t60+14+00098?+00002162m0940557+2532715d+00002156t60+14+00098?+00002162m09405
57+2532715d+00002156t60+14+00098?+00002162m0940557+2532715d+00002156t60+14+0009
8?+00002162m0940557+2532715d+00002156t60+14+00098?+00002162m0940557+2532715d+0
0002156t60+14+00098