EasyManua.ls Logo

Newport LDS1000 - 12 Appendices; A Example of Program Using RS-232-C Link

Default Icon
77 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
EDH0170FE1010 – 09/98 62
LDS1000 Controller for Laser Diode Sensors
12 Appendices
A Example of Program Using RS-232-C Link
'LDS1000 EXAMPLE SOFTWARE, Microsoft Quick Basic V4.5
CLS
'initialisations RS-232 COM 1 with standard parameters
CHAINE$ = "COM1:9600,N,8,1,CS,DS,CD,OP3000"
OPEN CHAINE$ FOR RANDOM AS #1
'LDS1000 in remode remote
ev$ = "MR"
PRINT #1, ev$
'Example: Loop on Position Reading
env$ = "TP"
LOCATE 5, 10: PRINT "LAERS1 exemple software "
LOCATE 18, 10: PRINT "Hit any key to abort "
WHILE INKEY$ = ""
' send TP
PRINT #1, env$
' wait answer
WHILE LOC(1) = 0: WEND
' read LA510 answer
LINE INPUT #1, ret$
' conversion ASCII => numerical values
msge$ = MID$(ret$, 4)
comma = INSTR(msge$, ",")
posy$ = LEFT$(msge$, comma - 1)
posz$ = MID$(msge$, comma + 4)
posyn = VAL(posy$)
poszn = VAL(posz$)
' print result
LOCATE 10, 10: PRINT "LAE510 message: "; ret$
LOCATE 12, 20: PRINT " Y value: ";
LOCATE 12, 30: PRINT USING "+######.##"; posyn
LOCATE 13, 20: PRINT " Z value: ";
LOCATE 13, 30: PRINT USING "+######.##"; poszn
WEND
'LDS1000 in local mode
ev$ = "ML"
PRINT #1, ev$
END

Table of Contents

Related product manuals