Contec CPS-PC341EC-1-9201 Getting Start Guide

  • Hello! I am an AI chatbot trained to assist you with the Contec CPS-PC341EC-1-9201 Getting Start Guide. I’ve already reviewed the document and can help you find the information you need or explain it in simple terms. Just ask your questions, and providing more details will help me assist you more effectively!
Program an EtherCAT Control System
__ Getting Started Guide 2
1
2
1. Objective
Show how to program a sample EtherCAT control system by using a Contec CONPROSYS
PAC series controller, an EtherCAT master device CPS-PC341-1-9201 and a Contec
EtherCAT slave device DIO-1616LN-CAT.
Because the built-in CODESYS Runtime software, the Contec CONPROSYS PAC series
controllers are suitable runtime controllers for EtherCAT control systems that can be
programmed by any of the IEC-61131-3 standard PLC program languages without additional
development software costs.
In this guide, after development the sample program and downloaded the built runtime
program into the EtherCAT master controller, CPS-PC341-1-9201, this program will be
running by the EtherCat master controller itself alone without the development PC.
This sample program will use the “Structured Text (ST)” PLC program language.
3
2. Necessary Devices and Software System
Hardware:
A computer (Running CODESYS Integrated Development System) with a LAN (Ethernet) port
A Contec CPS-PC341EC-1-9201 unit (EtherCAT Master device, CODESYS Runtime system built-in)
A Contec DIO-1616LN-CAT unit (EtherCAT Slave unit of digital signal Input and Output)
Two Contec POA201-10-2 power supplies (12VDC power supply)
Two LAN cables
Wires
One +12VDC or +24VDC power supply
Software
CODESYS Integrated Development Environment (Download from CODESYS store free of charge)
4
3. Download the CODESYS
CODESYS Development System can be downloaded from the CODESYS Store.
(1) Access to the following URL and click [download].
The CODESYS is constantly updated, therefore, be certain to download the latest system.
http://store.codesys.com/codesys.html
(2) In the popup window, click “>>Go to Loging or Create an Account”
5
3. Download the CODESYS
(3) In the “Registered Customers”, enter your “Email Address” and “Password” to log in.
If you are a new customer, complete user registration in the “New Customers”.
(To register as a private customer may be easier to download the IDE soon.)
(4) Click [Download] again, then download will be started.
In this guide, the version of the IDE is “CODESYS V3.5 SP10 Patch2”.
(5) Execute the downloaded file, then proceed to the installation of the CODESYS development environment.
(Note: the installation may take more than one hour.)
6
4. Download package program
To use Contec products in the CODESYS system, a CODESYS package program is necessary.
(1) Download the CODESYS package .zip file from CONTEC web site.
http://www.contec.com/products/downloadusa.cgi?HTML=DTL&KATA=CPS-PC341EC-1-9201&KATASIKI=cps-pc&BUNRUI=0,0,0&SYUBETU=0#3
Download file: [CONPROSYS PAC Series120.zip]
Unzip the downloaded file to [CONTEC CONPROSYS PAC Series.package]
7
5. Connect Devices
Connect the CODESYS development PC and the EtherCAT master device, CPS-PC-341EC-1-9201 with
Ethernet cable.
1) Connect LAN A of CPS-PC341EC-1-9201 with the computer via Ethernet cable.
2) Connect LAN B of CPS-PC341EC-1-9201 with “IN” port of DIO-1616LN-CAT via Ethernet cable.
(The factory default setting of IP address for LAN A is [10.1.1.101], and [192.168.1.101] for LAN B.
Subnet masks are [255.0.0.0] and [255.255.255.0] for LAN A and LAN B respectively. )
3) Power on the development PC.
4) Supply +12VDC power to the EtherCAT devices and the devices will start up automatically.
5) Change network setting for PC. Because the default IP address of LAN A of the CPS-PC341EC-1-9201 is
[10.1.1.101], therefore, set the IP address of the development PC to [10.1.1.102] and the subnet mask to
[255.0.0.0].
6) Confirm the communication of the development PC with the EtherCAT master device by using “ping
command”. (ping 10.1.1.101).
8
6. Connect signals of DIO-1616LN-CAT
Connect output connector to input connector.
+12VDC
to
+24VDC
GND
To External Power Supply
9
7. Start Development System
Start the CODESYS Integrated Development Environment from the short-cut icon or from the Windows
Program list.
Note: In this guide, the version of CODESYS development system is “CODESYS V3.5 SP10 Patch 2”.
10
7-1. Install CODESYS package for CONPROSYS file
1) From the CODESYS system menu, select [Tools] – [Package Manager…].
2) From the Package Manager window, click [Install…], then select the downloaded package file:
[CONTEC CONPROSYS PAC Series.package] to start the package file installation.
(Refer page 6, “4. Download package program”).
11
8. Create a New Project
(1) Select [File] [New project] on the CODESYS menu.
(2) In the New Project dialog, select [Projects] from the Categories and [Standard project] from the Templates.
(3) Specify the Name and the Location of the project, then click [OK].
12
8. Create a New Project
(4) In the Standard Project dialog, select the controller device and programming language.
Select [CODESYS Control CONTEC CPS-PCEC-1 (CONTEC CO., LTD.)] as the controller device.
Select [Structured Text (ST)] for this sample program.
Then click [OK].
13
8. Create a New Project
(5) In the first time, after added the device of CPS-PC341EC-1, CODESYS IDE system may show several error
messages because missing necessary library functions.
(If nor any error message occurs, go direct to page 15, “9. Connect the EtherCAT Device”.
14
8. Create a New Project
(6) If any error occurs, double click the [Library Manager], and in the Library Manager window, click the
[Download missing libraries] button. Repeat this operation until the number of error message becomes “0”.
Double Click
15
9. Connect the EtherCAT Device
(1) On the Device window, double click the control device [CODESYS_Control_CONTEC_CPS_PC341EC_1].
(2) Select [Communication Settings] in the control device tab.
(3) Enter [10.1.1.101] into the right text-box, then press [Enter] key on your keyboard.
If the color of the circle changes to green, it indicates the connection to
CPS-PC341EC-1-9201 has been established.
(1)
(2)
(3)
Note: If in step (3), system cannot connected the device successfully, try step (3) again
until the connection active.
16
10. Add EtherCAT Master Device
Right click the [CODESYS Control CONTEC CPS-PC341EC-1] device, select [Add Device], from the [Add
Device] window, select [EtherCAT Master 3S-Smart Software Solutions GmbH] from [Fieldbuses]
[EtherCAT] [Master], click [Add Device] button. Then close the [Add Device] window.
Right Click
17
11. Add EtherCAT Slave Device
1) Right-click on the [EtherCAT_Master (EtherCAT Master)] icon in the device window and select the [Add
Device].
2) From the [Add device] window, select the [Fieldbuses] - [EtherCAT] - [Slave] -
[CONTEC Co., Ltd. ECAT-DIO Units] [DIO-1616LN-CAT (16 Inputs and 16 Outputs)].
Right Click
18
12. Network Configuration of EtherCAT Master
1) Double click the [EtherCAT_Master (EtherCAT Master)] icon on the device window to open the
configuration window.
2) In [General] tab, click [Browse] button and from the popup window, select [eth1].
Double Click
19
13. Add POU
1) Right click the [Application] icon on the device window, select [Add Object], from the popup window,
select [POU].
2) From [Add POU] window, change the [Implementation language] to [Structured Text (ST)].
Right Click
20
14. Configure EtherCAT I/O Mapping
1) Double click the [DIO_1616LN_CAT (DIO-1616LN-CAT (16 Inputs and 16 Outputs))] icon on the device
window.
2) In the [DIO-1616LN-CAT]configuration window, select [EtherCAT I/O Mapping].
3) Double click on [Variable] row and define the DO0-7 byte as [DOPORT0], DO8-15 byte as [DOPORT1],
and DI0-7 byte as [DIPORT0] respectively.
Double Click
/