Example Of Communication Program - Omron V670 Series User Manual

Electromagnetic inductive rfid system
Hide thumbs Also See for V670 Series:
Table of Contents

Advertisement

5-11 Example of Communication Program

Example of BASIC program
1:1 Protocol
100 '***** V670-CD1D SAMPLE PROGRAM *****
110 CLS
120 OPEN "COM:E73NN" AS #1
130 '
140 '***** MAIN LOOP ****
150 *LOOP
160
LINE INPUT "Input TX Data : ", ITD$
170
TXD$=ITD$+"*"+CHR$(13)
180
PRINT "[TX] : ";ITD$
190
PRINT #1,TXD$;
200
GOSUB *RECEIVE
210
PRINT "[RX] : ";REC$
220 GOTO *LOOP
230 '
240 '***** RECEIVE DATA *****
250 *RECEIVE
260
RXD$=" "
270
WHILE (LOC(#1)=0):WEND
280
WHILE (INSTR(RXD$,"*"+CHR$(13))=0)
290
RXD$=RXD$+INPUT$(1,#1)
300
WEND
310
REC$=LEFT$(RXD$,LEN(RXD$)-2)
320 RETRUN
330 '
340 END
'Opens a RS-232C port.
'Inputs a command data.
'Sets a data string to be sent.
'Displays a command data.
'Sends a data string.
'Receives a data string.
'Displays a response data.
'Checks a receiving buffer.
'Checks a termination code.
'Reads a received data.
'Extracts a response data.
5-25

Advertisement

Table of Contents
loading

Table of Contents