Appendices; Example Of Program Using Rs-232-C Link - Newport LDS1000 User Manual

Controller for laser diode sensors
Table of Contents

Advertisement

LDS1000
12

Appendices

EDH0170FE1010 – 09/98
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
Controller for Laser Diode Sensors
62

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents