Contec CPS-PCS341EC-DS1-1201 Getting Start Guide

Type
Getting Start Guide

This manual is also suitable for

Program an EtherCAT Control System
__ Getting Started Guide 3
1
2
1. Objective
Show how to program a sample EtherCAT control system by using a Contec EtherCAT slave
device, CPS-ECS341-1-011 + CONPROSYS I/O devices, the CPS-DIO-0808BL.
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.
Before invest a Contec EtherCAT master controller, you can invest an EtherCAT slave device,
CPS-ECS341-1-011 + a digital input and output module, CPS-DIO-0808BL first and program
a sample EtherCAT control program under a free of charge CODESYS Integrated
Development Environment (IDE).
In this guide, the EtherCAT master controller will be simulated by the development PC that
runs the CODESYS IDE software. It is trying to help you to find that by using Contec
CONPROSYS PAC controllers, built-in CODESYS Runtime system devices, it is very easy to
program an EtherCAT control system under the CODESYS Integrated Development
Environment.
Note: The simulated EtherCAT master controller (simulation PLC) is not a real time device and actives one hour.
3
2. Necessary Hardware Devices and Software products
Hardware:
A computer (Running CODESYS Integrated Development System) with one LAN (Ethernet) port and
another network to connect internet (download CODESYS IDE system and necessary library).
A Contec CPS-ECS341-1-011 EtherCAT Slave unit
A Contec CPS-DIO-0808BL module
A Contec CPS-PWD-30AW24-01 power supply (24VDC power supply)
One LAN cable
Software
CODESYS Integrated Development Environment (Download from CODESYS store free of charge)
WinPCap: an open source library for packet capture and network analysis for the Win32 platforms.
(Download from winpcap.org 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
4-1. Download packet library software
Using the development PC to simulate an EtherCAT master controller, a WinPcap open source library
software is needed.
Download the [WinPcap_4_1_3.exe] or the latest version of the WinPcap library software
from winpcap.org web site.
(1) Download and run the executable
(2) Follow the instructions on the screen. The installation applet will automatically detect the operating
system and install the correct drivers
(3) The WinPcap-based applications are now ready to work
(These three instructions are from the winpcap.org web page.)
After installation, restart the development PC.
8
5. Connect Devices
1) Attach the CPS-DIO-0808BL module to the EtherCAT slave controller, CPS-ECS341-1-011 unit.
2) Connect LAN port of development PC with “IN” port of CPS-ECS341-1-011 via Ethernet cable.
3) Power on the development PC.
4) Supply +24VDC power to the EtherCAT slave controller.
5) Change network setting of the development PC. Set the IP address of the development PC to
[192.168.1.102] and the subnet mask to [255.255.255.0].
9
6. 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. 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 to page 6,
“4. Download package program”).
Note: This package is only needed to be installed once.
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 ControlWin V3 (3S Smart Software Solutions GmbH] as the controller device.
Select [Structured Text (ST)] for this sample program.
Then click [OK].
13
9. Add EtherCAT Master Device
Right click the [CODESYS Control Win V3] 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
14
10. 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
15
11. Start PLC
(1) Start Windows System tray.
(2) Click the PLC icon the click the “Start PLC” command.
(Using similar procedure to stop the PLC).
(1)
Stopped PLC
Started PLC
(1)
(2)
(2)
(3) A runtime program will be downloaded into this simulation PLC.
(4) This simulation PLC can be active less than three hours and the executing time is not real time guaranteed.
16
12. Set Communication
(1) On the Device window, double click the control device [CODESYS Control Win V3].
(2) Select [Communication Settings] in the control device tab.
(3) Enter [192.168.1.102] into the right text-box, then press [Enter] key on your keyboard.
If the color of the circle changes to green, it indicates the communication of IDE and
LAN port of the development PC has been established.
(1)
(2)
(3)
17
13. Network Configuration of EtherCAT Device
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 [Local Area Connection].
Double Click
18
14. Configure EtherCAT I/O Mapping
1) Double click the [CPS-ECS341-1-011 (CPS-ECS341-1-011)] icon on the device window.
2) In the [CPS-ECS341-1-011]configuration window, select [EtherCAT I/O Mapping].
3) Double click on [Variable] row and define the CPS-DIO-0808BL OUT Port 1 as [DOPORT0] and the CPS-
DIO-0808BL IN Port 1 as [DIPORT0] respectively.
Double Click
19
15. Write Control Program
1) Double click the [PLC_PRG] icon on the Devices window to open the program window.
2) In the [PLC_PRG] program window, write the following program.
i) Set a data from 0 to 255 to DOPORT0 variable;
ii) Output the data to digital output port 0;
20
15. Write Control Program
Change the cycle time to visually confirm the changes of LED indicators.
3) Double click the [EtherCAT_Master (EtherCAT Master)] icon on the device window.
4) In the [EtherCAT_Master] window, change the cycle time to 20ms (20000 us).
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25

Contec CPS-PCS341EC-DS1-1201 Getting Start Guide

Type
Getting Start Guide
This manual is also suitable for

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI