The text of a manual · part 35 of 60
C200HX/C200HG/C200HE Programmable Controllers Operation Manual, pages 334 to 343
Pages 334 to 343 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 334
Section 5-25
Special Instructions
D+1 contains the bit address code of the input condition, as shown below. The word addresses, bit numbers, and TC numbers are in binary. Data area
D+1 bit status 15
14
13
12
11
10
09
IR, SR (see note c)
1
0
0
0
Word address
08
07
06
05
04
Bit number
03
02
01
1
0
1
0
Word address
Bit number
HR
1
0
0
1
1
Word address
Bit number
LR
1
0
0
1
0
0
Word address
Bit number
TC*
1
0
0
1
0
1
*
00
Timer or counter number
Note a) *For the TC area, bit 09 of D+1 indicates whether the number is a timer or counter. A 0 indicates a timer, and a 1 indicates a counter. b) The status of the leftmost bit of the bit number (bit 03) is reversed. c) Although the same word address designations are used for both ranges, bit 13 is turned OFF to indicate IR 00000 through SR 25515 and turned ON to indicate SR 25600 through IR 51115 Example: If D + 1 contains 1000 0110 0100 1000, IR 10000 would be indicated as follows: 1000 0110 0100 1000 IR
$64 = 100
Bit 00 (inverting status of bit 03)
2. Bit address and message output (used when bit 15 of C is ON). Bit 15 of D indicates whether or not there is bit address information stored in D+1 to D+3. If there is, bit 14 of D indicates whether the input condition is normally open or closed. Refer to the following table. Words D+5 to D+8 contain information in ASCII that are displayed on a Peripheral Device along with the bit address when FPD(––) is executed. Words D+5 to D+8 contain the message preset by the user as shown in the following table. Word
Bits 15 to 08
Bits 07 to 00
D+1
20 = space
First ASCII character of bit address
D+2
Second ASCII character of bit address
Third ASCII character of bit address
D+3
Fourth ASCII character of bit address
Fifth ASCII character of bit address
D+4
2D = “–”
“0”=normally open, “1”=normally closed
D+5
First ASCII character of message
Second ASCII character of message
D+6
Third ASCII character of message
Fourth ASCII character of message
D+7
Fifth ASCII character of message
Sixth ASCII character of message
D+8
Seventh ASCII character of message
Eighth ASCII character of message
Note If 8 characters are not needed in the message, input “0D” after the last character. Determining Monitoring Time The procedure below can be used to automatically set the monitoring time, T, under actual operating conditions when specifying a word operand for T. This operation cannot be used if a constant is set for T. 1, 2, 3...
316
1. 2. 3. 4.
Switch the PC to MONITOR Mode operation. Connect a Peripheral Device, such as a Programming Console. Use the Peripheral Device to turn ON control bit AR 2508. Execute the program with AR 2508 turned ON. If the monitoring time currently in T is exceeded, 1.5 times the actual monitoring time will be stored in T. FAL(06) errors will not occur while AR 2508 is ON. 5. Turn OFF AR 2508 when an acceptable value has been stored in T.
Page 335
Section 5-25
Special Instructions Example
In the following example, the FPD(––) is set to display the bit address and message (“ABC”) when a monitoring time of 123.4 s is exceeded.
SR 25315 MOV(21)
Address
Instruction
00000 00001
LD MOV(21)
Operands
#4142 HR 15 SR 25315 MOV(21) #430D
00002 00003
HR 16
FPD(––)
00004 00005
#1234
LD FPD(––)
HR 10 SR 25504 (CY Flag) INC(38) DM 0100 10000
00006 00007
AND INC(38)
00008 00009 00010 00011 00012 00013
LD OR LD NOT OR NOT AND LD OUT
10002 LR 0015
10001
10003
# HR
4142 15 25315
# HR LR
430D 16 0000
# # HR
8010 1234 10 25504
DM
0100 10000 10001 10002 10003
LR
0015
LD MOV(21)
LR 0000 #8010
25315
FPD(––) is executed and begins monitoring when LR 0000 goes ON. If LR 0015 does not turn ON within 123.4 s and IR 10000 through IR 10003 are all ON, IR 10002 will be selected as the cause of the error, an FAL(06) error will be generated with an FAL number of 10, and the bit address and preset message (“10002–1ABC”) will be displayed on the Peripheral Device. HR 10 HR 11 HR 12 HR 13 HR 14 HR 15 HR 16 HR 17 HR 18
Flags
0000 0000 0000 0000 0000 4142 430D 0000 0000
HR 10 HR 11 HR 12 HR 13 HR 14 HR 15 HR 16 HR 17 HR 18
ER:
C000 2031 3030 3032 2D31 4142 430D 0000 0000
Indicates information, normally closed condition “1” “00” “02” “–1” “AB” “C”, and CR code The last two words are ignored. (Displayed as spaces.)
T is not BCD. C is not a constant or the rightmost two digits of C are not BCD 00 to 99. Indirectly addressed DM word is non-existent. (Content of word is not BCD, or the DM area boundary has been exceeded.)
CY:
ON when the time between the execution of FPD(––) and the execution of a diagnostic output exceeds T.
317
Page 336
Section 5-25
Special Instructions
5-25-13 DATA SEARCH – SRCH(––) Ladder Symbols
Operand Data Areas N: Number of words
SRCH(––)
@SRCH(––)
N
N
R1
R1
C
C
IR, SR, AR, DM, HR, TC, LR, # R1: First word in range IR, SR, AR, DM, HR, TC, LR C: Comparison data, result word IR, SR, AR, DM, HR, LR
Limitations
N must be BCD between 0001 to 6656. R1 and R1+N–1 must be in the same data area.
Description
When the execution condition is OFF, SRCH(––) is not executed. When the execution condition is ON, SRCH(––) searches the range of memory from R1 to R1+N–1 for addresses that contain the comparison data in C. If one or more addresses contain the comparison data, the EQ Flag (SR 25506) is turned ON and the lowest address containing the comparison data is identified in C+1. The address is identified differently for the DM area: 1, 2, 3...
Flags
1. For an address in the DM area, the word address is written to C+1. For example, if the lowest address containing the comparison data is DM 0114, then #0114 is written in C+1. 2. For an address in another data area, the number of addresses from the beginning of the search is written to C+1. For example, if the lowest address containing the comparison data is IR 114 and the first word in the search range is IR 014, then #0100 is written in C+1. If none of addresses in the range contain the comparison data, the EQ Flag (SR 25506) is turned OFF and C+1 is left unchanged. ER:
Indirectly addressed DM word is non-existent. (Content of word is not BCD, or the DM area boundary has been exceeded.) N is not BCD between 0001 and 6655.
EQ:
318
ON when the comparison data has been matched in the search range.
Page 337
Section 5-25
Special Instructions Example
In the following example, the 10 word range from DM 0010 to DM 0019 is searched for addresses that contain the same data as DM 0000 (#FFFF). Since DM 0012 contains the same data, the EQ Flag (SR 25506) is turned ON and #0012 is written to DM 0001. 00001 @SRCH(––)
Address
Instruction
00000 00001
LD @SRCH(––)
#0010 DM 0010
00001 # DM DM
DM 0000
DM 0010 DM 0011 DM 0012 DM 0013 DM 0014 DM 0015 DM 0016 DM 0017 DM 0018 DM 0019
Operands
0000 9898 FFFF 9797 AAAA 9595 1414 0000 0000 FFFF
DM 0000 DM 0001
0010 0010 0000
FFFF 0012
5-25-14 EXPANSION DM READ – XDMR(––) Ladder Symbols
Operand Data Areas N: Number of words
XDMR(––)
@XDMR(––)
N
N
S
S
D
D
IR, SR, AR, DM, HR, TC, LR, # S: First expansion DM word IR, SR, AR, DM, HR, TC, LR, # D: First destination word IR, SR, AR, DM, HR, LR
Limitations
N must be BCD between 0001 and 3000. S must be BCD between 7000 and 9999. S and S+N–1 must be in the same data area, as must D and D+N–1.
Description
When the execution condition is OFF, XDMR(––) is not executed. When the execution condition is ON, XDMR(––) copies the contents of expansion DM words S through S+N–1 to the destination words D through D+N–1.
Precautions
The Expansion DM area must be set in the PC Setup before it can be used in programming. Do not exceed the set range of the Expansion DM area. Execution of XDMR(––) is given priority whenever a power interruption occurs.
Flags
ER:
The specified expansion DM words are non-existent. Make sure that the specified words have been allocated to expansion DM. Refer to 7-2-15 UM Area Allocation for details. Indirectly addressed DM word is non-existent. (Content of word is not BCD, or the DM area boundary has been exceeded.) N is not BCD between 0001 and 3000. S is not BCD between 7000 and 9999.
319
Page 338
Section 5-25
Special Instructions Example
In the following example, the 100 word range from DM 7000 through DM 7099 is copied to DM 0010 through DM 0109 when IR 00001 is ON. 00001 @XDMR(––) #0100 #7000
Address
Instruction
00000 00001
LD @XDMR(––)
Operands 00001 # # DM
DM 0010
0100 7000 0010
DM 7000 to DM 7099 DM 7000
DM 9999
DM 0010 to DM 0109
DM 0000
DM 6143
5-25-15 INDIRECT EM ADDRESSING – IEMS(––) Ladder Symbols
Operand Data Areas
IEMS(––)
@IEMS(––)
C
C
C: Control word 000, #E000, or #E0B1 to #E0B3
Limitations
C must be 000, #E000, #E0B0, #E0B1, or #E0B2.
Description
When executed with an ON execution condition, IEMS(––) changes the destination of indirect DM addressing to DM or the specified EM bank. The current EM bank number can also be changed when indirect addressing is changed to EM. The destination for is switched to the DM area at the start of an interrupt subroutine. It is also returned to the DM area at the beginning of each scan. The following table shows the allowed values for C and their functions: C 000 #E000 #E0B0 #E0B1 #E0B2
IEMS(––) Operation Switches the destination of to the DM area. Switches the destination of to the current bank in the EM area. Switches the destination of to the bank 0 in the EM area. Switches the destination of to the bank 1 in the EM area. Switches the destination of to the bank 2 in the EM area.
The content of DM 6031 indicates the current destination and the current EM bank number as shown in the following table. Use DM 6031 in the ladder-diagram program to determine if the contents of indirect DM addressing is the DM or EM area. (Programming Devices cannot be used here because bits 08 to 15 will always indicate the DM area when read from the Programming Device.) Word DM 6031
320
Bits 00 to 07 Current EM bank number (00 to 02)
Bits 08 to 15 destination (00: DM; 80: EM)
Page 339
Section 5-25
Special Instructions
Note Input 000 for the second and third operands when using replacement instructions. Flags
ER:
C is not one of the allowed values.
Example
In the following example, IEMS(––) changes the destination for to EM bank 1 and uses indirect addressing to move #1234 into EM 0001 in EM bank 1. 00000 IEMS3 #EOBI
MOV #1234
DM0000
0001
EM0000 0001
1234
5-25-16 SELECT EM BANK – EMBC(––) Ladder Symbols
Operand Data Areas
EMBC(––)
@EMBC(––)
N
N
N: Bank number IR, SR, AR, DM, HR, LR, #
Limitations
N must be 0000, 0001, or 0002 and the bank number specified by N must exist in the CPU Unit.
Description
When executed with an ON execution condition, EMBC(––) changes the current EM bank to the specified bank number. The CPU Unit can access only the current bank, which is indicated in bits 00 through 07 of DM 6031. An error will occur and EMBC(––) won’t be executed if the specified bank number doesn’t exist in the CPU Unit.
Flags
ER:
Indirectly addressed DM word is non-existent. (Content of word is not BCD, or the DM area boundary has been exceeded.) The specified bank number, N, doesn’t exist in the CPU Unit.
Example
In the following example, EMBC(––) changes the current bank to bank number 2 when IR 00000 is ON. 00000 EMBC #0002
00001 @EMBC #1005
321
Page 340
Section 5-26
Network Instructions
5-26 Network Instructions The network instructions are used for communicating with other PCs, BASIC Units, or host computers linked through the SYSMAC NET Link System, SYSMAC LINK System, Ethernet System, or Controller Link System.
5-26-1 NETWORK SEND – SEND(90) Operand Data Areas
Ladder Symbols
S: Source beginning word SEND(90)
@SEND(90)
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 SEND(90), 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, SEND(90) is not executed. When the execution condition is ON, SEND(90) transfers data beginning at word S, to addresses specified by D in the designated node on the SYSMAC NET Link, SYSMAC LINK System, Ethernet System, or Controller Link System. The control words, beginning with C, specify the number of words to be sent, the destination node, and other parameters. The contents of the control data depends on whether a transmission is being sent in a SYSMAC NET Link System, a SYSMAC LINK System, an Ethernet System, or a Controller Link System. The status of bit 15 of C+1 determines whether the instruction is for a SYSMAC NET Link System or a SYSMAC LINK/Ethernet/Controller Link System.
Control Data Ethernet Systems
Set the destination node number to 0 to send the data to all nodes. 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)
Bit 12
ON: Direct destination 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 C+2
Destination node (0 to 127 in 2-digit hexadecimal, i.e., 00hex to 7Ehex)*
Bit 15: Set to 1. Bits 08 to 12: Unit address of destination node. Set to 00hex. Bits 13 to 15: Set to 0.
322
Page 341
Section 5-26
Network Instructions SYSMAC NET Link Systems
The destination port number is always set to 0. Set the destination node number to 0 to send the data to all nodes. Set the network number to 0 to send 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 destination hexadecimal, i.e., 00hex to 7Fhex) beginning word designation OFF: Indirect designation Bit 14
C+2
ON: Operating level 0 OFF: Operating level 1 Bits 08 to 11, 13 and 15: Set to 0. Destination node (0 to 126 in 2-digit Destination port hexadecimal, i.e., 00hex to 7Ehex)* NSB: 00 NSU: 01/02
*The node number of the PC executing the send may be set.
SYSMAC LINK Systems
Set the destination node number to 0 to send the data to all nodes. Refer to the SYSMAC 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) Response time limit (0.1 and 25.4 Bits 08 to 11: seconds in 2-digit hexadecimal No. of retries (0 to 15 in without decimal point, i.e., 00hex to hexadecimal, FFhex) i.e., 0hex to Fhex) 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
Destination node (0 to 62 in 2-digit hexadecimal, i.e., 00hex to 3Ehex)*
Bit 12
ON: Direct destination 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. Set to 0.
*The node number of the PC executing the send cannot be set.
323
Page 342
Section 5-26
Network Instructions
SEND(90) transmits “n” words beginning with S (the beginning source word for data transmission at the source node) to the “n” words beginning with D (the beginning destination word for data reception at destination node N).
Controller Link Systems
15
@SEND(90) S: Source node beginning send word D: Destination node beginning receive word S C: Source node first control data word D C 1514
Source node 0
S L
“n” number of send words n
Destination node N 0 15 D n L
0
C
“n” number of send words 0000 to 03DE (Hex): 0 to 990 words 0: Destination network address not specified (local network) 1: Destination 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 8 s (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 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 node address (N) 00 to 20 (Hex): 0 to 32 The same data can be broadcast to all nodes on the network by setting the destination node address to FF (Hex). 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 a destination network address, set all the nodes in the routing tables. For details on routing tables, refer to 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. 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.
324
Page 343
Section 5-26
Network Instructions Indirect Destination Beginning Word Designations
D is used to specify the destination beginning word as follows when indirect specification is designated: 12 to 15 D
08 to 11
Area type
D+1 Word no. (4th digit)
SYSMAC NET Link Systems
04 to 07
00 to 03
Word no. (2nd digit)
Word no. (5th digit) Word no. (1st digit)
0 Word no. (3rd digit)
Indirect designations depend on the series of the destination PC. CV-series PCs Addresses in parentheses are for the CV500. Designation Area
Corresponding CV-series PC words
Area code IR area 00 LR area 06 HR area 07 SR area 08 Timer area (PV) 03
Word number 0 to 999 0 to 63 0 to 99 0 to 27 0 to 1023
DM area
0 to 24575
05
Area
Word number
CIO Area
0 to 999 1000 to 1063 1064 to 1163 1164 to 1191 0 to 1023 (0 to 511)
Timer Area (PV) DM Area
0 to 24575 (0 to 8191)
C-series PCs Designation Area
Area code
Word number
IR area
00
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
05
0 to 6655
EM area
10 to 17 (Bank 0 to 7)
0 to 6143
28 to 2F (Bank 8 to 15) 18
SYSMAC LINK/Ethernet Systems
(Current bank)
Indirect designations depend on the series of the destination PC. CV-series PCs Designation Area
Area code
Word number
CIO Area
00
0 to 2555
CPU Bus Link Area
01
0 to 255
Auxiliary Area
02
0 to 511
Timer Area
03
0 to 1023
Counter Area
04
0 to 1023
DM Area
05
0 to 24575
EM Area
10 to 17: Bank 0 to 7
0 to 32765
18:
Current bank
325