• 沒有找到結果。

7. Connection Procedure

7.3. Setting Up the PLC

7.3.2. Opening the Project File and Connecting Online with the PLC

Start the CX-Programmer, open the project file and connect online with the PLC.

7.3.3. Creating the I/O Table Create the I/O table for the PLC.

7.3.4. Parameter Settings Set the parameters for the Serial Communications Unit.

7.3.5. Transferring the Project Data Transfer the project data to the PLC.

7.3.6. Starting the CX-Protocol and Opening the Protocol Macro Data

Start the CX-Protocol and open the protocol macro data.

7.3.7. Connecting Online and Transferring the Protocol Macro Data

Connect online with the CX-Protocol, and transfer the protocol macro data to the Serial Communications Unit.

7.4. Checking the Serial

Communications

Execute the program and confirm that serial communications are normally performed.

7.4.1. Starting the Trace Start tracing with the CX-Protocol.

7.4.2. Executing the Program Execute the program with the CX-Programmer.

7.4.3. Checking the Trace Data Confirm that the correct data is sent and received by checking the trace data of the CX-Protocol.

7.4.4. Checking the Receive Data Confirm that the correct data is written to the I/O memory of the PLC with the CX-Programmer.

7.2. Setting UP the Code Reader

Set up the Code Reader.

7.2.1. Cable Connection

Connect a cable to the Code Reader.

1

Connect the special cable (V509-W011) to the Code Reader.

Connect the 5 VDC power supply to the special cable and turn ON the power supply.

Precautions for Correct Use

This document explains the procedures for setting up the Code Reader from the factory default setting. If the Code Reader was changed from the factory default setting, make sure to initialize by referring to Section 8.2. Initializing the Code Reader.

Additional Information

For details on the factory default setting of the Code Reader, refer to Factory default setting in Return to the factory default setting in Menu Sheet/Command List in Section 4 Setting Method of the Ultra Small Multi-code Reader V400-R2 Series User's Manual (Cat. No. Z333).

Special cable (V509-W011)

5 VDC power supply Code Reader

(V400-R2CF65)

7.3. Setting Up the PLC

Set up the PLC.

7.3.1. Hardware Settings

Set the hardware switches on the Serial Communications Unit.

Precautions for Correct Use

Make sure that the power supply is OFF when you perform the setting up.

1

Make sure that the power supply to the PLC is OFF.

* If the power supply is turned ON, settings may not be applicable as described in the following procedure.

Check the hardware switches located on the front panel of the Serial Communications Unit by referring to the right figure.

Check the connector for Port 2 (RS-232C) by referring to the right figure.

* This setting is required to use Port 2 of the Serial

Communications Unit.

2

Set the Unit No. Switch to 0.

(The unit number is set to 0 as the factory default setting.)

3

Connect the Serial

Communications Unit to the PLC as shown on the right.

Connect the special cable for the Code Reader to the Serial Communications Unit.

Connect the personal computer to the PLC with a USB cable.

Personal computer PLC Serial Communications Unit

7.3.2. Opening the Project File and Connecting Online with the PLC

Start the CX-Programmer, open the project file and connect online with the PLC.

Install the CX-Programmer and USB driver in the personal computer beforehand.

1

Confirm that the personal computer and PLC are

connected with the USB cable and turn ON the power supply to the PLC.

Start the CX-Programmer.

* If a confirmation dialog for an access right is displayed at start, select to start.

2

Select Open from the File Menu.

3

On the Open CX-Programmer Project Dialog Box, select OMRON_V400-R2_PMCR232C _EV100.cxp and click the Open Button.

* Obtain the project file from OMRON.

4

After opening the project file, select Programs in the project workspace.

(Project workspace)

5

Select Change Model from the PLC Menu.

6

The Change PLC Dialog Box is displayed. Select the device type to use from the pull-down list, and click the Settings Button.

* CJ2M is used in this document.

7

The Device Type Settings Dialog Box is displayed. Select the CPU type to use from the pull-down list, and click the OK Button.

* CPU12 is used in this document.

8

Confirm that the Network Type is set to USB on the Change PLC Dialog Box and click the OK Button.

* If the Network Type is not set to USB, select USB from the pull-down list.

* If you changed the Device Type in step 6 or the CPU Type in step 7, the dialog box on the right is displayed. Confirm that there is no problem and click the Yes Button.

Confirm that the program was normally converted ("0 errors"

must be shown).

(Although duplicated output warnings were detected in the right dialog, they are not problems.)

9

Select Programs in the project workspace and select Work Online from the PLC Menu.

10

The dialog box on the right is displayed. Confirm that there is no problem and click the Yes Button.

11

Confirm that the

CX-Programmer and the PLC are normally connected online.

* The icon is pressed down during online connection.

Additional Information

If the CX-Programmer and PLC are not connected online, please check the connection of the cable. Or, return to step 5, check the settings in steps 6 to 8 such as the connection type and try again. Refer to Connecting Directly to a CJ2 CPU Unit Using a USB Cable in Serial Communications (Direct Connection) in Chapter 3 Communications in PART 3: CX-Server Runtime of the CX-Programmer Operation Manual (Cat. No. W446) for details.

Additional Information

The dialogs explained in this document may not be displayed depending on the

environmental setting of CX-Programmer. For details on the environmental setting, refer to Options and Preferences in Chapter 3 Project Reference in PART 1: CX-Programmer of the CX-Programmer Operation Manual (Cat. No. W446).

This document explains the setting procedure when the Confirm all operations affecting the PLC Check Box is selected.

7.3.3. Creating the I/O Table

Create the I/O table for the PLC.

1

If the operating mode of the PLC is RUN Mode or Monitor Mode, change it to Program Mode by following the steps below.

(1) Select Operating Mode - Program from the PLC Menu of the CX-Programmer.

(2) The dialog box on the right is displayed. Confirm that there is no problem and click the Yes Button.

* Refer to Additional Information on the previous page for the settings concerning the dialog display.

(3) Confirm that Stop/Program Mode is displayed on the right of the PLC model in the Project Tree.

2

Select Edit - I/O Table and Unit Setup from the PLC Menu of the CX-Programmer.

The PLC IO Table Window is displayed.

3

Select Create from the Options Menu of the PLC IO Table Window.

The dialog box on the right is displayed. Confirm that there is no problem and click the Yes Button.

The dialog box on the right is displayed. Confirm that there is no problem and click the Yes Button.

4

The Transfer from PLC Dialog Box is displayed. Select the I/O Table Check Box and the SIO Unit Parameters Check Box, and click the Transfer Button.

When the transfer is completed, the Transfer Results Dialog Box is displayed.

Confirm that the transfer was normally executed by referring to the message in the dialog box.

When the I/O table is created normally, the dialog box shows the following:

Transfer Success: 1 Unit Transfer Unsuccessful: 0 Unit Click the OK Button.

7.3.4. Parameter Settings

Set the parameters for the Serial Communications Unit.

1

Double-click [0000] Main Rack on the PLC IO Table Window to expand the tree.

2

Right-click

00[1500]CJ1W-SCU42 and select the Unit Setup.

3

The View Parameters Dialog Box is displayed. Select Port2:

Protocol macro Settings for Displayed Parameter.

* This setting is required to use Port 2 of the Serial

Communications Unit.

4

The setting items of the Port 2:

Protocol macro Settings are listed as shown in the right figure. (The figure shows the default values.)

5

Select User settings for Port settings.

6

Set the following parameters in the same way as step 5.

•Serial communications mode

:Protocol macro

•Data length :8 bits

•Stop bit :1 bit

•Parity :None

•Baud rate :Default (9600 bps)

•Protocol macro Transmission method :Full-duplex

* Use the default settings for other parameters.

Click the Transfer [PC to Unit]

Button.

7

The dialog box on the right is displayed. Confirm that there is no problem and click the Yes Button.

When the transfer is completed, the dialog box on the right is displayed. Click the Close Button.

8

A dialog box on the right is displayed. Check the contents and click the Yes Button.

The Select Port Dialog Box is displayed. Select All ports and click the OK Button.

9

The dialog box on the right is displayed. Check the contents and click the OK Button.

10

Click the Compare Button on the View Parameters Dialog Box.

11

The dialog box on the right is displayed when the parameter settings matches. Click the Close Button.

12

Click the OK Button on the View Parameters Dialog Box.

Close the Edit Parameters Dialog Box and PLC IO Table Window.

7.3.5. Transferring the Project Data

Transfer the project data to the PLC.

1

Select Programs on the project workspace of the

CX-programmer, and select Transfer - To PLC from the PLC Menu.

2

Select the Program(s) Check Box, Comments Check Box, and Program index Check Box, and click the OK Button.

* Transferring the I/O table and Special Unit Setup is

unnecessary here, because they were set in Section 7.3.3 and Section 7.3.4.

* The Comments Check Box and the Program index Check Box may not be displayed depending on the device type.

In such a case, select the Program(s) Check Box only and transfer the project data.

3

The dialog box on the right is displayed. Confirm that there is no problem and click the Yes Button.

4

The dialog box on the right is displayed (stating "Download successful") when the transfer is completed. Click the OK Button.

5

Select Programs in the project workspace, and select Transfer - Compare with PLC from the PLC Menu.

6

Select the Program(s) Check Box and click the OK Button.

7

Confirm that a message stating

"Compare successful" is displayed, and click the OK Button.

7.3.6. Starting the CX-Protocol and Opening the Protocol Macro Data

Start the CX-Protocol and open the protocol macro data.

1

Start the CX-Protocol.

(CX-Protocol)

2

Select Open from the File Menu.

3

On the Open Dialog Box, select OMRON_V400-R2_PMCR_EV1 00.psw and click the Open Button.

* Obtain the protocol macro data from OMRON.

4

The project workspace and the Project Window display the protocol macro data that was read.

Output Tab Page Project workspace

Project Window

7.3.7. Connecting Online and Transferring the Protocol Macro Data

Connect online with the CX-Protocol, and transfer the protocol macro data to the Serial Communications Unit.

1

Double-click the

OMRON_V400-R2_PMCR_EV1 00 on the project workspace to display a tree.

2

Select Edit PC-PLC Comms Settings from the PLC Menu.

3

The Change PLC Dialog Box is displayed. Select the device type to use from the pull-down list, and click the Settings Button.

* CJ2M is used in this document.

4

The Device Type Settings Dialog Box is displayed. Select the CPU type to use from the pull-down list, and click the OK Button.

* CPU12 is used in this document.

5

Confirm that the Network Type is set to USB on the Change PLC Dialog Box and click the OK Button.

* If the Network Type is not set to USB, select USB from the pull-down list.

6

Select Connect to PLC from the PLC Menu.

7

The PLC icon on the project workspace changes from Offline to Program. It means that the PLC is connected online.

* If Monitor or Run is displayed, change it to Program by following steps 8 and 9.

8

If the operating mode of the PLC is Monitor or Run, select

Operating Mode - Program from the PLC Menu.

9

The dialog box on the right is displayed. Confirm that there is no problem and click the Yes Button.

Confirm that the operating mode was changed to Program mode as shown in step 7.

10

Double-click the New Protocol List on the project workspace to display a tree.

11

The Project Window on the right is displayed. Confirm that SCU[0] is entered in the Target Column.

* If SCU[0] is not entered, select SCU[0] as shown on the right figure.

12

Select New Protocol List and select Download Protocols from the Protocol Menu.

13

The dialog box on the right is displayed. Select the Include Source Information Check Box and click the Compile Button.

14

When 100% is displayed in the Complied % Column, the compiling operation is completed.

After confirming that the compiling operation is

completed, click the Download Button.

15

The dialog box on the right is displayed. Confirm that there is no problem and click the OK Button.

16

Check that 100% is displayed in the Downloaded % Column in the right figure, and click the Close Button.

17

Select New Protocol List and select Compare Protocols from the Protocol Menu.

18

The dialog box on the right is displayed. Select the Include Source Information Check Box and click the Compile Button.

19

When 100% is displayed in the Complied % Column, the compiling operation is completed.

After confirming that the compiling operation is

completed, click the Compare Button.

20

The dialog box on the right is displayed. Confirm that Successful is displayed in the Result Column and click the OK Button.

21

Confirm that 100% is displayed in the Compared % Column in the right figure, and click the Close Button.

相關文件