Lakeshore Learning Materials 622 Manuale Utente Pagina 88

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 90
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 87
Lake Shore Model 620/622/623/647 Magnet Power Supply User’s Manual
Mainframe Control Bus Operation
B-4
B7.0 CONTROL BUS SERIAL INTERFACE SAMPLE PROGRAM
The following PC program is an interactive program that prompts the user for a Mainframe command and
displays the Mainframe response. The command must include a query for the Mainframe to respond.
'This QuickBasic 4.0 program is for an IBM PC or compatible. Enter the
'Mainframe command at the prompt. The Mainframe response then displays.
'"END" exits the program.
COUNT = 1000
TERM$ = CHR$(13) + CHR(10)
OPEN "com1:9600,o,7,1,RS" FOR RANDOM AS #1 LEN = 256
L1: INPUT "ENTER COMMAND (END TO EXIT):", CMD$
CMD$ = UCASE$(CMD$)
IF CMD$ = "END" THEN CLOSE #1: END
PRINT #1, CMD$ + TERM$
IF INSTR(CMD$, "W") <> 0 OR INSTR(CMD$, "XD") <> 0 OR INSTR(CMD$, "?") <> 0 THEN
RS$=""
N=0
WHILE (N < COUNT) AND ((INSTR(RS$, TERM$) = 0) OR (RS$ = "")
R$ = INPUT$(LOC(1), #1)
IFR$=""THENN=N+1ELSEN=0
RS$=RS$+R$
WEND
IF RS$ <> "" THEN
RS$ = MID$(RS$, 1, (INSTR(RS$, TERM$) - 1))
PRINT "RESPONSE:"; RS$
ELSE
PRINT "NO RESPONSE"
END IF
END IF
GOTO L1
END
Vedere la pagina 87
1 2 ... 83 84 85 86 87 88 89 90

Commenti su questo manuale

Nessun commento