Annexe
4 :
1 !*****************************
2 !****** Gab
Antenne 1.0 ******
3 !*****************************
5 Debut: !
6 Ar=814
7 Vauto$="2"
30 GOSUB Init
31 INPUT "Entrer nom fichier ",Fic$
32 CREATE Fic$&".txt",10
33 ASSIGN @Path_1
TO Fic$&".txt"
40 GOSUB Auto
41 CLEAR SCREEN
60 STOP
70 Init: !sequence
d'initialisation
80 ASSIGN @Hp8714
TO 800
90 OUTPUT @Hp8714;"SYST:PRES;
*WAI"
100 OUTPUT @Hp8714;"SENS1:STAT
ON; *WAI"
110 OUTPUT @Hp8714;"SENS1:FUNC
'XFR:POW:RAT 2,0';DET NBAN; *WAI"
120 OUTPUT @Hp8714;"DISP:ANN:FREQ1:MODE
SSTOP"
130 OUTPUT @Hp8714;"DISP:ANN:FREQ1:MODE
CW;:SENS1:FREQ:SPAN 0 HZ;;*WAI"
140 OUTPUT @Hp8714;"SENS1:FREQ:CENT
400000000 HZ;*WAI"
150 OUTPUT Ar;"disp:prog
full;*wai"
151 OUTPUT Ar;"syst:comm:ser:tran:baud
9600"
152 OUTPUT Ar;"syst:comm:ser:tran:hand
xon"
154 WAIT 1
155 PRINT TABXY(20,11),"*****************************"
157 PRINT TABXY(20,12),"******
Gab Antenne 1.0 ******"
158 PRINT TABXY(20,13),"*****************************"
159 PRINT TABXY(20,15),"Created
by Frederic LUROIS"
160 PRINT TABXY(15,17),"Copyright 1999 IUT
de Cergy-Pontoise."
161 PRINT TABXY(15,18),"Tous droits reserves"
163 WAIT 4
164 CLEAR SCREEN
166 PRINT "/"
170 PRINT "init du HP8714B"
180 PRINT "effectuee"
181 PRINT "/"
190 WRITEIO
9,0;NUM("i")
191 WAIT 1
193 Lire: !lecture du RS232
194 PRINT "waiting..."
195 Recev=READIO(9,0)
196 Rcpt$=CHR$(Recev)
197 WHILE Rcpt$<>"i"
198 GOTO Lire
199 END WHILE
200 PRINT "init du moteur"
201 PRINT "effectuee"
202 PRINT "/"
212 Position=0
250 RETURN
360 Auto: !Mode
de mesure auto
361 PRINT "mode auto active"
362 PRINT "/"
363 First=1
365 WRITEIO
9,0;NUM("v")
366 WRITEIO
9,0;NUM(Vauto$)
367 Saisie: !
370 INPUT "pas des mesures ?",Pas1$
371 IF Pas1$<>"a"
THEN
372 IF VAL(Pas1$)<10
THEN
373 PRINT "valeur trop faible"
374 GOTO Saisie
375 END IF
378 Convpas:
!
379 WHILE LEN(Pas1$)<>3
380 Pas1$="0"&Pas1$
381 END WHILE
382 P1$=Pas1$[1,1]
383 P2$=Pas1$[2]
384 P3$=Pas1$[3]
385 PRINT "pas de",Pas1$,"degres"
386 PRINT "/"
!
387 ELSE
388 P1$="0"
389 P2$="1"
390 P3$="0"
391 END IF
392 Mesure: !
396 IF First=1
THEN
397 First=0
398 GOTO Enregist
399 END IF
401 WRITEIO
9,0;NUM("p")
402 WRITEIO
9,0;NUM("d")
403 WRITEIO
9,0;NUM(P1$)
404 WRITEIO
9,0;NUM(P2$)
405 WRITEIO
9,0;NUM(P3$)
409 Angle=((NUM(P1$)-48)*100)+((NUM(P2$)-48)*10)+(NUM(P3$)-48)
411 Messages:
!attente d'une reponse du 68hc11
414 Recev=READIO(9,0)
415 Rcpt$=CHR$(Recev)
416 SELECT Rcpt$
417 CASE "p"
418 Position=Position+Angle
419 CLEAR SCREEN
422 PRINT TABXY(20,12),"mesure en cours"
423 PRINT TABXY(20,13),"position atteinte
"&VAL$(Position)
424 Enregist: !
425 OUTPUT Ar;"calc1:mark1
on"
426 OUTPUT Ar;"calc1:mark1:y?;*wai"
427 ENTER Ar;Mes
428 OUTPUT @Path_1;VAL$(Position)
429 OUTPUT @Path_1
USING "#,DDDDDD.D,/";Mes
431 IF (359-Position)<=0
THEN
432 PRINT TABXY(20,14),"mesures
terminees"
433 ASSIGN @Path_1
TO *
435 GOTO Commande
436 END IF
437 IF (359-Position)<Angle
THEN
438 Pas1$=VAL$(359-Position)
439 GOTO Convpas
441 END IF
442 GOTO Mesure
443 CASE "e"
444 Recev=READIO(9,0)
732 Rcpt$=CHR$(Recev)
733 SELECT Rcpt$
734 CASE "1"
735 PRINT "temperature
trop elevee"
736 GOTO Commande
738 CASE "2"
739 PRINT "courant
ds moteur trop eleve"
740 GOTO Commande
742 CASE "3"
743 PRINT "moteur
patine"
744 GOTO Commande
746 CASE "4"
747 PRINT "erreur !!"
748 PRINT "entrer une commande valide"
749 GOTO Commande
751 CASE ELSE
752 PRINT "erreur inconnue"
753 GOTO Commande
755 END SELECT
756 CASE ELSE
759 GOTO Messages
760 END SELECT
761 RETURN
769 Commande: !
779 INPUT "nouvelle mesure ?",Comm$
789 IF Comm$="o"
THEN
799 GOTO Debut
809 ELSE
810 PRINT TABXY(20,16),"Arret
du programme"
819 GOTO Fin
829 END IF
839 Fin: !
900 END