The text of a manual · part 47 of 60
C200HX/C200HG/C200HE Programmable Controllers Operation Manual, pages 454 to 463
Pages 454 to 463 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 454
NT Links
8-5
Section 8-5
NT Links A one-to-one NT link that uses NT link commands can be established by connecting the RS-232C port of the PC to the RS-232C port of a Programmable Terminal (PT). A one-to-N NT link that uses NT link commands can be established by connecting the PC and Programmable Terminal (PT) with RS-422/485 cable.
One-to-one NT Links
The following diagram shows the connections for a one-to-one NT link.
PT
One-to-N NT Links
The following diagram shows the connections for a one-to-N NT link. Up to 8 Programmable Terminals can be connected unless the PC is a With a up to 4 Programmable Terminals can be connected (including connections through a Communications Board). See note
Note:
1:N NT link RS-422/485
RS-232C ↔ RS-422/485 Adapter
The following table shows the maximum number of PTs that can be connected to each port. PC
PC Setup
RS-232C port
C200HE
4
Communications port A 4
C200HX/HG
8
8
Communications port B 4 8
Make the following settings when establishing an NT link. Link Port One-to-one Built-in RS-232C port Communications Board port B Communications Board port A One-to-N Built-in RS-232C port
Setting Set bits 12 to 15 of DM 6645 to 4. Set bits 12 to 15 of DM 6550 to 4. Set bits 12 to 15 of DM 6555 to 4. Set bits 12 to 15 of DM 6645 to 5. Set the max. node number (1 to 7) in bits 08 to 11 of DM 6545 (1 to 3 for the C200HE).
Communications Board port B
Set bits 12 to 15 of DM 6550 to 5. Set the max. node number (1 to 7) in bits 08 to 11 of DM 6550 (1 to 3 for the C200HE).
Communications Board port A
Set bits 12 to 15 of DM 6555 to 5. Set the max. node number (1 to 7) in bits 08 to 11 of DM 6555 (1 to 3 for the C200HE).
436
Page 455
The Protocol Macro Function
Section 8-6
Restrictions on Use
If the C200H-OV001 Voice Unit is being used, the 1:N mode cannot be used with the RS-232 port. In that case, either use the NT Link in 1:1 mode or use the 1:N mode with the port on the communications board.
Applications
Refer to the documentation provided for the NT Link Interface Unit for details on actual NT link applications.
8-6
The Protocol Macro Function This section explains how to use the Protocol Macro function.
8-6-1 Introduction The Protocol Macro function is a communications protocol that controls half duplex (see below) data transfers with various communications devices and general-purpose components equipped with RS-232C or RS-422/485 ports. The user can easily modify the data transfer procedures (communications sequences) with OMRON’s Protocol Support Software and execute the communications sequences from the ladder program with PMCR(––). The Communications Boards come equipped with seven communications procedures. These standard sequences can be used as is or modified to meet the requirements of a particular application. Note Refer to the Communications Board Operation Manual for details on Communications Boards and the Protocol Support Software Operation Manual for details on the Protocol Support Software. Half Duplex Communications With half duplex communications, data is received and sent consecutively, i.e., not at the same time. (The C200HX/C200HG/C200HE Protocol Macro function supports half duplex communications only.) Send
Send Receive
Receive
Full Duplex Communications With full duplex communications, data can be received and sent simultaneously. (The C200HX/C200HG/C200HE Protocol Macro function does not support full duplex communications.) Send
Send
Receive
RS-232C Connection (One-to-one)
(RS-232C) Port B
Receive
Only one device can be connected with an RS-232C connection. The RS-232C cable can be up to 15 m long.
Basic protocol
RS-232C
(RS-232C) Port A Basic protocol 15 m RS-232C
15 m
Device with an RS-232C interface
Device with an RS-232C interface
437
Page 456
The Protocol Macro Function RS-422/485 Connection (One-to-N)
(RS-232C) Port B (RS-422/485) Port A
Section 8-6
An RS-422/485 connection allows 2 or more devices to be connected (one-to-N connection) with a maximum cable length of 500 m. The RS-422/485 connection is also useful for distant one-to-one connections.
RS-232C ↔ RS-422/485 Adapter RS-232C 15 m
Conversion Adapter NT-AL001
Temperature Controller with RS-422/485 communications Temperature Controller with RS-422/485 communications Temperature Controller with RS-422/485 communications RS-422/485
Temperature Controller with RS-422/485 communications
RS-422/485
Temperature Controller with RS-422/485 communications Temperature Controller with RS-422/485 communications
Temperature Controller with RS-422/485 communications Temperature Controller with RS-422/485 communications 500 m max.
500 m max.
Connection Cable Wiring
The following diagrams show the cable wiring used with Protocol Macro function communications. RS-422/485 Adapter Connection (NT-AL001) AL001
438
C200HX/HG/HE
Page 457
The Protocol Macro Function
Section 8-6
General Device/Computer Connections (RS/CS Flow, Cross Connection) Host computer
C200HX/HG/HE
Modem Connection (Straight Connection) Modem
C200HX/HG/HE
Note Ground the FG terminals on the PC and at the other device to 100 Ω or less. Refer to the C200HX/HG/HE Installation Manual and the documentation included with the other device for details.
439
Page 458
The Protocol Macro Function
Section 8-6
8-6-2 Communications Board Settings The following parameters must be set in advance in order to use the Protocol Macro function through a Communications Board. Communications Mode Set the communications mode to Protocol Macro mode. Port B: Set bits 12 through 15 of DM 6550 to 6. Port A: Set bits 12 through 15 of DM 6555 to 6. Standard Port Settings Standard settings or custom settings can be used for ports A and B. The standard settings are used when the following bits are set to 0. Port B: Bits 00 through 03 of DM 6550 (0: standard; 1: custom). Port A: Bits 00 through 03 of DM 6555 (0: standard; 1: custom). The standard settings are shown in the following table. Item
Setting
Start bits
1
Data length
7
Stop bits
2
Parity
Even
Baud rate
9,600 bps
Custom Port Settings Standard settings or custom settings can be used for ports A and B. The custom settings are used when the following bits are set to 1. Port B: Bits 00 through 03 of DM 6550 (0: standard; 1: custom). Port A: Bits 00 through 03 of DM 6555 (0: standard; 1: custom). The custom settings for Port B are defined in DM 6551 and the custom settings for the Port A are defined in DM 6556. Bit 15
0
DM 6551: Port B DM 6556: Port A
Transmission Frame Format (See table below.) Baud rate (See table below.)
Parameter Transmission Frame Format
440
Setting
Start bits
Data length
Stop bits
Parity
00 01 02 03 04 05 06 07 08 09 10 11
1 1 1 1 1 1 1 1 1 1 1 1
7 7 7 7 7 7 8 8 8 8 8 8
1 1 1 2 2 2 1 1 1 2 2 2
Even Odd None Even Odd None Even Odd None Even Odd None
Page 459
The Protocol Macro Function
Section 8-6 Parameter
Setting
Baud rate
00 01 02 03 04
Baud rate 1,200 bps 2,400 bps 4,800 bps 9,600 bps 19,200 bps
8-6-3 Communications Procedure The Protocol Macro’s communications sequences must be created with the Protocol Support Software and transferred to the Communications Board in advance. In the PC, the PMCR(––) instruction is executed to execute a communications sequence stored in the Communications Board. Communications Sequence Structure
Item Sequence settings
Step settings
Up to 1,000 communications sequences with sequence numbers 000 to 999 can be created with the Protocol Support Software. Each communications sequence is composed of a maximum of 16 steps. The following table shows the communications sequence settings. Function
Parameter settings
Transmission control
Sets the transmission control method, such as X-on/X-off flow control or RS/ CS flow control.
X-on/X-off, RS/CS, modem control, delimiter control, or contention control
Link words
Sets the link words for the data link between the PC and Communications Board.
IR/SR, LR, HR, AR, DM, and EM areas
Monitor time
Sets the monitor time (watchdog timer) for communications processing.
Reception standby, reception completed, transmission completed 0.01 s, 0.1 s, 1 s, and 1 minute units
Response notification
Sets the timing for writing the received data.
Scan notification or interrupt notification
Sets the number of times to repeat the step. Command Sets the communications command. Number of retries Sets the number of retries when errors occur for the Send&Recv command. Transmission wait time Sets the time to wait before sending the data when transmitting Transmission message Sets the transmission data for the Send or Send&Recv commands. Reception message Sets the expected reception data for the Recv or Send&Recv commands. Reception matrix Sets the expected reception data (up to 15 types) for the Recv or Send&Recv commands and adjusts processing depending on the data type. Response notification Sets whether or not to write the received data. Next process Sets the next step to go to when the current step has been completed successfully.
Constant 0 to 255 IR/SR, LR, HR, AR, DM, and EM areas Send, Recv, or Send&Recv 0 to 9
Error processing
End, Goto, Next, or Abort
Repeat counter
Sets the next step to go to when an error has occurred in the current step.
0.01 s, 0.1 s, 1 s, and 1 minute units Header, address, length, data, error check code, and terminator Header, address, length, data, error check code, and terminator Header, address, length, data, error check code, terminator, and next process Yes/No End, Goto, Next, or Abort
441
Page 460
The Protocol Macro Function Transmission/Reception Message Structure
Section 8-6
The transmission message and reception message have the following structure. Header
Address
Length
Data
Error check
Item
Terminator
Function
Header
Set the data that indicates the beginning of the message.
Address Length
Set the node number or other identifier that indicates the destination for the message. The data length (number of bytes) is added automatically.
Data
Set the message contents.
Error check code
Set SUM, LRC, or CRC as the error check code. The specified error check code will be added automatically when transmitting. When receiving, error control will be performed automatically based on the error check code specified in the message and the specified amount (length) of data will be received. Set the data that indicates the end of the message.
Terminator
The following attributes can be set for each item in the transmission or reception message. The abbreviation “R M” stands for reception message and “T M” stands for transmission message. Data attribute Constant
No variable conversion
Variable ASC conversion
Variable HEX conversion
442
ASCII
HEX
Special characters CR, STX, etc. First-order equation using variable (N) Wild card Read word (R) Write word (W) Automatic variable: LNG Automatic variable: SUM, LRC, and CRC First-order equation using variable (N) Wild card Read word (R) Write word (W) Automatic variable: LNG Automatic variable: SUM, LRC, and CRC First-order equation using variable (N) Wild card Read word (R) Write word (W) Automatic variable: LNG Automatic variable: SUM, LRC, and CRC
Error check
Terminator
TM Yes
Header RM Yes
TM Yes
Address RM Yes
TM ---
Length RM ---
TM Yes
Data RM Yes
TM ---
RM ---
TM Yes
RM Yes
Yes
Yes
---
---
---
---
Yes
Yes
---
---
Yes
Yes
---
---
Yes
Yes
---
---
Yes
Yes
---
---
---
---
---------
---------
--Yes -----
Yes Yes Yes ---
------Yes
------Yes
--Yes -----
Yes Yes Yes ---
---------
---------
---------
---------
---
---
---
---
---
---
---
---
Yes
Yes
---
---
---
---
Yes
Yes
---
---
Yes
Yes
---
---
---
---
---------
---------
--Yes -----
Yes Yes Yes ---
------Yes
---------
--Yes -----
Yes Yes Yes ---
---------
---------
---------
---------
---
---
---
---
---
---
---
---
Yes
---
---
---
---
---
Yes
Yes
---
---
Yes
Yes
---
---
---
---
---------
---------
--Yes -----
Yes Yes Yes ---
---------
------Yes
--Yes -----
Yes Yes Yes ---
---------
---------
---------
---------
---
---
---
---
---
---
---
---
---
Yes
---
---
Page 461
The Protocol Macro Function
Section 8-6
Read Word (R) Word data can be read by setting the desired attributes for the “address” or “data” in the transmission and reception messages. When the attribute is set, the address or data is read from the specified word. There are three ways to specify the word: 1, 2, 3...
1. The second operand of the PMCR(––) instruction (S, the first output word) can be used. Example: R(1) When the command is “Send,” data is read from the first word following the word specified for PMCR(––) instruction’s second operand. 2. Input and output words in the communications sequence’s link area can be used. Example: R(I1+5) Specifies the fifth word from the beginning of the receive words in the link area. Example: R(O2+1) Specifies the first word from the second send word in the link area. 3. A data area word address can be specified directly. Example: R(DM 0000 + 2) Specifies the second word after DM 0000. Wild Cards and Write Word (W) When receiving data, wild cards and Write Words can be set for the “address” or “data.” Their functions are explained below:
1, 2, 3...
1. The address of the word is specified as the PMCR(––) instruction’s third operand (first input word). 2. A wild card can be set in the reception message’s address to receive any message regardless of the destination. The result is a broadcast communication. 3. The wild card can be set in the reception message’s data to receive all messages. 4. The Write Word attribute can be set in the reception message’s address to receive any message regardless of the destination and write the message in the data area specified by the reception message’s address. 5. The Write Word attribute can be set in the reception message’s data to receive all messages and write the message in the data area specified by the reception message’s address. First-order Equation Using Variable N First-order equations that include the variable N can be used for the address and data entries. Variable N is incremented by 1 each time that a step is repeated by the repeat counter specified in the communication sequence’s step. Using an equation with N for the address or data allows the kind of dynamic specifications shown in the following example:
443
Page 462
The Protocol Macro Function
Section 8-6
Example: R(2N+6) Specifies the sixth word following the PMCR(––) instruction’s second operand for the “address” or “data” and adds two words to the specification each time that the step is repeated. Specifying the first address with 2N+6 (a first order equation using N). Common information 6th word (N=0) Communications data
8th word (N=1)
Communications data
10th word (N=2)
Communications data
12th word (N=3)
Communications data
14th word (N=4)
Communications data
16th word (N=5)
Error Check Code and Length A SUM, LRC, or CRC error check code and the data length are automatically added to the message when it is transmitted. When the message is received, the data is checked for transmission errors using the error check code and the number of bytes of data specified by the data length are received. Reception Matrix If a reception matrix is set in the reception message, up to 15 types of reception messages can be set and different processes and error processing can be assigned to each type of message.
8-6-4 Application Example Communications sequences can be called and executed by the PMCR(––) instruction. The following example shows a communications sequence that transmits five words of data are transmitted one after the other beginning with the first word after the PMCR(––) instruction’s second operand and then stores received data in the word specified in the third operand.
00000 28908 PMCR #1100 DM0000 DM0010
1, 2, 3...
444
1. When IR 00000 is ON and SR 28908 (Communications Board Port A Instruction Execution Flag) is OFF, data communications are carried out through port A of the Communications Board. 2. DM 0000 is the first word of the transmission data, which is transmitted consecutively (5 times) based on the communications sequence’s repeat counter. 3. The received data is written to the DM area beginning at word DM 0010. The Send command must be set in the transmission step and the repeat counter must be set to 5. The Read Word attribute must be used for the data in the transmission message with the PMCR(––) instruction’s second operand, and the first-order equation R(N+1) must be set. In order to write the reception message to the data area address specified by the PMCR(––) instruction’s second operand, the timing for writing the received data must be set in the response notification parameter of the sequence settings. The Recv command must be set in each reception step and “Yes” must be set for the response notification parameter of the step settings.
Page 463
The Protocol Macro Function
Section 8-6
Set the wild card in the reception message so that all data will be received. In the next process, set “End” in both the transmission step and the reception step. In error processing, set “Abort” in both the transmission step and the reception step.
445