The PSION Organiser II Homepage
Forum Home Forum Home Help Help Search Search Members Members Login Login Register Register

Welcome, Guest. Please Login or Register.
Why register?
   The Psion Organiser II Forum
   User Forum
   Post reply ( Re: Communication between PsionII and surveying Instr )
Post reply
Full name:
Message icon:
Add Smileys:
Disable Smilies:

Check this if you'll be adding code (or don't like smileys).

Before submitting, please enter the verification code in the box below.

Topic Summary - Displaying all posts. Click here to show the reduced amount
Posted by: Nick Kostelidis Posted on: Jan 28th, 2019, 7:53pm
Martin CHR$(3) is the ETX (end of text) character and is added to all control characters we send to Topcon instrumens. That is described in Topcon interface manual.
That works.
For leica instruments this is not necessary.
When I added this to the end of control characters that I send to leica instrument the routine didn't work.
But now you gave me an idea.
I ll try to send control characters to South instrument without add the chr$(3) to the end.
Maybe it works.
Posted by: MartinReid Posted on: Jan 28th, 2019, 7:16pm
Dear Nick
I'm struggling with the parts of the comms routines that are not needed.
Can we have a go at stripping out all the surplus stuff. Then work out what each of the remaining bits are doing when it works; then we can look for substitutes for the 'South'
I think the following 'Test' should work, can you test it on all the instruments you have.
If/When it works can you make a note of the values received in
LOCAL I%,M%,V%,data$(60),RBS$(240),SDFC$(8),C$(6),F$(253),DT$(57)
CLS :BEEP 250,250
PRINT "Ready? [EXE]"
I%=ADDR(Code$)+1 :POKEB I%,$3F :POKEB I%+1,23 :POKEB I%+2,$39 :USR(I%,0)  
CLS : PRINT "Choose..."
IF M%<1 : STOP : ENDIF :REM Trap On/Clear
IF M%=2 : GOTO TopCon:: :ENDIF :Rem jump past Leica
REM Leica::
REM Send control characters
LPRINT "SET/137/0" :LPRINT "SET/135/0" :LPRINT "SET/136/0" :LPRINT "SET/149/0"  
LPRINT "SET/171/0" :LPRINT "SET/40/0"
REM Get and View rubbish String
RBS$=LINPUT$:(50) : CLS : PRINT "RBS$ =" : V%=VIEW(2,RBS$)
REM Send ready to receive values
REM Get and View data values as data string
REM ------------------------------------
REM Send control characters
SDFC$="Z34093"+CHR$(3) :REM what is the CHR$(3) for?
REM Send ready to receive values
REM Get rubbish String
F$=LINPUT$:(57) : CLS : PRINT "F$ =" : V%=VIEW(2,F$)
REM Get and View data values as data string
DT$=LINPUT$:(57) :V%=VIEW(3,DT$)
Posted by: Nick Kostelidis Posted on: Jan 28th, 2019, 2:18pm
Hi again Martin.
This routine is a part of data collecting program.
I forgot to delete all unnecessary variables.
Yes sldist$ is Slope Distance
  vangle$ is vertical angle
  hangle$ is horizontal angle
data$ is the string that the organizer receives from the instrument
I%=ADDR(Code$)+1 :POKEB I%,$3F :POKEB I%+1,23 :POKEB I%+2,$39 :USR(I%,0)
I have got this line - routine from this site.
I just copied and I add this line to all my programs that has to do with communication with external devices (surveying instruments - PC).
And yes it is is about forcing the CommsLink software to load.
And yes Code$ is an empty string. If I don't declare this variable I can't translate this program.
 "SET/137/0" detects the type of the string that the instrument sends and yes generaly LPRINT "SET/137/0" etc.. are control codes settings for the Leica.
LPRINT "GET/M/WI21/WI22/WI31" is the command that makes the instrument to send a string with horizontal angle , vertical angle and slope distance.
Posted by: MartinReid Posted on: Jan 26th, 2019, 7:02pm
Dear Nick
I'm trying to get my head round your leica: routine.
-------------------------- (a)
I'm assuming you are planning to use the following variable later.
a$(1) ?
b$(3) ?
sldist$(10) - Slope Distance ?
vangle$(10) - vertical angle ?
hangle$(10) - horizontal angle ?
data$(80) ?
B% ?
--------------------------- (b)
I don't see any 'jump' for Start1::
--------------------------- (c)
I'm assuming the line
I%=ADDR(Code$)+1 :POKEB I%,$3F :POKEB I%+1,23 :POKEB I%+2,$39 :USR(I%,0)
is about forcing the CommsLink software to load
--------------------------- (d)
But what is the value of Code$ ? Best I can see is it is an empty string "".
--------------------------- (d)
I get LSET
--------------------------- (e)
I assume that the LPRINT "SET/137/0" etc.. are control codes settings for the Leica
--------------------------- (f)
I assume that LPRINT "c" is a clear to receive code.
and that rbs$=LINPUT$: (50) is abut clearing any input / output buffer
--------------------------- (g)
explain ... LPRINT "GET/M/WI21/WI22/WI31"
I get the rest.
Posted by: Nick Kostelidis Posted on: Jan 24th, 2019, 7:48pm
Hello Martin.
I have tested this routine with a Leica TS06 total station.
I just corrected the smileys.
Sorry for that mistake.
I am still trying to make communication routines for south total station.
Best regards.
Posted by: MartinReid Posted on: Jan 24th, 2019, 7:41pm
Dear Nick
Does that mean you have it sorted? I can't make head nor tail of your listing with all those smileys.
I have sent some surveying programmes (thanks to Peter thesourcerer) to Jaap in the hope that he will put them on his web-site. If he does then you may be able to try them out in Jape and maybe find some tips for connecting to instruments.
Jaap has a routine listed (bin2opl) that may be useful in examining the code if you find something useful.
Posted by: Nick Kostelidis Posted on: Jan 24th, 2019, 6:18pm
GLOBAL a$(1),b$(3),sldist$(10),vangle$(10),hangle$(10),data$(80),rbs$(240)
GLOBAL B%,I%,HA,VA,Dist,Code$(4)
I%=ADDR(Code$)+1 :POKEB I%,$3F :POKEB I%+1,23 :POKEB I%+2,$39 :USR(I%,0)
LPRINT "SET/137/0" :LPRINT "SET/135/0" :LPRINT "SET/136/0" :LPRINT "SET/149/0"
LPRINT "SET/171/0" :LPRINT "SET/40/0"  
rem LPRINT "SET/161/0"
LPRINT "c" :rbs$=LINPUT$: (50)
print "Ha :";HA
print "V :";VA
print "Dist :";Dist
lprint "c"
This is a communication routine between Psion II and Leica surveying instruments.
Posted by: Nick Kostelidis Posted on: Dec 19th, 2018, 2:24pm
Hello to all.
Does any one knows what is the pin connection between
leica surveying instruments and PC?
Thank you.
Posted by: Nikos_Athens Posted on: Dec 2nd, 2018, 7:02pm
I am Nick Kostelidis.
I had made this membership (Nick_Kostelidis) many years ago.
Two years ago I wanted to ask for something here but I had forgoten my user name.So  I asked Mikesan to make a new membership for me with user name "Nikos Athens".
A few weeks ago I was watching the members list and I found my old username. So I use my old username sometimes in ordrer to keep it "alive".  
Now as far as the South - Psion II communication is concerned, I am very disappointed. South instrument's behavior is very nondescript.
As I told you I have made comms routines for Topcon instrumens, for Sokkia - Sokkisha instruments and for Nikon instruments too.
The instruments of these brands have a normal behavior as is being written in instruction manuals. I remember sometime I had a problem with Topcon communication, I asked for help from the company and they helped very much. I send emails to South company in china , in India , in USA but I take no answer.
Anyway. I ll see what I will do.
In any case I thank you for your help.
All the best.
Nikolaos (Nikos) Kostelidis.
Posted by: MartinReid Posted on: Dec 2nd, 2018, 6:20pm
Dear Nikos
Read this...
Search Wikipedia for "Acknowledgement (data networks)"
Read this - particularly the Transfer details section
Checkout handshaking here... and see if you're receiving anything!
Then let me know what you think.
PS what relationship to Nick_Kostelidis - Athens Greece
Posted by: Nikos_Athens Posted on: Dec 2nd, 2018, 5:37pm
Hello again Martin.
There are two choises for Protocol in South intstruments settings.
1) Ack/Nak 2) One Way
Psion protocol choises are 0(NONE) , 1(XMODEM) , 2(PSION).
What have I to do?
Posted by: Nikos_Athens Posted on: Nov 14th, 2018, 1:59pm
Thank you very much Martin for your help.
I'll let you know if I have some success.
Have a nice evening.
Posted by: MartinReid Posted on: Nov 14th, 2018, 1:43pm
Dear Nikos
I'm back now; I got a little distracted with the other stuff.
(1) Page 132 of your manual has the COMM PARAMETERS
(2) I see the setting for LSET: (1200,2,7,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,2) in the routine
LSET:(Baud%,Parity%,Bits%,Stop%,Hand%,Echo%,Width%,Reol$,Reof$,Rtrn$,Teo l$,Teof$,Ttrn$,Timeout%,Protocol%)
Baud%  1200
Parity% 2 (EVEN)
Bits% 7 (7 BIT DATA)
Stop% 1 (1 STOP BIT)
Hand%  0 (NONE)
Echo%  0 (LOCAL)
Protocol%  2 (PSION)
You will have checked that the (comms parameters) and (lset) values are the same. Also I was of the opinion that PSION protocol expected CL.exe (or Psi2Win) to take control over all other handshaking etc. I can't imagine that the total station has PSION protocol, that would be the first one I would change after checking the Baud rate.
Z32091_ may be a code specific to the Top Con, something like - be ready to send! It may be a different code on the South
I assume you have consulted (3) Real time communication on Page 167
I'll leave it with you for a while
Sincerely and in good faith
Posted by: Nikos_Athens Posted on: Nov 14th, 2018, 1:28pm
Never is too late Martin.
I still use PsionII LZ to collect data from surveying instruments.
And I do my work much better with my software than the software of instruments.
So start to modify all your software now.
Posted by: MartinReid Posted on: Nov 14th, 2018, 12:29pm
on Nov 14th, 2018, 1:22am, jaap wrote:
Atran can be found here:

Yes I saw that.. thanks Jaap
I've just read the operating txt, very interesting, it's been there all this time (Barcelona 9-11-90) and I never knew. What use would I have made of GOSUB?
Posted by: Nikos_Athens Posted on: Nov 14th, 2018, 9:59am
Thank you very much Jaap
Posted by: jaap Posted on: Nov 14th, 2018, 1:22am
Atran can be found here:
Posted by: Nikos_Athens Posted on: Nov 13th, 2018, 3:03pm
Hello again Martin.
There is no GOSUB or RETSUB command in OPL indeed.
But there is a compiler that is made by a man from Spain I think.
I have found this compiler in this site many years ago.
It is called ATRAN.EXE.
It is an msdos exe file and compiles opl files to ob3.
You have to type for example ATRAN topcon -a and produces a topcon.ob3 file from
topcon.opl .
I don't know how to attach this file here.
If you would like to have this compiler please tell me how to attach it here.
Posted by: MartinReid Posted on: Nov 13th, 2018, 1:57pm
Dear Nikos
Check the settings in Data Transfer pages 131 to 136.
I'm at a loss to how the routine above TRANSlated. To my knowledge there is no GOSUB or RETSUB in OPL!
Posted by: Nikos_Athens Posted on: Nov 13th, 2018, 1:04pm
You can download the operation manual from the folowing address. 20Manual.PDF
In last pages of this manual you can find communication info.
Thank you again.
Posted by: Nikos_Athens Posted on: Nov 13th, 2018, 12:41pm
Hello again Martin.
The folowing routine works perfect with Topcon instruments.
LOCAL C$(6),AK$(6),DT$(57),HDF$(8),HDFC$(8)  
LOCAL SDF$(8),SDFC$(8),Z12$(8),DD$(8),BC$(4),F$(253),data$(60),BCC$(4)
LOCAL V$(9),HA$(9),sd$(9),sd,Vang,Hangle  
LOCAL b%,i%,q%,s%,b1%,b2%
CLS :BEEP 250,250  
PRINT "Press the [EXE] key"  
LSET: (1200,2,7,1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,2)  
pause 5  
F$=LINPUT$: (57)  
DT$=LINPUT$: (57)  
dt$=left$(data$,45) :bc$=mid$(data$,46,3) :gosub bcc::  
if bc$<>bcc$
goto daterr::
LSET: (9600,2,7,1,0,0,-1,-1,-1,-1,-1,-1,CHR$(9)+" ",-1,2)  
ha$=mid$(dt$,20,7) :v$=mid$(dt$,12,7) :sd$=mid$(dt$,4,7)  
ha$=left$(ha$,3)+"."+mid$(ha$,4,4) :v$=left$(v$,3)+"."+mid$(v$,4,4)  
sd=val(sd$) :vang=val(v$) :Hangle=val(ha$)  
cls :beep 500,500  
print "H angle :";Hangle  
print "V angle :";vang  
print "Distance :";sd  
B%=0 :I%=0        
B1%=Q% AND (NOT B%)  
B2%=B% AND (NOT Q%)  
B%=B1% OR B2%  
  UNTIL I%=LEN(dt$)  
print "Comms error"  
I have read the operating manual of my South instrument.
Settings and strings that must be send to instrument is exactly the same. When I send the string to South instrument the instrument starts to measure.
But it doesn't send back the meaurment to Psion II.
Posted by: MartinReid Posted on: Nov 13th, 2018, 11:52am
Dear Nikos
I think this is very promising for a 1980's organiser to be 'talking' to a 2009 Surveying Instrument.
I think we may get some clues from the 'comms section' of the South NTS 360 manual, can you log in to their web-site and see if you can get a PDF of the manual then we can have a look. Or you could scan the appropriate section of your manual and post it so we can have a look.
When we were connecting an LZ to a pen plotter (to plot the survey plans) we had to mess with DIP switches ( to get the correct pins to align. Have a look at Japp's Comms Link Manual (1989) pin assignments in the Adaptors section. It looks like pin 3 is transmitting but maybe pin 2 in not playing nicely. The manual may confirm the pins.
Also, If we were able to set the '2 Communications parameters' on the comms link - does your communication routine for the Topcon instruments reset them. Understanding this may help by either setting the parameters in the routine or in the comms link. You could check this by (making a record and) setting the parameters and seeing if they are altered after connecting to the South.
Is the 'routine for Topcon instruments' written in OPL or is it translated (OB3). We could see if that is setting parameters.
Check out Jaaps - software by others
DumpPack CM/XP/LZ Boris Cornet Transfer pack via comms link to an OPK file on PC
bin2opl PC ?    Converts machine code into an OPL procedure.
If you have access to an older IBM PC with a COM1 port then the Developer Kit Manual (1989) section 5. Loading a pack to the PC: UNMAKE shows how we can break this pack into its component files. So we can look to see if it is setting parameters.
Anyway that's enough to be going on with
Sincerely and in good faith.
Posted by: Nikos_Athens Posted on: Nov 12th, 2018, 5:50pm
Hello MartinReid.
First of all thank you for your reply.
The model of my South total station is NTS 365.
Is NTS 360 series.
As I have written in my first post, I have a routine for Topcon instruments comminication. When I use this routine with my South total station, the instrument takes the signal from my psion II (lz) and starts to measure. But doesn't send the measurment back to Psion as it happens with Topcon instruments.
Posted by: MartinReid Posted on: Nov 12th, 2018, 5:36pm
Dear Nikos
Post the model number of your south total station.
(1) the thesourcerer gave me some data packs with different surveying software on them. I can look though their set-up options and look for a South.
(2) I've found the Souths manuals page but need a log ID to download your manual so I can look at the comms port.
Check out Jaaps manuals..
(a) NRG Surveys Software
Setting Up Instruments to Transmit
all Wild instruments
Geotronics instruments
opcon GTS3B
Sokkisha or Pentax instruments
(b) National Survey Software's LZ Engineer
there is a section.. Using a total station
You can try LZ Engineer in Jape and look in the options setting for a South
Anyway I'll look on the data packs when I can
Sincerely and in good faith
Martin Reid
Posted by: Nikos_Athens Posted on: Nov 11th, 2018, 5:12pm
Hello. I am looking for a sample routing to communicate Psion II with my South total station (surveying instrument).I have one routine like this to communicate Psion II with Topcon, Nikon and Sokkisha total stations. It supposed that routine for Topcon total stations would work with South but it doesn't. Can anyone helps.
Thank you.

The Psion Organiser II Forum » Powered by YaBB 1 Gold - SP 1.1!
YaBB 2000-2002,
Xnull. All Rights Reserved.