User Manual
Table Of Contents
- V670 Series
- Introduction
- Contents
- Structure of This Manual
- Chapter 1 Features and System Configuration
- Chapter 2 Specifications and Performance
- Chapter 3 Setting and Installation
- Chapter 4 Functions
- Chapter 5 Control From Host Device
- Chapter 6 How to Use Self-Execution Mode
- Chapter 7 How to Use Programming Console
- Chapter 8 From Startup to Run
- Chapter 9 Characteristic Data Depending on Operating Condition (Reference)
- Appendix
5-25
Example of BASIC program
An example of program to operate Type V670-CD1D in NEC PC-9801 Series.
1:1 Protocol
100 ’***** V670-CD1D SAMPLE PROGRAM *****
110 CLS
120 OPEN “COM:E73NN” AS #1 ’Opens a RS-232C port.
130 ’
140 ’***** MAIN LOOP ****
150 *LOOP
160 LINE INPUT “Input TX Data : “, ITD$ ’Inputs a command data.
170 TXD$=ITD$+”*”+CHR$(13) ’Sets a data string to be sent.
180 PRINT “[TX] : “;ITD$ ’Displays a command data.
190 PRINT #1,TXD$; ’Sends a data string.
200 GOSUB *RECEIVE ’Receives a data string.
210 PRINT “[RX] : “;REC$ ’Displays a response data.
220 GOTO *LOOP
230 ’
240 ’***** RECEIVE DATA *****
250 *RECEIVE
260 RXD$=” “
270 WHILE (LOC(#1)=0):WEND ’Checks a receiving buffer.
280 WHILE (INSTR(RXD$,”*”+CHR$(13))=0) ’Checks a termination code.
290 RXD$=RXD$+INPUT$(1,#1) ’Reads a received data.
300 WEND
310 REC$=LEFT$(RXD$,LEN(RXD$)-2) ’Extracts a response data.
320 RETRUN
330 ’
340 END
5-11 Example of Communication Program










