PLC Omron Cpm2a
PLC Omron Cpm2a
PLC Omron Cpm2a
4-1 Introduction
4-1-1 Overview
CPM1/CPM1A The CPM1/CPM1A can execute a variety of communications through its periph-
Communications eral port via an RS-232C Adapter or an RS-422 Adapter.
Host Link Communications
The CPM1/CPM1A PCs are compatible with the Host Link System, which allows
up to 32 PCs to be controlled from a host computer. An RS-232C Adapter is used
for 1:1 communications and an RS-422 Adapter and B500-AL004 Link Adapter
are used for 1:N communications.
A CPM1/CPM1A equipped with an RS-232C Adapter can also communicate
with a OMRON Programmable Terminal using host link commands.
Refer to 4-2-1 CPM1/CPM1A Host Link Communications in this manual and
1-2-2 Host Link Communications in the CPM1 Operation Manual or 1-2-2 Host
Link Communications in the CPM1A Operation Manual for more details.
One-to-one PC Link
A data link can be created with a data area in another CPM1, CPM1A, CPM2A,
CPM2C, CQM1, C200HX/HG/HE, or C200HS PC. An RS-232C Adapter is used
to make the 1:1 connection.
Refer to 4-2-3 CPM1/CPM1A 1:1 PC Link Communications in this manual and
1-2-3 One-to-one PC Communications Links in the CPM1 Operation Manual or
1-2-3 One-to-one PC Communications Links in the CPM1A Operation Manual
for more details.
One-to-one NT Link
Using the 1:1 NT Link, the CPM1/CPM1A PC can connected to the OMRON
Programmable Terminal (NT Link Interface) through an RS-232C Adapter.
Refer to 4-2-2 CPM1/CPM1A 1:1 NT Link Communications in this manual and
1-2-4 One-to-one NT Link Communications in the CPM1 Operation Manual or
NT Link Communications in the CPM1A Operation Manual for more details.
CPM2A/CPM2C The following types of communications can be executed through the ports of the
Communications CPM2A/CPM2C.
• Host Link communications with a host computer
• RS-232C communications with a computer or other device
• One-to-one PC Link communications with another PC
• One-to-one NT Link communications with OMRON Programmable Terminals
This section explains the required PC Setup and methods for using these types
of communications.
SRM1(-V2) Communications The following types of communications can be executed through the ports of the
SRM1(-V2).
• Host Link communications with a host computer
• RS-232C communications with a computer or other device
• One-to-one PC Link communications with another PC
• One-to-one NT Link communications with OMRON Programmable Terminals
Note One-to-one NT Link communications are not possible with the SRM1-C01,
which is equipped with only a peripheral port. The SRM1-C01 may be connected
to a PT through an RS-232C Adapter in Host Link mode.
226
CPM1/CPM1A Communications Functions Section 4-2
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.
Note 1. If an improper setting is used, a non-fatal error will occur, AR 1302 will be
turned ON, and the default setting (0, 00, or 0000) will be used.
2. For information on the Host Link settings for another OMRON PC, refer to
that PC’s Operation Manual.
227
CPM1/CPM1A Communications Functions Section 4-2
Example Program This example shows a BASIC program that reads the status of the CPM1’s in-
puts in IR 000. For more details, refer to 4-5 Host Link Commands.
An FCS (frame check sequence) check isn’t performed on the received re-
sponse data in this program. Be sure that the host computer’s RS-232C port is
configured correctly before executing the program.
1010 ’CPM1 SAMPLE PROGRAM
1020 ’SET THE COMMAND DATA
1030 S$=”@00RR00000001”
1040 FCS=0
1050 FOR I=1 TO LEN(S$)
1060 FCS=FCS XOR ASC(MID$(S$,I,1))
1070 NEXT I
1080 FCS$=(FCS):IF LEN(FCS$)=1 THEN FCS$=”0”+FCS$
1090 CLOSE 1
1100 CLS
1110 PRINT ”SENDING COMMAND”
1120 OPEN ”COM:E73” AS #1
1130 PRINT #1,S$ + FCS + CHR$(13);
1140 CLS
1150 PRINT ”RECEIVING RESPONSE DATA”
1160 LINE INPUT #1,A$
1170 PRINT A$
1180 END
CPM1 PCs
CPM1 CPU
RS-232C Cable
228
CPM1/CPM1A Communications Functions Section 4-2
CPM1A PCs
RS-232C
OMRON Programmable Terminal Adapter CPM1A CPU Unit
RS-232C Cable
PC Setup Settings The settings relating to 1:1 NT Link PC communications must be set as shown in
the following table.
Word Bit Function Setting
DM 6650 00 to 07 Port settings1 00
00: Standard (1 start bit, 7-bit data, 2 stop bits, even parity, 9,600 bps) (Any val-
01: Settings in DM 6651 ue is OK)
08 to 11 Link area for 1:1 PC Link via peripheral port 0
0: LR 00 to LR 15 (Any val-
ue is OK)
12 to 15 Communications mode1 4
0: Host Link; 2: 1:1 PC Link Slave; 3: 1:1 PC Link Master; 4: 1:1 NT Link
Note 1. If an improper setting is used, a non-fatal error will occur, AR 1302 will be
turned ON, and the default setting (0 or 00) will be used.
2. For information on the NT Link settings for another OMRON PC, refer to that
PC’s Operation Manual.
3. If an out-of-range value is set, the following communications conditions will
result. In that case, reset the value so that it is within the permissible range.
Communications mode: Host Link
Communications format: Standard settings
(1 start bit, 7-bit data; 2 stop bits, even parity,
9,600 bps)
Transmission delay: No
Node number: 00
229
CPM1/CPM1A Communications Functions Section 4-2
CPM1/CPM1A One-to-one The following diagram shows a 1:1 PC Link between two CPM1s PCs. Refer to
PC Links the CPM1A Operation Manual for the corresponding information on the CPM1A.
RS-232C Cable
The words used for the 1:1 PC Link are as shown below.
Master Slave
LR00 LR00
Write data Area for writing Area for reading Read data
LR07 LR07
LR08 LR08
Read data Area for reading Area for writing Write data
LR15 LR15
Limitations of 1:1 PC Links Only the 16 LR words from LR 00 to LR 15 can be linked in the CPM1/CPM1A, so
with a CPM1/CPM1A use only those 16 words in the CQM1 or C200HS when making a 1:1 PC Link
with one of those PCs. A 1:1 PC Link cannot be made to a CPM1/CPM1A PC
using LR 16 through LR 63 in the CQM1, C200HX/HG/HE, or C200HS.
PC Setup Settings The settings relating to 1:1 PC Link communications must be set as shown in the
following table.
Word Bit Function Setting Setting
(Master) (Slave)
DM 6650 00 to 07 Port settings1 00 00
00: Standard (1 start bit, 7-bit data, 2 stop bits, even parity, 9,600 bps) (Any val- (Any val-
01: Settings in DM 6651 ue is OK) ue is OK)
08 to 11 Link area for 1:1 PC Link via peripheral port 0 0
0: LR 00 to LR 15 (Any val-
ue is OK)
12 to 15 Communications mode1 3 2
0: Host Link; 2: 1:1 PC Link Slave; 3: 1:1 PC Link Master; 4: 1:1 NT Link
Note 1. If an improper setting is used, a non-fatal error will occur, AR 1302 will be
turned ON, and the default setting (0 or 00) will be used.
2. For information on the 1:1 PC Link settings for another OMRON PC, refer to
that PC’s Operation Manual.
3. For information on CPM1/CPM1A 1:1 PC Link connections and wiring dia-
grams refer to 3-4-7 Host Link Connections in the CPM1 Operation Manual
or CPM1A Operation Manual. For the SRM1(-V2) refer to 3-4-4 RS-232C
Port Wiring in the SRM1 Master Control Unit Operation Manual.
4. If an out-of-range value is set, the following communications conditions will
result. In that case, reset the value so that it is within the permissible range.
Communications mode: Host Link
Communications format: Standard settings
(1 start bit, 7-bit data; 2 stop bits, even parity,
9,600 bps)
Transmission delay: No
Node number: 00
230
CPM2A/CPM2C Communications Functions Section 4-3
Example Program This example shows ladder programs that copy the status of IR 000 in each
CPM1/CPM1A to SR 200 in the other CPM1/CPM1A.
000 000
LR00 LR08
MOV(21) MOV(21)
LR08 LR00
200 200
LR00 LR00
IR 000 Write Writing area Reading area Read SR 200
LR07 LR07
LR08 LR08
SR 200 Read Reading area Writing area Write IR 000
LR15 LR15
CPM2A
Commands
Host computer
Responses
231
CPM2A/CPM2C Communications Functions Section 4-3
OMRON Programmable
Terminal
Commands
Commands
Responses
Responses
CPM2A RS-232C port connection CPM2A RS-232C port connection
(See note.) (See note.)
Note When connecting to the peripheral port, an RS-232C Adapter or computer
connection cable (CQM1-CIF01 or CQM1-CIF02) is necessary.
232
CPM2A/CPM2C Communications Functions Section 4-3
CPM2C-CN111 (0.15 m)
CPM2C-CIF01-V1
CPM2C
CPU Unit
CPM2C-CIF11
CPM2C
CPU Unit
CPM2C-CIF21
Note The CSW1-CN226/626 can be connected directly to the CPU Unit. With the
CPM2C-CIF01-V1, the cable switch (SW1) can be turned ON to enable connect-
ing to a personal computer with a CS1W-CN226/CN626 Connecting Cable.
233
CPM2A/CPM2C Communications Functions Section 4-3
Commands
or compatible Link Adapter
Responses
234
CPM2A/CPM2C Communications Functions Section 4-3
IBM PC/AT or
compatible Connecting Cable
computer XW2Z-200S-V (2 m)
XW2Z-500S-V (5 m)
NT-AL001 NT-AL001
When using (See note 1.) (See note 1.) NT-AL001 NT-AL001
the port as (See note 1.) (See note 1.)
XW2Z-070T-1 (0.7 m)
an RS-232C XW2Z-200T-1 (2 m)
RS-232C port XW2Z-070T-1 (0.7 m) XW2Z-070T-1 (0.7 m)
port XW2Z-200T-1 (2 m) XW2Z-200T-1 (2 m)
CPM2C-CIF01-V1
CPM2C-CIF21
Up to 32 PCs
235
CPM2A/CPM2C Communications Functions Section 4-3
FCS FCS
Terminator Terminator
FCS FCS
Terminator Terminator
Frame (response) Frame (response)
Slave-initiated Data transmissions from the PC to the host computer can be initiated by the CPU
Communications Unit using TXD(48).
Unit no.
Header code
CPM2A/CPM2C Text
FCS
Terminator
Frame (response)
236
CPM2A/CPM2C Communications Functions Section 4-3
@ x 101 x 100 * ↵
@
An “@” symbol must be placed at the beginning.
Node No.
Identifies the CPM2A/CPM2C PC communicating with the host computer.
Specify the CPM2A/CPM2C’s node number in the PC Setup (DM 6648,
DM 6653).
Header Code
Set the 2-character command code.
Text
Set the command parameters.
FCS
Set a 2-character Frame Check Sequence code. See page 239.
Terminator
Set two characters, “*” and the carriage return (CHR$(13)) to indicate the end of
the command.
Response Format The response from the CPM2A/CPM2C is returned in the format shown below.
Prepare a program so that the response data can be interpreted and processed.
Long Transmissions
The largest block of data that can be transmitted as a single frame is 131 charac-
ters. A command or response of 132 characters or more must therefore be di-
vided into more than one frame before transmission. When a transmission is
split, the ends of the first and intermediate frames are marked by a delimiter
instead of a terminator.
237
CPM2A/CPM2C Communications Functions Section 4-3
Dividing Commands As each frame is transmitted by the host computer, the computer waits for the
delimiter to be transmitted from the CPM2A/CPM2C. After the delimiter has
been transmitted, the next frame will then be sent. This procedure is repeated
until the entire command has been transmitted.
Text
FCS
Terminator
Frame (response)
Dividing Responses As each frame is received by the host computer, a delimiter is transmitted to the
CPM2A/CPM2C. After the delimiter has been transmitted, the CPM2A/CPM2C
will transmit the next frame. This procedure is repeated until the entire response
has been transmitted.
Frame (command)
Unit no.
Header code
Host
computer Text
FCS
Terminator Delimiter Delimiter
Unit no.
Header code Text Text
End code
FCS FCS
CPM2A/CPM2C Delimiter Terminator
Text
Frame2 (response) Frame3 (response)
FCS
Delimiter
Frame1 (response)
238
CPM2A/CPM2C Communications Functions Section 4-3
Precautions for Long When dividing commands such as WR, WL, WC, or WD that execute write op-
Transmissions erations, be careful not to divide into separate frames data that is to be written
into a single word. As shown in the illustration below, be sure to divide frames so
that they coincide with the divisions between words.
@ 0 0 W D Data ↵
x101 x100
Data * ↵
@ 1 0 R R 0 0 0 1 4 2 * ↵
@ → 40 → 0100 0000
XOR
1 → 31 → 0011 0001
XOR
0 → 30 → 0011 0000
XOR
R → 52 → 0101 0010
XOR
0 → 30 → 0011 0000
XOR
0 → 30 → 0011 0000
XOR
to
0 → 30 → 0011 0000
XOR
1 → 31 → 0011 0001
Calculation results 0100 0010
↓ ↓ Converted to hexadecimal.
4 2 Handled as ASCII characters.
239
CPM2A/CPM2C Communications Functions Section 4-3
Example Program for This example shows a BASIC subroutine program for executing an FCS check
FCS on a frame received by the host computer.
Normal reception data includes the FCS, delimiter or terminator, and so on.
When an error occurs in transmission, however the FCS or some other data may
not be included. Be sure to program the system to cover this possibility.
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
400 *FCSCHECK
410 L = LEN ( RESPONSE$ ) ’ . ........................ Data transmitted and received
420 Q = 0 : FCSCK$ = ” ”
430 A$ = RIGHT$ ( RESPONSE$ , 1)
440 PRINT RESPONSE$ , A$ , L
450 IF A$ = ”*” THEN LENGS = LEN ( RESPONSE$ ) – 3
ELSE LENGS = LEN ( RESPONSE$ ) – 2
460 FCSP$ = MID$ ( RESPONSE$ , LENGS + 1 , 2 ) ’ . ......... FCS data received
470 FOR I = 1 TO LENGS ’ . ........................ Number of characters in FCS
480 Q = ASC ( MID$ ( RESPONSE$ , I , 1 ) ) XOR Q
490 NEXT I
500 FCSD$ = HEX$ ( Q )
510 IF LEN ( FCS0$ ) = 1 THEN FCSD$ = ” 0 ” + FCSD$ ’ . ........ FCS result
520 IF FCSD$ < > FCSP$ THEN FCSCK$ = ” ERR ”
530 PRINT ” FCSD$ = ” ; FCSD$ , ” FCSP$ = ” ; FCSP$ , ” FCSCK$ = ” ; FCSCK$
540 RETURN
––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
240
CPM2A/CPM2C Communications Functions Section 4-3
Commands
Header CPM2A/CPM2C Operating Mode Name Page
g
d
code RUN MONITOR PROGRAM
RR Valid Valid Valid IR/WR/SR AREA READ 281
RL Valid Valid Valid LR AREA READ 282
RH Valid Valid Valid HR AREA READ 282
RC Valid Valid Valid TC PV READ 282
RG Valid Valid Valid TC STATUS READ 283
RD Valid Valid Valid DM AREA READ 283
RJ Valid Valid Valid AR AREA READ 284
WR Not Valid Valid Valid IR/WR/SR AREA WRITE 285
WL Not Valid Valid Valid LR AREA WRITE 285
WH Not Valid Valid Valid HR AREA WRITE 286
WC Not Valid Valid Valid TC PV WRITE 286
WG Not Valid Valid Valid TC STATUS WRITE 287
WD Not Valid Valid Valid DM AREA WRITE 288
WJ Not Valid Valid Valid AR AREA WRITE 288
R# Valid Valid Valid SV READ 1 289
R$ Valid Valid Valid SV READ 2 290
W# Not Valid Valid Valid SV CHANGE 1 291
W$ Not Valid Valid Valid SV CHANGE 2 292
MS Valid Valid Valid STATUS READ 293
SC Valid Valid Valid STATUS WRITE 294
MF Valid Valid Valid ERROR READ 295
KS Not Valid Valid Valid FORCED SET 296
KR Not Valid Valid Valid FORCED RESET 297
FK Not Valid Valid Valid MULTIPLE FORCED SET/RESET 298
KC Valid Valid Valid FORCED SET/RESET CANCEL 299
MM Valid Valid Valid PC MODEL READ 300
TS Valid Valid Valid TEST 300
RP Valid Valid Valid PROGRAM READ 301
WP Not Valid Not Valid Valid PROGRAM WRITE 301
QQ Valid Valid Valid COMPOUND COMMAND 302
XZ Valid Valid Valid ABORT (command only) 304
** Valid Valid Valid INITIALIZE (command only) 304
EX Valid Valid Not Valid TXD RESPONSE (response only) 304
IC --- --- --- Undefined command (response only) 305
241
CPM2A/CPM2C Communications Functions Section 4-3
Response Codes
End Contents Probable cause Corrective measures
code
00 Normal completion --- ---
01 Not executable in RUN mode The command that was sent can- Check the relation between the
not be executed when the PC is in command and the PC mode.
RUN mode.
02 Not executable in MONITOR mode The command that was sent can-
not be executed when the PC is in
MONITOR mode.
04 Address over The user program area’s highest Check the program.
address was exceeded.
0B Not executable in PROGRAM The command that was sent can- This code is not presently being
mode not be executed when the PC is in used.
PROGRAM mode.
13 FCS error The FCS is wrong. Either the FCS Check the FCS calculation method.
calculation is mistaken or there is If there was influence from noise,
adverse influence from noise. transfer the command again.
14 Format error The command format is wrong. Check the format and transfer the
command again.
15 Entry number data error The read/write area specification is Correct the areas and transfer the
wrong. command again.
16 Command not supported The specified command does not Check the address and instruction.
exist in the specified address.
(Reading the SV, etc.)
18 Frame length error The maximum frame length was Divide the command into multiple
exceeded. frames.
19 Not executable Items to read not registered for Execute QQ to register items to
composite command (QQ). read before attempting batch read.
23 User memory write-protected The memory is write-protected in Change the setting in the PC Setup
the PC Setup. (DM 6602).
A3 Aborted due to FCS error in trans- The error was generated while a Check for corrupted frames, correct
mit data command
co a de extending
e d go over
e more
oe if necessary,
ecessa y, and
a d tryy the
e transfer
a se
A4 Aborted due to format error in than one frame
f was being again.
transmit data executed.
A5 Aborted due to entry number data Note: The data up to that point has
error in transmit data alreadyy been written to the ap-
propriate area of the CPU Unit.
Unit
A8 Aborted due to frame length error
in transmit data
Other --- Influence from noise was received. Transfer the command again.
Application Procedure
Setting the CPU Unit’s Set the CPM2A CPU Unit’s communications switch
communications switch or the CPM2C CPU Unit’s DIP switch.
Ladder program
Commands issued from the host (Communications initiated by
computer. CPM2A/CPM2C)
242
CPM2A/CPM2C Communications Functions Section 4-3
Communications Switch The CPM2A’s communications are controlled by the communications switch on
Setting the front of the CPU Unit and the CPM2C’s communications are controlled by
the DIP switch on the front of the CPU Unit.
CPM2A Communications Switch Setting
When the communications switch is set to OFF, communications through the pe-
ripheral port and RS-232C port are governed by the settings in the PC Setup.
When the communications switch is set to ON, communications through the pe-
ripheral port and RS-232C port are governed by the standard Host Link settings
(1 start bit, 7 data bits, 2 stop bits, even parity, and 9,600 bps baud rate).
Note When a Programming Console is connected to the peripheral port, communica-
tions with the Programming Console are unaffected by either the communica-
tions switch or PC Setup.
Communications switch
243
CPM2A/CPM2C Communications Functions Section 4-3
4. Status indicators
8. Communications switch
9. Customize switch
2. Input terminals 2. Input connector
3. Output terminals
3. Output connector (8) (9)
8. Communications switch
9. Customize switch (8)
2. Input connector
3. Output connector (9)
244
CPM2A/CPM2C Communications Functions Section 4-3
Hood
One-to-N Connections
Set the DIP switch on the NT-AL001 RS-232C/RS-422 Conversion Adapter.
Normally ON
ON when the Unit is at the end of the transmission path. OFF in all other cases.
NT-AL001 RS-232C/RS-422
Conversion Adapter RS-232C port
Signal Pin No. Signal Pin No.
Hood
Note Do not connect external devices other than the NT-AL001 Conversion Adapter
to the 5 VDC power supply of pin number 6 on the CPM2A/CPM2C’s RS-232C
port. Doing so may result in damage to the CPM2A/CPM2C or to the external
device.
245
CPM2A/CPM2C Communications Functions Section 4-3
PC Setup The PC Setup settings that are required depend on whether a peripheral port or
an RS-232C port is used.
Note If SW1 on the front panel of the CPU Unit is ON, the RS-232C port will operate
with the default settings regardless of the settings in DM 6645 to DM 6649.
246
CPM2A/CPM2C Communications Functions Section 4-3
Note 1. If SW1 on the front panel of the CPU Unit is ON, the peripheral port will oper-
ate with the default settings regardless of the settings in DM 6645 to
DM 6649.
247
CPM2A/CPM2C Communications Functions Section 4-3
248
CPM2A/CPM2C Communications Functions Section 4-3
Issuing Commands from This example shows a BASIC program that reads the status of the CPM2A/
a Host Computer CPM2C’s inputs in IR 000. For more details see 4-5 Host Link Commands.
An FCS (frame check sequence) check isn’t performed on the received re-
sponse data in this program.
Be sure that the host computer’s RS-232C port is configured correctly before
executing the program.
1000 ’ ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
1010 ’ CPM2A/CPM2C Sample Program for BASIC
1020 ’
1050 ’ ––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––––
1060 ’ –––Set value RS–232C SPEED:9600BPS,PARITY:EVEN,DATA:7,STOP:2–––
1070 OPEN ”COM:E73” AS #1
1080 *REPEAT
1090 –––Transmission data input–––––––––––––––––––––––––––––––––––––––––––––––
1100 INPUT ” send data : ”,send$
1110 ’ –––FCS Calculation–––––––––––––––––––––––––––––––––––––––––––––––
1120 FCS=0
1130 FOR IFCS = 1 TO LEN ( send$ )
1140 FCS = FCS XOR ASC( MID$ ( SEND$ , IFCS , 1 ) )
1150 NEXT
1160 FCS$ = RIGHT$ ( ”0” + HEX$ ( FCS ) , 2 )
1170 ’ –––Communications execute–––––––––––––––––––––––––––––––––––––––––––––––
1180 ZZZ$ = SEND$ + SCS$ + ”*” + CHR$(13)
1190 PRINT #1 , ZZZ$ ;
1200 ’ –––Response check–––––––––––––––––––––––––––––––––––––––––––––––
1210 RECCNT = 0 : TMP$ – ””
1220 *DRECLOOP
1230 IF LOC ( 1 ) < > 0 THEN *DREC1
1240 RECCNT = RECCNT + 1
1250 IF RECCNT = 5000 THEN *DRECERR ELSE *DRECLOOP
1260 *DREC1
1270 TMP$ = TMP$ + INPUT$ ( LOC (1 ) , #1 )
1280 IF RIGHT$ ( TMP$ , 1 ) = CHR$ (13) THEN *DRECEND ELSE RECCNT = 0 : GOTO *
DRECLOOP
1290 *DRECERR
1300 TMP$ = ” No response !! ” + CHR$ ( 13 )
1310 *DRECEND
1320 PRINT ” receive data : ” ; RECV$
1340 ’ –––Go to transmission data input––––––––––––––––––––––––––––––––––––––––
1350 GOTO *REPEAT
1360 ’ –––Processing complete–––––––––––––––––––––––––––––––––––––––––––––––
1370 CLOSE #1
1380 END
249
CPM2A/CPM2C Communications Functions Section 4-3
Ladder Program The unsolicited Host Link communications are executed using TXD(48).
(Mnemonics)
Mnemonic Control Contents
(@)TXD(48) Communications port Reads data from I/O memory and transmits
output it in the specified frame format.
Host Link communications are controlled with the following AR area flags.
Unsolicited Communications
A data transmission to the host computer is initiated by the PC.
(@)TXD(48)
Communications port
0: RS-232 port; 1: Peripheral port
When Host Link communications are being used, TXD(48) converts the N-bytes
of data starting at S to ASCII, adds the Host Link header, FCS, and terminator,
and transmits this data as a Host Link frame.
The transmitted Host Link frame will be as shown in the following diagram.
Converted to ASCII.
N bytes
250
CPM2A/CPM2C Communications Functions Section 4-3
(48)
Leading address of data to be transmitted
10 bytes
RS-232C devices
RS-232C port
Peripheral port
Peripheral port
251
CPM2A/CPM2C Communications Functions Section 4-3
CPM2C Connections
CPM2C CPU Unit
RS-232C devices
Note A CPM1-CIF01 RS-232C Adapter can also be used for no-protocol communica-
tions through the peripheral port, or for a CPM2C, a CPM2C-CIF01-V1 Periph-
eral/RS-232C Adapter Unit can be used to connect to external devices. Refer to
the CPM2C Operation Manual for details.
Note 1. The start and end codes are set in DM 6648 to DM 6649 (RS-232C) or
DM 6653 to DM 6654 (peripheral port) in the PC Setup.
2. When there are several start or end codes in the transmission, the first of
each will be effective.
3. When the end code is accidentally duplicated in the transmission data and
the transmission is stopped part way through, use CR and LF as the end
code.
4. The start and end codes themselves are not transmitted and received.
Transmission Flags
When sending data from the CPM2A/CPM2C, check that the Transmission En-
able Flag is ON for executing TXD(48). The Transmission Enable Flag will turn
252
CPM2A/CPM2C Communications Functions Section 4-3
OFF while the data is being transmitted and will turn ON again when transmis-
sion is complete.
After the CPM2A/CPM2C has received data, the Receive Enable Flag turns ON.
When RXD(47) is executed, the data received will be written to the specified
words and the Reception Complete Flag will turn OFF.
Flag Peripheral port RS-232C port
Transmit Ready Flag AR 0813 AR 0805
Reception Completed Flag AR 0814 AR 0806
Note The CPM2A/CPM2C starts and completes data reception at the following
points:
Reception Start:
Start code disabled: Continually available for reception
Start code enabled: After start code is received
Reception Complete:
When either the end code, the specified no. of bytes, or 256 bytes are received.
Application Procedure
Setting the Communications switch Set the CPM2A CPU Unit’s communications switch or
the CPM2C CPU Unit’s DIP switch.
Connecting the cables Make the RS-232C connection with the serial device.
Ladder program
Communications Switch The CPM2A’s communications are controlled by the communications switch on
Setting the front of the CPU Unit and the CPM2C’s communications are controlled by
the DIP switch on the front of the CPU Unit.
CPM2A Communications Switch Setting
Turn OFF the Communications switch when using no-protocol communications.
No-protocol communications will not be possible if the communications switch is
ON.
Communications switch
253
CPM2A/CPM2C Communications Functions Section 4-3
Front View CPU Unit with Relay Out- CPU Unit with Transistor Outputs
puts via Terminal Block via Fujitsu-compatible Connector
4. Status indicators
8. Communications switch
9. Customize switch
2. Input terminals 2. Input connector
3. Output terminals
3. Output connector (8) (9)
8. Communications switch
9. Customize switch (8)
2. Input connector
3. Output connector (9)
254
CPM2A/CPM2C Communications Functions Section 4-3
lowing diagram. With the CPM2C, the CPM2C-CN111 and CS1W-CN118 con-
necting cables can be used in place of the RS-232C Adapter.
RS-232C port
Signal Pin No.
Recommended Cables
From Fujikura Densen
UL2464 AWG25X5P IFS-RVV-SB (UL-compliant)
AWG28X5P IFVV-SB (not UL-compliant)
From Hitachi
UL2464-SB (MA) 5PX28AWG (7/0.127) (UL-compliant)
CO-MA-VV-SB 5PX28AWG (7/0.127) (not UL-compliant)
PC Setup The PC Setup settings that are required depend on whether a peripheral port or
an RS-232C port is used.
Settings for RS-232C Port
Word Bit Function Setting
DM 6645 00 to 03 Port settings As required
0: Standard (1 start bit, 7-bit data, 2 stop bits, even parity, 9,600 bps; Host Link
unit number: 0)
1: Settings in DM 6646
(Other settings will cause a non-fatal error, the default setting will be used, and AR
1302 will turn ON.)
04 to07 CTS control settings
0: Disable; 1: Set
08 to 11 Link words for 1:1 PC Link Any
0: LR 00 to LR 15; Other: Not effective
12 to 15 Communications mode 1
0: Host Link; 1: No-protocol; 2: 1:1 PC Link Slave; 3: 1:1 PC Link Master; 4: 1:1 NT
Link
(Other settings will cause a non-fatal error, the Host Link setting will be used, and
AR 1302 will turn ON.)
255
CPM2A/CPM2C Communications Functions Section 4-3
Note If SW1 on the front panel of the CPU Unit is ON, the RS-232C port will operate
with the default settings regardless of the settings in DM 6645 to DM 6649.
256
CPM2A/CPM2C Communications Functions Section 4-3
Note 1. If SW1 on the front panel of the CPU Unit is ON, the peripheral port will oper-
ate with the default settings regardless of the settings in DM 6645 to
DM 6649.
2. When connecting a computer running Support Software via the peripheral
bus, turn OFF SW1 on the front panel of the CPU Unit and set DM 6650 to
0001 (Host Link). The CPU Unit will automatically switch to peripheral bus
communications for the serial communications port.
257
CPM2A/CPM2C Communications Functions Section 4-3
(@)TXD(48)
S S: Leading address of data to be transmitted
C C: Control data
N N: Number of bytes to be transmitted (BCD: 0001 to 0256)
Storage order
0: Leftmost bytes first 1: Rightmost bytes first
Communications port
0: RS-232C port 1: Peripheral port
258
CPM2A/CPM2C Communications Functions Section 4-3
(@)RXD(47)
S D: Leading address for storing reception data
C C: Control data
N N: Number of bytes to receive (BCD: 0001 to 0256)
Storage order
0: Leftmost bytes first 1: Rightmost bytes first
Communications port
0: RS-232C port 1: Peripheral port
00100
DIFU(13)
No-protocol communications start
00101
00101 AR 0805
@TXD(48)
DM 0100 First word holding send data.
#0000 Use the RS-232C port; transmit
data from leftmost bytes to right-
#0010 most bytes.
AR 0806 Transmit 10 bytes.
RXD(47)
DM 0200 First word to store received data.
Use the RS-232C port; store trans-
#0000 mitted data from leftmost bytes to
#0256 rightmost bytes.
Receive 256 bytes.
259
CPM2A/CPM2C Communications Functions Section 4-3
RS-232C cable
OMRON Programmable
Terminal
RS-232C port
260
CPM2A/CPM2C Communications Functions Section 4-3
RS-232C connection
CPM2C-CN111 (0.15 m)
OMRON
Programmable
Terminal
CS1W-CN118 (0.1 m)
RS-232C port
CPM2C-CIF01-V1
NT-AL001
RS-232C Adapter
RS-232C port
RS-232C port
CPM2C-CIF21
Note The Programmable Terminal cannot be connected using a peripheral port con-
nection when communicating via a 1:1 NT Link.
Application Procedure
Use the settings in the PC Setup (DM6645 to DM 6649) for
Setting communications. RS-232C communications.
(Turn OFF the Communications switch on the CPM2A’s CPU
Unit or pin 1 of the DIP Switch on the CPM2C’s CPU Unit.)
Communications Switch The CPM2A’s communications are controlled by the communications switch on
Setting the front of the CPU Unit and the CPM2C’s communications are controlled by
the DIP switch on the front of the CPU Unit.
261
CPM2A/CPM2C Communications Functions Section 4-3
Communications switch
ON
OFF
RS-232C port
4. Status indicators
8. Communications switch
9. Customize switch
2. Input terminals 2. Input connector
3. Output terminals
3. Output connector (8) (9)
8. Communications switch
9. Customize switch (8)
2. Input connector
3. Output connector (9)
262
CPM2A/CPM2C Communications Functions Section 4-3
PC Setup When using an NT Link with a CPM2A/CPM2C PC, the following settings must
be made to the PC Setup (DM 6645) using a Programming Device.
Recommended cables:
XW2Z-200T: 2m
XW2Z-500T: 5m
Hood Hood
263
CPM2A/CPM2C Communications Functions Section 4-3
One-to-one PC Link
CPM2A CPU Unit CPM2A CPU Unit
OMRON PC (CQM1, CPM1, CPM1A, CPM2C, OMRON PC (CQM1, CPM1, CPM1A, CPM2C,
SRM1(-V2), C200HS, or C200HX/HG/HE) SRM1(-V2), C200HS, or C200HX/HG/HE)
264
CPM2A/CPM2C Communications Functions Section 4-3
1:1 Link Master RS-232C port (D-sub 9-pin) RS-232C port (D-sub 9-pin) 1:1 Link Slave
CPM2C CPU Unit CPM2C CPU Unit
CPM2C-CN111
(0.1 m) CPM2C-CN111 (0.1 m)
Connecting Cable
XW2Z-200T (2 m)
XW2Z-500T (5 m)
CS1W-CN118 CS1W-CN118 (0.1 m)
(0.1 m)
CPM2C-CIF01-V1 CPM2C-CIF01-V1
CPM2C-CIF11 CPM2C-CIF11
OMRON PC (CQM1, CPM1, CPM1A, CPM2A, OMRON PC (CQM1, CPM1, CPM1A, CPM2A,
SRM1(-V2), C200HS, or C200HX/HG/HE) SRM1(-V2), C200HS, or C200HX/HG/HE)
Master Slave
Link bits Link bits
LR00 LR00
Write Read
Write area area Read
LR07 LR07
LR08 Read Write LR08
Read area area Write
LR15 LR15
Note Even though the peripheral port on the CPM2C-CIF01-V1 can output RS-232C, this port cannot be used for
one-to-one link communications.
265
CPM2A/CPM2C Communications Functions Section 4-3
PC Links with Other PCs The link relay area on CPM2A/CPM2C PCs is only 16 words, LR00 to LR15.
When performing a 1:1 PC Link with a CPM2A/CPM2C PC and a CQM1,
C200HS, or C200HX/HE/HG use the corresponding 16 words, LR00 to LR15 on
the CQM1, C200HS, or C200HX/HE/HG PC. A 1:1 PC Link with a CPM2A/
CPM2C PC cannot be formed using LR16 to LR 63.
Application Procedure
Use the settings in the PC Setup (DM6645 to DM 6649) for
Setting communications. RS-232C communications.
(Turn OFF the Communications switch on the CPM2A’s CPU
Unit or pin 1 of the DIP Switch on the CPM2C’s CPU Unit.)
Communications Switch The CPM2A’s communications are controlled by the communications switch on
Setting the front of the CPU Unit and the CPM2C’s communications are controlled by
the DIP switch on the front of the CPU Unit.
CPM2A Communications Switch Setting
Turn OFF the Communications switch when using 1:1 PC Link communications.
One-to-one PC Link communications will not be possible if the communications
switch is ON.
Communications switch
ON
OFF
RS-232C port
266
CPM2A/CPM2C Communications Functions Section 4-3
Front View CPU Unit with Relay Out- CPU Unit with Transistor Outputs
puts via Terminal Block via Fujitsu-compatible Connector
4. Status indicators
8. Communications switch
9. Customize switch
2. Input terminals 2. Input connector
3. Output terminals
3. Output connector (8) (9)
8. Communications switch
9. Customize switch (8)
2. Input connector
3. Output connector (9)
267
SRM1(-V2) Communications Functions Section 4-4
PC Setup When creating a 1:1 PC Link with a CPM2A/CPM2C PC, use a Programming
Device to make the following settings to the PC Setup (DM 6645) in the Master
and Slave.
Word Bit Function Master Slave
Setting Setting
DM 6645 00 to 03 Port settings Any Any
00: Standard (1 start bit, 7-bit data, 2 stop bits, even parity, 9,600 bps)
01: Settings in DM 6646
(Other settings will cause a non-fatal error, the default setting (00) will be
used, and AR 1302 will turn ON.)
04 to07 CTS control settings 0 0
0: Disable
1: Set
08 to 11 Link area for 1:1 PC Link 0 0
0: LR 00 to LR 15
(Other settings: Disabled)
12 to 15 Communications mode 3 2
0: Host Link; 1: No-protocol; 2: 1:1 PC Link Slave;
3: 1:1 PC Link Master; 4: 1:1 NT Link
(Other settings will cause a non-fatal error, the Host Link setting will be
used, and AR 1302 will turn ON.)
For information on the 1:1 PC Link settings of another OMRON PC, refer to that
PC’s Operation Manual.
Connecting the Cables This section describes the RS-232C connection.
The RS-232C cable used for 1:1 PC Links is a cross connection cable. When
there is no CTS control on the RS-232C port, the connection is made as shown
in the following diagram. With the CPM2C, the CPM2C-CN111 and CS1W-
CN118 connecting cables are used.
RS-232C port RS-232C port
Signal Pin No. Signal Pin No.
Recommended cables
XW2Z-200T: 2m
XW2Z-500T: 5m
Hood
268