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

The text of a manual · part 54 of 68

Programmable Controllers C200HX-CPU-ZE, C200HG-CPU-ZE, C200HE-CPU-ZE Operation Manual: SECTION 8 Serial Communications, pages 486 to 492

Pages 486 to 492 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 486

Section

The Protocol Macro Function

8-6

RS-422/485 Adapter Connection (NT-AL001) AL001

C200HX/HG/HE

General Device/Computer Connections (RS/CS Flow, Cross Connection) Host computer

C200HX/HG/HE

477

Page 487

Section

The Protocol Macro Function

8-6

Modem Connection (Straight Connection) C200HX/HG/HE

Modem

Note Ground the FG terminals on the PC and at the other device to 100 Ω or less. Refer to the PC’s Installation Manual and the documentation included with the other device for details.

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).

478

Page 488

Section

The Protocol Macro Function

8-6

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

Parameter Baud rate

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

Setting 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(260) instruction is executed to execute a communications sequence stored in the Communications Board. Communications Sequence Structure

Item Sequence 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

479

Page 489

Section

The Protocol Macro Function Item Step settings

Function

Parameter settings

Repeat counter

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

Transmission/Reception Message Structure

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

The transmission message and reception message have the following structure. Header

Address

Length

Data

Item

Error check

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

480

8-6

Page 490

Section

The Protocol Macro Function

8-6

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. Header

Data attribute Constant

No variable conversion

Variable ASC conversion

Variable HEX conversion

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

Address

Length

Data

Error check

Terminator

TM Yes

RM Yes

TM Yes

RM Yes

TM ---

RM ---

TM Yes

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

---

---

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(260) 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(260) 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.

481

Page 491

Section

The Protocol Macro Function

8-6

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(260) 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: Example: R(2N+6) Specifies the sixth word following the PMCR(260) 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(260) instruction. The following example shows a communications sequence that trans-

482

Page 492

Section

The Protocol Macro Function

8-6 mits five words of data are transmitted one after the other beginning with the first word after the PMCR(260) 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...

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(260) 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(260) 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. 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.

483