95
Communications Functions Section 1-9
data received from the PC while a host link read command is being executed
to read data from the PC.
10 ’CQM1 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. (FCS is “59.”)
“@00EX1234123412341234123459*CR
”
1-9-4 CPM1/CPM1A Host Link Communications
Host link communications were developed by OMRON for the purpose of con-
necting PCs and one or more host computers by RS-232C cable, and control-
ling PC communications from the host computer. Normally the host computer
issues a command to a PC, and the PC automatically sends back a response.
Thus the communications are carried out without the PCs being actively
involved. The PCs also have the ability to initiate data transmissions when
direct involvement is necessary.
In general, there are two means for implementing host link communications.
One is based on C-mode commands, and the other on FINS (CV-mode) com-
mands. The CPM1/CPM1A supports C-mode commands only. For details on
host link communications, refer to SECTION 6 Host Link Commands.
PC Setup Settings The CPM1/CPM1A’s peripheral port settings must be set properly in order to
use the host link communications, as shown in the following table.
Word Bit Function Setting
DM 6650 00 to 07
Port settings
1
00: Standard (1 start bit, 7-bit data, even parity, 2 stop bits, 9,600 bps)
01: Settings in DM 6651
00
08 to 11 Link area for one-to-one PC link via peripheral port
0: LR 00 to LR 15
0
(Any value
is OK)
12 to 15
Communications mode
1
0: Host link; 2: One-to-one PC link (slave); 3: One-to-one PC link (master); 4: NT link
0