No-Protocol Communications Settings And Procedures - Omron CQM1H - PROGRAM Programming Manual

Programmable controllers; inner boards
Table of Contents

Advertisement

Communications Functions
1-6-3

No-protocol Communications Settings and Procedures

PC Setup Settings
10 'CQM1H 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$
140 INPUT #1,R$
150 PRINT "RECV DATA = ";R$
160 IF MID$(R$,4,2)="EX" THEN GOTO 210
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"
This section explains the PC Setup settings and procedure required for No-
protocol communications. No-protocol communications allow data to be
exchanged with standard devices. For example, data can be output to a
printer or input from a bar code reader.
Be sure to write 10 in the leftmost digits of DM 6645 (RS-232C port) or
DM 6650 (peripheral port) to specify No-protocol communications. Other
communications parameters are set in the rightmost two digits of DM 6645/
DM 6650 and DM 6646/DM 6651.
The start and end codes or the amount of data to be received can be set as
shown in the following diagrams if required for no-protocol communications.
This setting is required only for no-protocol communications. These settings
are valid only when pin 5 on the DIP Switch is OFF.
Enabling Start and End Codes
DM 6648: RS-232C port
DM 6653: Peripheral port
End code
0: Not set (Amount of reception data specified.)
1: Set (End code specified.)
2: CR/LF
Start code
0: Not set
1: Set (Start code specified.)
Defaults: No start or end code (Specify number of bytes to receive.)
Specify whether or not a start code is to be set at the beginning of the data,
and whether or not an end code is to be set at the end. Instead of setting the
end code, it is possible to specify the number of bytes to be received before
the reception operation is completed. Both the codes and the number of bytes
of data to be received are set in DM 6649 or DM 6654.
Section 1-6
'Sends command to PC
'Receives response from PC
'Identifies command from PC
15
0
Bit
0
0
53

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sysmac cqm1h seriesSysmac cqm1h-cpu series

Table of Contents