The text of a manual · part 41 of 68
Programmable Controllers C200HX-CPU-ZE, C200HG-CPU-ZE, C200HE-CPU-ZE Operation Manual: SECTION 5 Instruction Set, pages 374 to 383
Pages 374 to 383 of 613, from Programmable Controllers C200HX-CPU-ZE, C200HG-CPU-ZE, C200HE-CPU-ZE Operation Manual
The original document is the PDF (3.8 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.
Filed in the catalog under the Omron C200H-SP001 and Omron C200HW-PA204
Page 374
Section 5-27
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(090)
Operands
SEND(090) 001 LR 20
001 LR 20 DM 0010
DM 0010
15
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. The content of a word containing an indirect DM/EM address is not BCD or the DM/EM area boundary has been exceeded. There is no SYSMAC NET Link/SYSMAC LINK/PC Card/Controller Link Unit.
5-27-2 NETWORK RECEIVE – RECV(098) Operand Data Areas
Ladder Symbols
S: Source beginning word RECV(098)
@RECV(098)
S
S
D
D
C
C
IR, SR, AR, DM, EM, HR, TC, LR D: Destination beginning word IR, SR, AR, DM, EM, HR, TC, LR C: First control data word IR, SR, AR, DM, EM, 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(098), the system must have a SYSMAC NET Link, SYSMAC LINK Unit, PC Card Unit, or Controller Link Unit mounted.
Description
When the execution condition is OFF, RECV(098) is not executed. When the execution condition is ON, RECV(098) transfers data beginning at S from a node on the SYSMAC NET Link, SYSMAC LINK, Ethernet System, or Controller Link 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/Controller Link System.
362
Page 375
Section 5-27
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 to 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)
Source port NSB: 00 NSU: 01/02
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 to 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
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.
363
Page 376
Section 5-27
Network Instructions
RECV(098) 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(098) 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
364
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.
Page 377
Section 5-27
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(090). 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(098)
Operands
RECV(098) 001 LR 20
001 LR 20 DM 0010
DM 0010
15
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. The content of a word containing an indirect DM/EM address is not BCD or the DM/EM area boundary has been exceeded. There is no SYSMAC NET Link/SYSMAC LINK/PC Card/Controller Link Unit.
365
Page 378
Section 5-27
Network Instructions
5-27-3 About Network Communications SEND(090) and RECV(098) 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(090)/RECV(098) Enable Flag is not turned ON until the first END(001) 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(090)/RECV(098) operations are used, the following flags must be used to ensure that any previous operation has completed before attempting further send/receive SEND(090)/RECV(098) operations SR Flag SEND(090)/RECV(098) Enable Flags (SR 25201, SR 25204)
Functions OFF during SEND(090)/RECV(098) execution (including command response processing). Do not start a SEND(090)/RECV(098) operation unless this flag is ON.
SEND(090)/RECV(098) 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(090)/RECV(098) attempt. Error status is maintained until the next SEND(090)/RECV(098) 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(090)/RECV(098)
Data is transmitted for SEND(090) and RECV(098) for all PCs when SEND(090)/RECV(098) is executed. Final processing for transmissions/receptions is performed during servicing of Programming Devices and Link Units.
Programming Example: Multiple SEND(090)/RECV(098)
To ensure successful SEND(090)/RECV(098) operations, your program must use the SEND(090)/RECV(098) Enable Flags and SEND(090)/RECV(098) 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.
366
Page 379
Section 5-27
Network Instructions SEND(090)/RECV(098) Enable Flag 00000
25204
12802 S KEEP(011)
12801
12800 prevents execution of SEND(090) until RECV(098) (below) has completed. IR 00000 is turned ON to start transmission.
12800
R 12800
@MOV(021) #000A DM 0000 @MOV(021) #0000 DM 0001 @MOV(021) #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(070) #0010 000 DM 0010 @SEND(090) DM 0010 DM 0020 DM 0000
SEND(090)/RECV(098) Error Flag 12800
25203 00200
12800
25204 DIFU(013)
00001
25204
12801
KEEP(011) 12803
12802
R 25204
Resets 12800, above.
12800 S
12802
Turns ON to indicate transmission error.
12802 prevents execution of RECV(098) when SEND(090) above has not completed. IR 00001 is turned ON to start transmission.
25203 XFER(070)
Transmitted data moved into words beginning at DM 0030 for storage.
#0016 000 DM 0030 12802 @MOV(021) #0010 DM 0003 @MOV(021) #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(021) #007E DM 0005 @RECV(098) HR 10 LR 10
SEND(090)/RECV(098) Error Flag 12802
DM 0003
25203 00201
12802
Turns ON to indicate reception error.
25204 DIFU(013)
12803
Resets 12802, above.
367
Page 380
Section 5-28
Serial Communications Instructions Address
Instruction
00000 00001 00002 00003 00004 00005 00006
LD AND AND NOT LD KEEP(011) LD @MOV(021)
Operands 00000 25204 12802 12801 12800 12800
Address
Instruction
00019 00020 00021 00022 00023 00024 00025
AND NOT LD KEEP(011) LD AND AND NOT XFER(070)
12800 12803 12802 12802 25204 25203
#000A DM 0000 00007
@MOV(021) #0000 DM 0001
00008
00026 00027
00011 00012 00013 00014 00015 00016 00017 00018
00028
@MOV(021)
@XFER(070)
#0000 DM 0004 00029
@MOV(021) #007E DM 0005
@SEND(090) DM 0010 DM 0020 DM 0000 12800 25203 00200 12800 25204 12801 00001 25204
LD AND OUT LD AND DIFU(013) LD AND
#0016 000 DM 0030 12802 #0010 DM 0003
#0010 000 DM 0010 00010
LD @MOV(021)
@MOV(021) #0003 DM 0002
00009
Operands
00030
00031 00032 00033 00034 00035 00036
@RECV(098)
LD AND OUT LD AND DIFU(013)
HR 10 LR 10 DM 0003 12802 25203 00201 12802 25204 12803
5-28 Serial Communications Instructions 5-28-1 RECEIVE – RXD(235) Operand Data Areas
Ladder Symbols
D: First destination word RXD(235)
@RXD(235)
D
D
C
C
N
N
IR, SR, AR, DM, EM, HR, TC, LR C: Control word IR, SR, AR, DM, EM, HR, TC, LR, # N: Number of bytes IR, SR, AR, DM, EM, 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. RXD(235) is an expansion instruction. A Programming Device can be used to reassign function code 235 to another expansion instruction.
Description
When the execution condition is OFF, RXD(235) is not executed. When the execution condition is ON, RXD(235) 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.
368
Page 381
Section 5-28
Serial Communications Instructions
If fewer than N bytes are received, the amount received will be read. Note RXD(235) 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(235). Read data as soon as possible after the Reception Completed Flag is turned ON (SR 26414 for the peripheral port, SR 26406 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. The content of a word containing an indirect DM/EM address is not BCD or the DM/EM 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(235) is executed. 266:
SR 266 contains the number of bytes received at the peripheral port and is reset to 0000 when RXD(235) is executed.
369
Page 382
Section 5-28
Serial Communications Instructions
RS-232C Port 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(235) is executed. 265:
SR 265 contains the number of bytes received at the RS-232C port and is reset to 0000 when RXD(235) 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-28-2 TRANSMIT – TXD(236) Operand Data Areas
Ladder Symbols
S: First source word TXD(236)
@TXD(236)
S
S
C
C
N
N
IR, SR, AR, DM, EM, HR, TC, LR C: Control word IR, SR, AR, DM, EM, HR, TC, LR, # N: Number of bytes IR, SR, AR, DM, EM, 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) TXD(236) is an expansion instruction. A Programming Device can be used to reassign function code 236 to another expansion instruction.
Description
When the execution condition is OFF, TXD(236) is not executed. When the execution condition is ON, TXD(236) 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(236) 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(236). SR 26405: SR 26413: SR 26705: SR 26713:
370
RS-232C port Peripheral port Host Link Unit #0 Host Link Unit #1
Page 383
Section 5-28
Serial Communications Instructions Host Link Mode
Digit number:
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 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
Note Data is not output when the CTS and DSR signals are monitored. The specified number of bytes will be read from S through S+(N/2)–1, converted to ASCII, and transmitted through the specified port. The bytes of source data shown below will be transmitted in this order: 12345678...
S S+1 S+2 S+3
MSB LSB 1 2 3 4 5 6 7 8
The following diagram shows the format for host link command (TXD) sent from the PC. Depending on their settings, the C200HX/HG/HE and C200HS automatically attach the prefixes and suffixes, such as the node number, header, and FCS.
@ X
X
Node number
RS-232C Mode
X
X
X
X
.........
X
Header Data (122 ASCII characters max.) code (EX)
X
X
FCS
∗
CR
Terminator
N must be BCD from #0000 to #0256. The value of the control word determines the port from which data will be output and the order in which data will be written to memory.
371