Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeContact

The text of a manual · part 36 of 60

C200HX/C200HG/C200HE Programmable Controllers Operation Manual, pages 344 to 353

Pages 344 to 353 of 586

The original document is the PDF (3.4 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Omron C200HE-CPU42-E

Page 344

Section 5-26

Network Instructions C-series PCs Designation Area

Controller Link Systems

IR area

Area code 00

Word number 0 to 511

LR area

06

0 to 63

HR area

07

0 to 99

SR area

08

0 to 27

Timer area (PV) 03

0 to 511

DM area

0 to 6655

05

CV-series PCs have a larger area than C200HX/HG/HE PCs, so the beginning words for sending and receiving at destination nodes cannot always be directly specified by means of SEND(192) and RECV(193) operands. Moreover, depending on circumstances, it may be desirable to change the beginning word at destination nodes. In such cases, set the “Direct/Indirect” control data designation to “1” (Indirect), and specify the beginning words for sending as described below. The beginning receive word is determined by the contents of the destination node’s D and D+1 words.

@SEND(90) S: Source node beginning send word D: Destination node beginning receive word C: Source node first control data word

S D C

D

1514131211109 8 7 6 5 4 3 2 1 0 Area code* 0 0 0 0

Word address (5th digit)

D+1

Word address (1st digit) Word address (2nd digit) Word address (3rd digit) Word address (4th digit)

Note Specify the area code according to the following table. Destination node: C200HX/HG/HE PC Area

Destination node: CV-series PC Code

Area

Code

IR (Internal Relay)

00

CIO

00

LR (Link Relay)

06

CPU Bus Link

01

HR (Holding Relay)

07

Auxiliary

02

AR (Auxiliary Relay)

08

Timer

03

TC (Timer/Counter)

03

Counter

04

05

DM (Data Memory)

10 to 17 28 to 2F 18

EM (Expansion DM)

DM (Data Memory) EM (Expansion DM)

326

Banks 0 to 7 Banks 8 to 15 Current bank

05 Banks 0 to 7 Current bank

10 to 17 18

Page 345

Section 5-26

Network Instructions Examples

This example is for a SYSMAC NET Link System. When 00000 is ON, the following program transfers the content of IR 001 through IR 005 to LR 20 through LR 24 on node 10.

00000

Address

Instruction

00000 00001

LD SEND(90)

Operands

SEND(90) 001 LR 20 DM 0010

15

LR DM

001 20 0010

Node 10

0

DM 0010

0

0

0

5

IR 001

LR 20

DM 0011

0

0

0

0

IR 002

LR 21

DM 0012

0

0

0

A

IR 003

LR 22

IR 004

LR 23

IR 005

LR 24

Flags

00000

ER:

The specified node number is greater than 126 in a SYSMAC NET Link System, greater than 62 in a SYSMAC LINK System, or greater than 127 in an Ethernet or Controller Link System. The sent data overruns the data area boundaries. Indirectly addressed DM word is non-existent. (Content of word is not BCD, or the DM area boundary has been exceeded.) There is no SYSMAC NET Link/SYSMAC LINK/PC Card/Controller Link Unit.

5-26-2 NETWORK RECEIVE – RECV(98) Operand Data Areas

Ladder Symbols

S: Source beginning word RECV(98)

@RECV(98)

S

S

D

D

C

C

IR, SR, AR, DM, HR, TC, LR D: Destination beginning word IR, SR, AR, DM, HR, TC, LR C: First control data word IR, SR, AR, DM, HR, TC, LR

Limitations

C through C+2 must be within the same data area and must be within the values specified below. To be able to use RECV(98), the system must have a SYSMAC NET Link, SYSMAC LINK Unit, or PC Card Unit mounted.

Description

When the execution condition is OFF, RECV(98) is not executed. When the execution condition is ON, RECV(98) transfers data beginning at S from a node on the SYSMAC NET Link, SYSMAC LINK, Ethernet System to words beginning at D. The control words, beginning with C, provide the number of words to be received, the source node, and other transfer parameters. The status of bit 15 of C+1 determines whether the instruction is for a SYSMAC NET Link System or a SYSMAC LINK/Ethernet System.

327

Page 346

Section 5-26

Network Instructions Control Data Ethernet Systems

Refer to the PC Card Unit Operation Manual for details. Word C C+1

Bits 00 to 07 Bits 08 to 15 Number of words (0 to 1000 in 4-digit hexadecimal, i.e., 0000hex to 03E8hex) Response time limit (0.1 and 25.4 Bits 08 to 11: seconds in 0.1 s increments in No. of retries (0 to 15 in 2-digit hexadecimal without hexadecimal, decimal point, i.e., 01hex to FFhex) i.e., 0hex to Fhex) Default is 00hex (2 seconds)

C+2

SYSMAC NET Link Systems

Source node (0 to 127 in 2-digit hexadecimal, i.e., 00hex to 7Fhex)*

Bit 12

ON: Direct source beginning word designation OFF: Indirect designation

Bit 13

ON: Response not returned. OFF: Response returned.

Bit 14

ON: Operating level 0 OFF: Operating level 1

Bit 15: Set to 1. Bits 08 to 12: Unit address of source node. Set to 00hex. Bits 13 to 15: Set to 0.

The source port number is always set to 0. Set the network number to 0 to receive data to a node on the same Subsystem (i.e., network). Refer to the SYSMAC NET Link System Manual for details. Word C C+1

Bits 00 to 07 Bits 08 to 15 Number of words (0 to 1000 in 4-digit hexadecimal, i.e., 0000hex to 03E8hex) Network number (0 to 127 in 2-digit Bit 12 ON: Direct source hexadecimal, i.e., 00hex to 7Fhex) beginning word designation OFF: Indirect designation Bit 14

ON: Operating level 0 OFF: Operating level 1 Bits 08 to 11, 13 and 15: Set to 0. C+2

SYSMAC LINK Systems

Source node (1 to 126 in 2-digit hexadecimal, i.e., 01hex to 7Ehex)

Refer to the SYSMAC LINK System Manual for details. Word C

Bits 00 to 07 Bits 08 to 15 Number of words (0 to 256 in 4-digit hexadecimal, i.e., 0000hex to 0100hex)

C+1

Response time limit (0.1 and 25.4 seconds in 2-digit hexadecimal without decimal point, i.e., 00hex to FFhex) Note: The response time will be 2 seconds if the limit is set to 0hex. There will be no time limit if the time limit is set to FFhex.

C+2

328

Source port NSB: 00 NSU: 01/02

Source node (0 to 62 in 2-digit hexadecimal, i.e., 00hex to 3Ehex)

Bits 08 to 11: No. of retries (0 to 15 in hexadecimal, i.e., 0hex to Fhex) Bit 12

ON: Direct source beginning word designation OFF: Indirect designation

Bit 13:

Set to 0.

Bit 14

ON: Operating level 0 OFF: Operating level 1

Bit 15:

Set to 1.

Set to 0.

Page 347

Section 5-26

Network Instructions

RECV(98) receives “m” words beginning with S (the beginning word for data transmission at the destination node, M) to the words from D (the beginning word for data reception at the source node) onwards.

Controller Link Systems

Source node 15

0

D m

@RECV(98) S D C

Destination node M 0

15 S

L

“m” number of send words

L

S: Destination node beginning send word D: Source node beginning receive word C: Source node first control data word

1514

0

C

“m” number of send words 0000 to 03DE (Hex): 0 to 990 words 0: Source network address not specified (local network) 1: Source network address specified. 1514131211 C+1 1

87

0

Response monitor time Number of retries 00 (Hex): 2 s (for 2 Mbps) 0 to F (Hex): 0 to 15 retries 4 s (for 1 Mbps) Direct/Indirect 8s (for 500 Kbps) 0: Direct; 1: Indirect 01 to FE (Hex): 0.1 to 25.4 s (unit: 0.1 s) 0: Response required 1: Response not required FF (Hex): No response monitoring 0: Operating level 1 1: Operating level 0 Always “1” for Controller Link Networks 15

87

0

C+2

Destination (transmission source) unit address 00 (Hex): PC’s CPU Unit 01 (Hex): Computer (user program) 10 to 1F (Hex): Unit nos. 0 to 15 FE (Hex): Unit connected to network 15 C+3

Destination (transmission source) node address (M) 00 to 20 (Hex): 0 to 32 The range of node addresses will vary for networks other than Controller Link Networks.

0 0

0

Destination network address 00 (Hex): Local network 01 to 7F (Hex): 1 to 127 This setting is enabled only when “Destination network address specified” is set in word C. When specifying the destination network address, set all the nodes in the routing tables. For details on the routing tables, refer to the section on network interconnections in the Controller Link Unit Operation Manual (W309).

Note

1. When communicating in the same network with CV-series PCs manufactured prior to April 1996, the local network address cannot be set to “00.” Set a number other than “00” as the local network address in the routing tables, and then specify that number.

329

Page 348

Section 5-26

Network Instructions

2. With the message service, there is no guarantee that a message to a destination node will reach its destination. It is always possible that the message may be lost in transit due to noise or some other condition. When using the message service, it is advisable to prevent this situation from occurring by performing resend processing at the node where instructions are issued. With the SEND, RECV, and CMND(194) instructions, resend processing is performed automatically once the number of retries has been set, so be sure to specify a number other than “0” for the number of retries.

Indirect Destination Beginning Word Designations D is used to specify the sourced beginning word when indirect specification is designated using the same designations as those used for the destination beginning word for SEND(90). Examples

This example is for a SYSMAC NET Link System. When 00000 is ON, the following program transfers the content of IR 001 through IR 005 to LR 20 through LR 24 on node 10.

00000

Address

Instruction

00000 00001

LD RECV(98)

Operands

RECV(98) 001 LR 20 DM 0010

15

LR DM

001 20 0010

Node 10

0

DM 0010

0

0

0

5

IR 001

LR 20

DM 0011

0

0

0

0

IR 002

LR 21

DM 0012

0

0

0

A

IR 003

LR 22

IR 004

LR 23

IR 005

LR 24

Flags

00000

ER:

The specified node number is greater than 126 in a SYSMAC NET Link System, greater than 62 in a SYSMAC LINK System, or greater than 127 in an Ethernet or Controller Link System. The received data overflows the data area boundaries. Indirectly addressed DM word is non-existent. (Content of word is not BCD, or the DM area boundary has been exceeded.) There is no SYSMAC NET Link/SYSMAC LINK/PC Card/Controller Link Unit.

330

Page 349

Section 5-26

Network Instructions

5-26-3 About Network Communications SEND(90) and RECV(98) are based on command/response processing. That is, the transmission is not complete until the sending node receives and acknowledges a response from the destination node. Note that the SEND(90)/RECV(98) Enable Flag is not turned ON until the first END(01) after the transmission is completed. Refer to the SYSMAC NET Link System Manual or SYSMAC LINK System Manual for details about command/response operations. If multiple SEND(90)/RECV(98) operations are used, the following flags must be used to ensure that any previous operation has completed before attempting further send/receive SEND(90)/RECV(98) operations SR Flag SEND(90)/RECV(98) Enable Flags (SR 25201, SR 25204)

Functions OFF during SEND(90)/RECV(98) execution (including command response processing). Do not start a SEND(90)/RECV(98) operation unless this flag is ON.

SEND(90)/RECV(98) Error Flags (SR 25200, SR 25203)

OFF following normal completion of SEND/RECV (i.e., after reception of response signal) ON after an unsuccessful SEND(90)/RECV(98) attempt. Error status is maintained until the next SEND(90)/RECV(98) operation. Error types: Time-out error (command/response time greater than 1 second) Transmission data errors

Timing Successful send/receive execution Send/receive error Instruction received

Transmission completes normally

Instruction Transmission received error

Instruction received

Data Processing for SEND(90)/RECV(98)

Data is transmitted for SEND(90) and RECV(98) for all PCs when SEND(90)/RECV(98) is executed. Final processing for transmissions/receptions is performed during servicing of peripheral devices and Link Units.

Programming Example: Multiple SEND(90)/RECV(98)

To ensure successful SEND(90)/RECV(98) operations, your program must use the SEND(90)/RECV(98) Enable Flags and SEND(90)/RECV(98) Error Flags to confirm that execution is possible. The following program shows one example of how to do this for a SYSMAC NET Link System.

331

Page 350

Section 5-26

Network Instructions SEND(90)/RECV(98) Enable Flag 00000

25204

12802 S KEEP(11)

12801

12800 prevents execution of SEND(90) until RECV(98) (below) has completed. IR 00000 is turned ON to start transmission.

12800

R 12800

@MOV(21) #000A DM 0000 @MOV(21) #0000 DM 0001 @MOV(21) #0003 DM 0002

Data is placed into control data words to specify the 10 words to be transmitted to node 3 in operating level 1 of network 00 (NSB).

XFER(70) #0010 000 DM 0010 @SEND(90) DM 0010 DM 0020 DM 0000

SEND(90)/RECV(98) Error Flag 12800

25203 00200

12800

25204 DIFU(13)

00001

25204

12801

KEEP(11) 12803

12802

R 25204

Resets 12800, above.

12800 S

12802

Turns ON to indicate transmission error.

12802 prevents execution of RECV(98) when SEND(90) above has not completed. IR 00001 is turned ON to start transmission.

25203 XFER(70)

Transmitted data moved into words beginning at DM 0030 for storage.

#0016 000 DM 0030 12802 @MOV(21) #0010 DM 0003 @MOV(21) #0000 DM 0004

Data moved into control data words to specify the 16 words to be transmitted from node 126 in operating level 1 of network 00 (NSB).

@MOV(21) #007E DM 0005 @RECV(98) HR 10 LR 10

SEND(90)/RECV(98) Error Flag 12802

DM 0003

25203 00201

12802

25204 DIFU(13)

332

Turns ON to indicate reception error.

12803

Resets 12802, above.

Page 351

Section 5-27

Serial Communications Instructions Address

Instruction

00000 00001 00002 00003 00004 00005 00006

LD AND AND NOT LD KEEP(11) LD @MOV(21)

00007

00008

00009

Operands 00000 25204 12802 12801 12800 12800 # DM

000A 0000

# DM

0000 0001

# DM

0003 00002

#

0010 000 0002

00019 00020 00021 00022 00023 00024 00025

AND NOT LD KEEP(11) LD AND AND NOT XFER(70)

Operands 12800 12803 12802 12802 25204 25203 # DM

00026 00027

LD @MOV(21)

@MOV(21) 00028

00029

LD AND OUT LD AND DIFU(13) LD AND

00030

00031 00032 00033 00034 00035 00036

# DM

0010 0003

# DM

0000 0004

# DM

007E 0005

HR LR DM

10 10 0003 12802 25203 00201 12802 25204 12803

@MOV(21)

@SEND(90) 0010 0020 0000 12800 25203 00200 12800 25204 12801 00001 25204

0016 000 0030 12802

@MOV(21)

@XFER(70)

DM DM DM 00011 00012 00013 00014 00015 00016 00017 00018

Instruction

@MOV(21)

DM 00010

Address

@RECV(98)

LD AND OUT LD AND DIFU(13)

5-27 Serial Communications Instructions 5-27-1 RECEIVE – RXD(––) Operand Data Areas

Ladder Symbols

D: First destination word RXD(––)

@RXD(––)

D

D

C

C

N

N

IR, SR, AR, DM, HR, TC, LR C: Control word IR, SR, AR, DM, HR, TC, LR, # N: Number of bytes IR, SR, AR, DM, HR, TC, LR, #

Limitations

D and D+(N÷2)–1 must be in the same data area. N must be BCD from #0000 to #0256.

Description

When the execution condition is OFF, RXD(––) is not executed. When the execution condition is ON, RXD(––) reads N bytes of data received at the peripheral port, and then writes that data in words D to D+(N÷2)–1. Up to 256 bytes of data can be read at one time. If fewer than N bytes are received, the amount received will be read.

333

Page 352

Section 5-27

Serial Communications Instructions

Note RXD(––) is required to receive data via the peripheral port or RS-232C port only. Transmission sent from a host computer to a Host Link Unit are processed automatically and do not need to be programmed. ! Caution

Control Word Digit number:

The PC will be incapable of receiving more data once 256 bytes have been received if received data is not read using RXD(––). Read data as soon as possible after the Reception Completed Flag is turned ON (SR 26414 for the peripheral port, SR26406 for the RS-232C port). The value of the control word determines the port from which data will be read and the order in which data will be written to memory.

3 2 1 0

Byte order

0: Most significant bytes first 1: Least significant bytes first

CTS and DSR signal monitoring 0: Don’t monitor CTS and DSR signals. 1: Monitor the CTS signal. (Output to bit 15 of D.) 2: Monitor the DSR signal. (Output to bit 15 of D.) 3: Monitor the CTS and DSR signals. (Output to bits 15 and 14 of D.) Auxiliary reception port (when DR-15 is 0.) 0: Internal RS-232C port 1: Communications port A 2: Communications port B Port

0: RS-232C port 1: Peripheral port

The order in which data is written to memory depends on the value of digit 0 of C. Eight bytes of data 12345678... will be written in the following manner: Digit 0 = 0

D D+1 D+2 D+3

Flags

ER:

MSB LSB 1 2 3 4 5 6 7 8

Digit 0 = 1

D D+1 D+2 D+3

MSB LSB 2 1 4 3 6 5 8 7

The CPU Unit is not equipped with an RS-232C port. Another device is not connected to the specified port. There is an error in the communications settings (PC Setup) or the operand settings. Indirectly addressed DM word is non-existent. (Content of word is not BCD, or the DM area boundary has been exceeded.) The destination words (D to D+(N÷2)–1) exceed the data area.

Peripheral Port 26414: SR 26414 will be turned ON when data has been received normally at the peripheral port and will be reset when the data is read using RXD(––) is executed. 266:

SR 266 contains the number of bytes received at the peripheral port and is reset to 0000 when RXD(––) is executed.

RS-232C Port

334

Page 353

Section 5-27

Serial Communications Instructions

26406: SR 26406 will be turned ON when data has been received normally at the peripheral port and will be reset when the data is read using RXD(––) is executed. 265: SR 265 contains the number of bytes received at the RS-232C port and is reset to 0000 when RXD(––) is executed. Note Communications flags and counters can be cleared either by specifying 0000 for N or using the Port Reset Bit (SR 25208 for peripheral port and SR 25209 for RS-232C port).

5-27-2 TRANSMIT – TXD(––) Operand Data Areas

Ladder Symbols

S: First source word TXD(––)

@TXD(––)

S

S

C

C

N

N

IR, SR, AR, DM, HR, TC, LR C: Control word IR, SR, AR, DM, HR, TC, LR, # N: Number of bytes IR, SR, AR, DM, HR, TC, LR, #

Limitations

S and S+(N÷2)–1 must be in the same data area. N must be BCD from #0000 to #0256. (#0000 to #0061 in host link mode)

Description

When the execution condition is OFF, TXD(––) is not executed. When the execution condition is ON, TXD(––) reads N bytes of data from words S to S+(N÷2)–1, converts it to ASCII, and outputs the data from the specified port. TXD(––) operates differently in host link mode and RS-232C mode, so these modes are described separately. Note The following flags will be ON to indicate that communications are possible through the various ports. Be sure the corresponding flag is ON before executing TXD(––). SR 26405: SR 26413: SR 26705: SR 26713:

Host Link Mode

Digit number:

RS-232C port Peripheral port Host Link Unit #0 Host Link Unit #1

N must be BCD from #0000 to #0061 (i.e., up to 122 bytes of ASCII). The value of the control word determines the port from which data will be output, as shown below. 3 2 1 0

Byte order

0: Most significant bytes first 1: Least significant bytes first

CTS and DSR signal monitoring (see note) 0: Don’t monitor CTS and DSR signals. 1: Monitor the CTS signal. (Output to bit 15 of D.) 2: Monitor the DSR signal. (Output to bit 15 of D.) 3: Monitor the CTS and DSR signals. (Output to bits 15 and 14 of D.) Auxiliary reception port (when DR-15 is 0.) 0: Internal RS-232C port 1: Communications port A 2: Communications port B Port

0: RS-232C port 1: Peripheral port 2: Specifies Host Link Unit #0 3: Specifies Host Link Unit #1

335