Omron C200HS Garage Door Opener User Manual


 
379
TXD(––) instruction. In all other cases, data transmission based on a
TXD(––) instruction will be given first priority.
Application Example This example shows a program for using the RS-232C port in the Host Link
mode to transmit 10 bytes of data (DM 0000 to DM 0004) to a computer. From
DM 0000 to DM 0004, “1234” is stored in every word.
The default values are assumed for all of the PC Setup (i.e., the RS-232C port is
used in Host Link mode, the node number is 00, and the standard communica-
tions parameters are used.)
@TXD
DM 0000
#0000
#0010
00100SR 26405
If SR 26405 (the Transmit Ready Flag) is ON
when IR 00100 turns ON, the ten bytes of
data (DM 0000 to DM 0004) will be trans-
mitted.
The following type of program must be prepared in the host computer to receive
the data. This program allows the computer to read and display the data re-
ceived from the PC while a host link read command is being executed to read
data from the PC.
10 ’C200HS SAMPLE PROGRAM FOR EXCEPTION
20 CLOSE 1
30 CLS
40 OPEN “COM:E73” AS #1
50 :KEYIN
60 INPUT “DATA ––––––––”,S$
70 IF S$=” ” THEN GOTO 190
80 PRINT “SEND DATA = ”;S$
90 ST$=S$
100 INPUT “SEND OK? Y or N?=”,B$
110 IF B$=”Y” THEN GOTO 130 ELSE GOTO :KEYIN
120 S$=ST$
130 PRINT #1,S$ Sends command to PC
140 INPUT #1,R$ Receives response from PC
150 PRINT “RECV DATA = ”;R$
160 IF MID$(R$,4,2)=”EX” THEN GOTO 210 ’Identifies command from PC
170 IF RIGHT$(R$,1)<>”:” THEN S$=” ”:GOTO 130
180 GOTO :KEYIN
190 CLOSE 1
200 END
210 PRINT “EXCEPTION!! DATA”
220 GOTO 140
The data received by the computer will be as shown below. The FCS is “59.”
“@00EX1234123412341234123459:CR
8-2-5 RS-232C Communications
This section explains RS-232C communications. By using RS-232C commu-
nications, the data can be printed out by a printer or read by a bar code reader.
Handshaking is not supported for RS-232C communications.
Note The leftmost two digits of DM 6645 and/or DM 6650 must be set to 10 to enable
the RS-232C communications. Also, set the rightmost two digits of DM 6645 and
DM 6655 and all digits of DM 6646 and DM 6656 to the required communications
parameters before attempting to use Host Link communications.
Parameters for Host Link and RS-232C Communications
Section 8-2