Appendix d-sample terminal programs, Sample terminal programs – Measurement Computing Micro 488/EX rev.2.1 User Manual
Page 215

Appendix D
Sample Programs
D.1
Sample Terminal Programs
The following program can be used to interact directly from a PC's keyboard with
the Micro488/EX. Hardware handshaking is accomplished directly to the 8250 UART
in the PC as Basic does not support the handshaking process. The program initalizes
the Micro488/EX to…
Use only CR for the serial output terminator.
Set a time out value of 10 seconds
Disable the ID character
Disable Error Reporting
Define a special error reporting macro which re-installs itself at execution
Installs the Error Reporting macro to execute on an error.
From then on, any keys which are typed at the keyboard are printed to the PC's
screen and set out the serial port to the Micro488/EX. Any data returned from the
Micro488/EX is printed to the PC's screen. Errors are automatically reported and
cleared.
100 '
110 ' Hardware Handshake Terminal
120 '
130 CLS
140 OPEN "com1:9600,n,8,2,ds,cd" AS 1
150 ' MCR = Modem Control Register
160 MCR = &H3FC : RTSON = INP(MCR) : RTSOFF = RTSON + &H2
170 'set the serial output terminator to CR only
180 PRINT#1,"sterm cr"
190 ' enable a timeout of 10 seconds
200 PRINT#1,"time out 10"
210 ' disable the ID character
220 PRINT#1,"ID;"
230 ' turn error reporting off
240 PRINT#1,"error off"
250 ' define a macro to execute on error detection
260 PRINT#1,"macro 4"
270 PRINT#1,"com '";CHR$(7);"\'"
280 PRINT#1,"status1"
290 PRINT#1,"on error domacro 4"
300 PRINT#1,"endm"
310 ' enable Macro #4 to execute on error detection
320 PRINT#1,"on error domacro 4"
330 '