Download Print this page

Advertisement

Quick Links

System Setup Guide
PAC
Series
Integrated Type / Configurable Type
CONTENTS
Introduction .................................................................. 6
Safety Precautions .................................................... 14
Set the Computer Network ................................... 18
CONPROSYS WEB Setting ..................................... 24
CODESYS Installation .............................................. 45
Basic Programming .................................................. 53
Communication Settings ....................................... 70
Monitoring Edit ...................................................... 156
Set Up Troubleshooting ...................................... 172
System Reference .................................................. 175
Appendix ................................................................... 180
Customer Support and Inquiry ........................ 183
Index ........................................................................... 185

Advertisement

loading
Need help?

Need help?

Do you have a question about the CONPROSYS PAC Series and is the answer not in the manual?

Questions and answers

Summary of Contents for Contec CONPROSYS PAC Series

  • Page 1 System Setup Guide Series Integrated Type / Configurable Type CONTENTS Introduction ..............6 Safety Precautions ............ 14 Set the Computer Network ........18 CONPROSYS WEB Setting ........24 CODESYS Installation ..........45 Basic Programming ..........53 Communication Settings ........70 Monitoring Edit ............
  • Page 2: Table Of Contents

    Table of Contents Introduction ............... 6 1. About the Product ..............................7 1. PAC series functionality ..........................7 2. Manual composition..............................9 3. Procedure until ready to use ........................... 10 4. Related manuals ..............................11 5. Online Help ................................12 6. Check the firmware version ..........................13 Safety Precautions ............
  • Page 3 Table of Contents 14. Editor .................................. 43 15. Viewer ................................44 16. Save Page ................................. 44 CODESYS Installation ............45 1. Installation of the CODESYS ..........................46 2. Installation of the Package ..........................48 3. PC and CONPROSYS cable connection ....................... 49 4.
  • Page 4 Table of Contents 3. Modbus TCP Master setting ........................87 4. Create and build a program........................89 5. Download and run program ........................90 4. Use the controller as Modbus TCP Slave ....................91 1. Device preparation ............................91 2. Slave setting ..............................92 3.
  • Page 5 Table of Contents 2. CONPROSYS HMI Outline ..........................164 1. What You Can Do With CONPROSYS HMI ..................164 2. HMI Editor Work Areas ..........................165 3. Create a Monitoring Screen ........................165 4. Basic Procedure for Creating a Monitoring Screen ...............166 3. Summary of Available Controls ........................170 Set Up Troubleshooting ..........
  • Page 6: Introduction

    Introduction This reference manual guides how to configure the software in the product. The following chapter provides necessary information of the product such as the product configuration and manuals before actual use. — 6 —...
  • Page 7: About The Product

    — — Introduction PAC Series, Integrated Type/Configurable Type, System Setup Guide 1. About the Product The PAC series model has pre-installed software PLC “CODESYS”. 1. PAC series functionality  Support programming by “CODESYS” that complies with international standard IEC61131-3 An integrated development environment “CODESYS” for PLC programming, field bus setting ...
  • Page 8 — — Introduction PAC Series, Integrated Type/Configurable Type, System Setup Guide  Fieldbus I/O can be directly assigned to variables EtherCAT/Modbus Fieldbus support Open field network EtherCAT/Modbus master functions within.  In the CODESYS integrated development environment, fieldbus I/O can be directly assigned to variables in the same manner as the slave I/O.
  • Page 9: Manual Composition

    — — Introduction PAC Series, Integrated Type/Configurable Type, System Setup Guide 2. Manual composition This manual is composed as follows: — 9 —...
  • Page 10: Procedure Until Ready To Use

    — — Introduction PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Procedure until ready to use The followings show the standard procedure until the product is ready to use. Connect with a PC Refer to page 19 Set up the network of PC Refer to page 20 Set up with CONPROSYS WEB Setting Refer to page 25...
  • Page 11: Related Manuals

    Setup Manual Download from Read this when setting up the This describes the required items the Contec product. for setup and configuration website (PDF) procedure. Reference Manual Download from Read this when operating the...
  • Page 12: Online Help

    — — Introduction PAC Series, Integrated Type/Configurable Type, System Setup Guide 5. Online Help We offer the detailed information on “CONPROSYS VTC” for assembling processing tasks such as calculation and control as well as on “CONPROSYS HMI” for operating and editing the monitoring screen through the Online Help.
  • Page 13: Check The Firmware Version

    Before running the product, visit our website to check the firmware version and update to the latest one if necessary. Updating firmware to the latest version will resolve troubles and stabilize the operation. https://www.contec.com/download/ Download Refer to the “Firmware version up (page 42)” for further details.
  • Page 14: Safety Precautions

    Safety Precautions Understand the following definitions and precautions to use the product safely. Never fail to read them before using the product. — 14 —...
  • Page 15: Safety Information

    — — Safety Precautions PAC Series, Integrated Type/Configurable Type, System Setup Guide 1. Safety Information This document provides safety information using the following symbols to prevent accidents resulting in injury or death and the destruction of equipment and resources. Understand the meanings of these labels to operate the equipment safely. DANGER indicates an imminently hazardous situation which, if not DANGER avoided, will result in death or serious injury.
  • Page 16: Handling Precautions

    CONTEC’s website and understand the contents. Do not modify the software.  CONTEC will bear no responsibility for any problems, etc., resulting from modifying the software. Regardless of the foregoing statement, CONTEC assumes no responsibility for any errors that ...
  • Page 17: Security Warning

    — — Safety Precautions PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Security Warning When connecting to the network, be aware of security-related problems. See the examples of Security measures below and set up the product properly along with the network devices. 1.
  • Page 18: Set The Computer Network

    Set the Computer Network This chapter describes how to connect the product with a PC, set the network, and check the communication. — 18 —...
  • Page 19: Connect With A Pc

    — — Set the Computer Network PAC Series, Integrated Type/Configurable Type, System Setup Guide 1. Connect with a PC To set the product, you need to first set up the network between the PC and the product in order to establish communication.
  • Page 20: Set The Computer Network

    — — Set the Computer Network PAC Series, Integrated Type/Configurable Type, System Setup Guide 2. Set the Computer Network Follow the “Computer Network Setting Procedure” described below and set the network to make the IP addresses as shown. The product must set a unique IP address for the bold part (200 or 101) that is not used by other devices on your network.
  • Page 21 — — Set the Computer Network PAC Series, Integrated Type/Configurable Type, System Setup Guide Double-click the appeared [Ethernet]. Click the [Property] in the [Ethernet Status] dialog box... Double-click the [Internet protocol version 4(TCP/IPv4)] in the [Ethernet Properties] dialog box. — 21 —...
  • Page 22 — — Set the Computer Network PAC Series, Integrated Type/Configurable Type, System Setup Guide In the [Internet protocol version 4 (TCP/IPv4) property], set IP address and Subnet mask as shown below. Click the [OK] →the [OK] → the [Close] to close the dialog box and complete the network setting.
  • Page 23: Check Communication

    — — Set the Computer Network PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Check Communication Start the Internet Explorer 11 on your computer. Enter IP address (10.1.1.101) of the controller in the address bar, then press [Enter] key. The dialog box asking for the User name and Password appears, enter them and click the [OK].
  • Page 24: Conprosys Web Setting

    CONPROSYS WEB Setting This chapter describes the product system and functions. — 24 —...
  • Page 25: Conprosys Web Setting Outline

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide 1. CONPROSYS WEB Setting Outline The functions of the product can be set easily with the “CONPROSYS WEB Setting” through a browser. 1. Compatible Web Browser CONPROSYS WEB Setting is compatible with the following browsers. Compatible Web browser Supported Version Microsoft Internet Explorer...
  • Page 26: Conprosys Web Setting Basic Operation

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. CONPROSYS WEB Setting Basic Operation  CONPROSYS WEB Setting Page Structure Click the menu item on the left side of the screen. This opens a page to set the details of the menu on the right side of the screen.
  • Page 27: Menu Function List

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide 2. Menu Function List Menu Functions are listed below. Menu item name Function Description General setting Network setting Set up the network such as “IP address”. Page 28 User/Password setting Set up the wireless LAN setting such as “IP address”.
  • Page 28: Function Details

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Function Details 1. Network setting Set up IP address of the product and check network communications. * Networks can be set for LAN A and LAN B respectively. ...
  • Page 29: Subnet Mask

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide  IP Address Set up IP address. It is enabled when [Static IP address] is selected. [Default]: 10.1.1.101  Subnet Mask Set up Subnet mask. It is enabled when [Static IP address] is selected. [Default]: 255.0.0.0 ...
  • Page 30: User/Password Setting

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide 2. User/Password setting Add or delete a user to log in CONPROSYS WEB Setting through a Web browser. Change a password from the factory default setting and make your own password. ...
  • Page 31: Time Setting

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Time setting Set up the name of NTP server that obtains the time and date.  Time sync setting Current date and time Display the current data and time. By clicking [reload], time is updated from the synchronization server.
  • Page 32: Data Transfer Setting

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide Time zone Set a time difference between UTC (Universal Time, Coordinated) and the time of the local region where the product is used. [Default]: UTC+09(JST-9)  Change data and time When setting date and time manually, enter date and time in the field, then update.
  • Page 33: Serial Setting

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide 5. Serial setting Set up communication parameter of serial port. First, select the port number you wish to set for the serial port, then set communication parameter. ...
  • Page 34: Backup Setting

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide 6. Backup setting Create a backup file of a monitoring screen, a task program, and general settings. Click the [download] to save backup of general settings. Default file name is “config dat”. Save the file with a new name. —...
  • Page 35: Restore Setting

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide 7. Restore setting Restore a monitoring screen, a task program, and general settings from a backup file. Choose the backup file you created in the backup setting through the [Browse], then click the [upload].
  • Page 36: Save Setting

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide 8. Save setting Save the contents set in CONPROSYS WEB Setting to ROM. Click the [save to ROM]. PWR LED starts flashing and saving begins. CAUTION Do not turn off the power until PWR LED flashing has stopped. (approx.: five seconds) Without saving, the contents return to those before setting at rebooting or shutting down.
  • Page 37: Initialize Setting

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide 9. Initialize setting Initialize all of the settings to their factory defaults. Click the [initialize] to initialize the settings. Perform the [Save setting] and the [Reboot] to enable the initialized settings. 10.
  • Page 38: Mac Address

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide The screen below is shown.  Version Display the firmware version.  Serial number Display the serial number.  ID Display the required ID to register in CDS or CDS2 of cloud server. ...
  • Page 39 — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide  Web server comm log Server communication log displays the communication log from the server. Item Description Show the latest communication log from the server specified as the data Web server comm log transfer URL.
  • Page 40 — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide  License Click the [View] to display the license information of the software. The approval is required to use the software. — 40 —...
  • Page 41: Reboot/Shutdown

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide 11. Reboot/Shutdown This reboots or shut downs the product. Select “reboot” or “shutdown” and then click the [start]. LED flashing indicates rebooting or shutting down in process. 12.
  • Page 42: Firmware Version Up

    PAC Series, Integrated Type/Configurable Type, System Setup Guide 13. Firmware version up Update the firmware with “version up” file. Firmware version- up file can be downloaded from the CONTEC website. https://www.contec.com/download/ Download From the [Browse] button, specify the firmware and click the [Upload] button.
  • Page 43: Editor

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide 14. Editor Display the page to create or change the monitoring screen. Create your own monitoring screen by placing control items on the screen. * Refer to “Monitoring Edit (page 156)“ for details. —...
  • Page 44: Viewer

    — — CONPROSYS WEB Setting PAC Series, Integrated Type/Configurable Type, System Setup Guide 15. Viewer View the monitoring screen. Input signal status can be viewed on the monitoring screen. * Refer to “Monitoring Edit (page 156) “ for details. 16. Save Page Save the page created in Editor to ROM.
  • Page 45: Codesys Installation

    CODESYS Installation This chapter describes the CODESYS installation procedure. — 45 —...
  • Page 46: Installation Of The Codesys

    — — CODESYS Installation PAC Series, Integrated Type/Configurable Type, System Setup Guide 1. Installation of the CODESYS With PAC series, you can utilize the “CODESYS”, a device-independent system that is compliant with the IEC 61131-3 standard, for PLC or HMI development. To use the CODESYS, installation of the CODESYS development environment and “CODESYS Package”...
  • Page 47 — — CODESYS Installation PAC Series, Integrated Type/Configurable Type, System Setup Guide In the “Registered Customers”, enter “Email Address” and “Password” to log in. After log-in, click the “Download” to start downloading. Decompress the downloaded file, and execute the setup file (extention.exe file) to install CODESYS.
  • Page 48: Installation Of The Package

    To use this product with the CODESYS, installation of CODESYS Package for CONPROSYS is necessary. Go to the CONTEC website. From the menu Downloads, select [Drivers & Software]. Enter the product name or specify the category (PAC system) and click the [Search].
  • Page 49: Pc And Conprosys Cable Connection

    — — CODESYS Installation PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. PC and CONPROSYS cable connection Connect the LAN port of CODESYS development PC and the LAN A port of this controller with Ethernet cable. Use LAN A for communication between the controller and PC, and LAN B for EtherCAT communication and Modbus TCP Slave connection.
  • Page 50 — — CODESYS Installation PAC Series, Integrated Type/Configurable Type, System Setup Guide * The PLC controller must set a unique IP address that is not used by other devices on your network. IP address of PLC controller can be set through web browser. * Refer to “Set the Computer Network (page 18)“...
  • Page 51: Firmware Version Up

    4. Firmware version up Updates the firmware related to CODESYS. Go to the CONTEC website. From the menu Downloads, select [Drivers & Software]. Enter the product name or specify the category (PAC system) and click the [Search]. Select and click the product driver.
  • Page 52 — — CODESYS Installation PAC Series, Integrated Type/Configurable Type, System Setup Guide Rebooting starts automatically upon the completion of upgrading. Check whether the version has been promoted in the [system information] menu. — 52 —...
  • Page 53: Basic Programming

    Basic Programming This chapter describes basic procedure to operate this product with CODESYS. — 53 —...
  • Page 54: Nomenclature Of Codesys Components

    Components The basic screen display of CODESYS is viewed as below. 1. Device window, Device Configuration window Double-click the “Device (CODESYS Control CONTEC CPS-PCXXXXXXXXXX)” icon on Device window to open Device Configuration window. 2. ST Editor window Double-click the “PLC_PRG (PRG)” icon on Device window to open ST Editor window.
  • Page 55: Format And Programming Of St Language

    — — Basic Programming PAC Series, Integrated Type/Configurable Type, System Setup Guide 2. Format and programming of ST language ST language is used for an example programming in this manual. Formats of basic ST language such as assignment expression, conditional expression, and commenting out are listed.
  • Page 56 — — Basic Programming PAC Series, Integrated Type/Configurable Type, System Setup Guide  Conditional expression (IF - THEN) Determine a condition, then execute or skip routine. IF StartFlag THEN (Routine) END_IF If a value of variable [StartFlag] is [True], then execute the routine placed between END_IF. ...
  • Page 57: Basic Programming Procedure

    Specify the (3) Name and the (4) Location of the project, then click the [OK]. In the Standard Project dialog, select the controller to be used in the (6) [Device]. Device can be shown as [CODESYS Control CONTEC CPS-PCXXXXXXXXXX]. From the (7) “PLC_PRG”, choose Structured Text (ST).
  • Page 58: Connect Controller From Codesys

    PAC Series, Integrated Type/Configurable Type, System Setup Guide 2. Connect controller from CODESYS On the Devices window, double click the (1) “Device (CODESYS Control CONTEC CPS- PCXXXXXXXXXX)” icon to open “Device Configuration window”. Select the (2) [Communication Settings] in the Device tab.
  • Page 59: Add I/O Modules

    — — Basic Programming PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Add I/O modules You can combine configurable type controllers to satisfy your desire. * For CODESYS device window, I/O functions within the controller are pre-registered under the tree hierarchy (listed as in PCS341XX I/O).
  • Page 60: I/O Variable Definition

    — — Basic Programming PAC Series, Integrated Type/Configurable Type, System Setup Guide 4. I/O Variable Definition In order to input or output with CODESYS, input variable to I/O Mapping or Parameters, and define variables of I/O channel. In this example, assigning variable [DO00] in bit 0 of CPS-DIO-0808BL DO port is defined as I/O variables.
  • Page 61: Create A Program And Build

    — — Basic Programming PAC Series, Integrated Type/Configurable Type, System Setup Guide 5. Create a program and build Create PLC program with defined I/O variable“DO0” that is demonstrated in the previous page “I/O Variable Definition”, and set ON output from digital output [Bit0]. This example demonstrates programming with ST language.
  • Page 62: Download And Run Program

    — — Basic Programming PAC Series, Integrated Type/Configurable Type, System Setup Guide 6. Download and run program When building a program demonstrated in the previous page [Create a program and build] is completed, log in from [Online] – [Login] on CODESYS menu. Click the [Yes] in the download confirmation dialog.
  • Page 63: Save The Plc Program Into Rom

    — — Basic Programming PAC Series, Integrated Type/Configurable Type, System Setup Guide 7. Save the PLC program into ROM Since the PLC program is downloaded to RAM, the program will be disposed upon shutting down. If you want to avoid this, save the programs into ROM area. Start the Web browser on the PC connected with the controller and enter “http://10.1.1.101/”...
  • Page 64: Delete The Plc Program Saved In Rom

    — — Basic Programming PAC Series, Integrated Type/Configurable Type, System Setup Guide 8. Delete the PLC program saved in ROM To delete the PLC program saved in ROM area, follow the steps below. Log in to the controller under the CODESYS development environment. * See the “Connect controller from CODESYS (page 58)”...
  • Page 65: Interface Definition Per Model

    — — Basic Programming PAC Series, Integrated Type/Configurable Type, System Setup Guide 4. Interface definition per model How to define I/O interface of Parameter, I/O Mapping, and Serial port with CODESYS are described below. 1. Parameter Parameter is set only once upon starting a controller. It is listed in the [Internal Parameters] on CODESYS.
  • Page 66: I/O Mapping

    — — Basic Programming PAC Series, Integrated Type/Configurable Type, System Setup Guide 2. I/O Mapping I/O Mapping conducted repeatedly per cycle time. It is listed in the [Internal I/O Mapping] on CODESYS. Model I/O Mapping Name Notation on CODESYS Meaning CPS-PC341EC-1-9201 Battery status battery...
  • Page 67 — — Basic Programming PAC Series, Integrated Type/Configurable Type, System Setup Guide Model I/O Mapping Name Notation on CODESYS Meaning CPS-CNT-3202I Counter input cnt val0-1 Counter input channel 0 to 1 Status input status0-1 Status input channel 0 to 1 Control flag output out ctrl0-1 Control flag output channel 0 to...
  • Page 68 — — Basic Programming PAC Series, Integrated Type/Configurable Type, System Setup Guide *1 SSI data format Start address Start address + 1 Start address + 2 Start address + 3 31 30 29 28 27 26 25 24 23 22 17 16 15 14 Status...
  • Page 69: Serial Port

    — — Basic Programming PAC Series, Integrated Type/Configurable Type, System Setup Guide *4 One-shot pulse width Pulse width setting data × 409.6 = Pulse width (μsec) 3. Serial Port Model Product notation Port number on CODESYS CPS-PC341MB-ADSC1-9201 COM A Port 1 COM B Port 2 CPS-PCS341EC-DS1-1201...
  • Page 70: Communication Settings

    Communication Settings This chapter describes the communication style and the settings of PAC series. — 70 —...
  • Page 71 CPS-PC341EC-1-9201 CPS-ECS341-1-011 EtherCAT master CPS-PCS341EC-DS1-1201 Slave support devices of other makers. Use the controller as CPS-PC341MB-ADSC1-9201 Slave support devices of CONTEC’s including Modbus TCP master CPS-PCS341MB-DS1-1201 CPS-MC341-ADSC1-111 Slave support devices of other makers Use the controller as CPS-PC341MB-ADSC1-9201 Modbus TCP slave...
  • Page 72: Serial Communication Between The Controller And The Pc

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 1. Serial Communication between the controller and the PC Model Slave model CPS-PC341MB-ADSC1-9201 CPS-PCS341EC-DS1-1201 CPS-PCS341MB-DS1-1201 1. Serial Communication Preparation Connect a controller and a PC via serial cable to send data from the controller to the PC and receive data from the PC to the controller.
  • Page 73: Create And Execute A Transfer Program

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Create and execute a transfer program Double click the [PLC_PRG (PRG)] icon on the device window to open the “ST editor window”. When “ST editor window” appears, write the following source code between VAR and END_VAR in the “Variable declaration”.
  • Page 74 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Com1Params[3].udiValue := INT_TO_UDINT(COM.PARITY.NONE); Com1Params[4].udiParameterId := COM.CAA_Parameter_Constants.udiStopBits; Com1Params[4].udiValue := INT_TO_UDINT(COM.STOPBIT.ONESTOPBIT); Com1Params[5].udiParameterId := COM.CAA_Parameter_Constants.udiTimeout; Com1Params[5].udiValue := 0; Com1Params[6].udiParameterId := COM.CAA_Parameter_Constants.udiByteSize; Com1Params[6].udiValue := 8; Com1Params[7].udiParameterId := COM.CAA_Parameter_Constants.udiBinary; Com1Params[7].udiValue := 0; Com1Open(xExecute:= TRUE, usiListLength:= SIZEOF(Com1Params) / SIZEOF(COM.PARAMETER), pParameterList:= ADR(Com1Params));...
  • Page 75: Character String Transfer

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Now, see whether you can execute [Rebuild”] in CODESYS [Build] menu to confirm the process succeeds.  Character string transfer Select [Online] – [Login] on the CODESYS menu. Confirmation dialog box for download appears.
  • Page 76 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Write the following source code in “Program” under “ST editor window”. IF StartFlag THEN CASE State OF Com1Params[1].udiParameterId := COM.CAA_Parameter_Constants.udiPort; Com1Params[1].udiValue := 1; Com1Params[2].udiParameterId := COM.CAA_Parameter_Constants.udiBaudrate; Com1Params[2].udiValue := 9600; Com1Params[3].udiParameterId := COM.CAA_Parameter_Constants.udiParity;...
  • Page 77 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide END_IF Com1Close(xExecute := TRUE, hCom:= Com1Open.hCom); IF Com1Close.xError THEN Error := TRUE; END_IF IF Com1Close.xDone OR Com1Close.xError THEN State := 1000; END_IF 1000: StartFlag := FALSE; END_CASE END_IF ...
  • Page 78: Use The Controller As Ethercat Master

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 2. Use the controller as EtherCAT Master Model Slave model CPS-PC341EC-1-9201 CPS-ECS341-1-011 CPS-PCS341EC-DS1-1201 Slave support devices of other maker’s 1. Device preparation This section describes an example of CODESYS programming with the CPS-ECS341-1-011 as EtherCAT slave.
  • Page 79: Add Slave Device

    To use the EtherCAT slave controller, registration of the ESI (EtherCAT Slave Information) file is required. With the CONTEC slave controller, the ESI file is already pre-installed in the CODESYS package. Therefore, registering 1-3 below is unnecessary. When using the slave device of other maker’s, follow 1 to 3 to install the ESI (EtherCAT Slave Information) file.
  • Page 80 Select [CPS-ECS341-1-011] or the device name you intend to use, and click the [Add Device] in the [Add Device] window. “CPS-ECS341-1-011” is located under “Fieldbuses – EtherCAT –Slave –CONTEC Co., Ltd. – CONPROSYS EtherCAT” tree hierarchy. Double click the [EtherCAT_Master (EtherCAT Master)] icon on the device window to open the configuration window.
  • Page 81: Set Slave Device

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Set Slave Device This section describes how to set EtherCAT slave device to output ON/OFF data continuously from bit0 of output 2-port of CPS-DIO-0808L. Double click the [CPS-DIO-0808L] icon on the device window. When the CPS-DIO-0808L configuration window appears, select [EtherCAT I/O Mapping].
  • Page 82: Create A Program And Build

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 4. Create a program and build Step 1 and 2 are the instructions of creating a program to output ON/OFF data continuously from bit0 of output 2-port of CPS-DIO-0808L. Step 3 and 4 are the cycle time setting to check LED flashing.
  • Page 83: Download And Run Program

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Execute [Build] – [Rebuild] on the CODESYS menu and check whether the [Build] process succeeds. 5. Download and run program Select [Online] – [Login] on the CODESYS menu. Click the [Yes] in the download confirmation dialog.
  • Page 84: Use The Controller As Modbus Tcp Master

    This section describes an example of using a controller as Modbus TCP Master to input/output data with Modbus TCP Slave. Here, CONTEC CPS- PC341MB-ADSC1-9201 is used as Modbus TCP Master, and CONTEC CPS- MC341-ADSC1-111 is used as Modbus TCP Slave.
  • Page 85: Add Slave Device

    Choose the name of connected Modbus model for device, and ST for IEC program language. *See “Create a New Project (page 57)” for how to create the project. Right-click on the controller [Device (CODESYS Control CONTEC CPS-PCXXXXXXXXXX)] on the device window and select the [Add device].
  • Page 86 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Click the button next to [Interface] textbox, and select [eth1] in the list. [eth1] will be set as an internal name of LAN B. On the Device window, double click the [Modbus_TCP_Slave] icon to open Device Configuration window.
  • Page 87: Modbus Tcp Master Setting

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Modbus TCP Master setting This section describes how to create samples of 2-bit digital output and 4-bit digital input. The table below is the function code of the slave device CPS-MC341-ADSC1-111. Name/Function code Address Data...
  • Page 88 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Click the [Add channel] button. Select [Write Single Coil (function code 5)] from Access type, and enter “0” into Write register offset, then click the [OK]. Click the [Add channel] button. Select [Write Single Coil (function code 5)] from Access type again, and enter “1”...
  • Page 89: Create And Build A Program

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 4. Create and build a program Double click the [PLC_PRG (PRG)] icon on the device window to open the “ST editor window”. When ST editor window appears, write the following source code between VAR and END_VAR in the “Variable declaration”.
  • Page 90: Download And Run Program

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Now, see whether you can execute [Rebuild] in CODESYS [Build] menu to confirm the process succeeds properly. 5. Download and run program Select the [Online] – [Login] on the CODESYS menu. Click the [Yes] in the download confirmation dialog.
  • Page 91: Use The Controller As Modbus Tcp Slave

    This section describes an example of using a controller as Modbus TCP Slave to input/output data with Modbus TCP Master. Here, the PC with CODESYS developing environment is used as Modbus TCP Slave, and CONTEC CPS- PC341MB-ADSC1-9201 is used as Modbus TCP Slave for CODESYS programming.
  • Page 92: Slave Setting

    Choose ST for IEC program language. *See “Create a New Project (page 57)” for how to create the project. Right-click on the controller [Device (CODESYS Control CONTEC CPS-PCXXXXXXXXXX)] on the device window, and select the [Add device]. In the [Add device] dialog box, select [Fieldbuses - Ethernet Adapter - Ethernet] and click the [Add device] button.
  • Page 93 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Click the button next to the [Interface] textbox, and select the [eth0] in the list. * IP address is set for Ethernet Adapter * "eth0" is set as an internal name of LAN A. On the Devices window, double click the [PC341MB_I_O] icon to open Device Configuration window.
  • Page 94 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Click the [Modbus TCP Slave Device I/O Mapping]. Define variables as follows: Variable (Input value) Channel Address Input %IW1 Input[0] %IW1 mDO0 Bit0 %IX2.0 mDO1 Bit1 %IX2.1 Bit15 %IX3.7 Input[1] %IW2...
  • Page 95 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide — 95 —...
  • Page 96: Create A Program And Build

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Create a program and build Double click the [PLC_PRG (PRG)] icon on the device window to open the “ST editor window”. Write the following source code in “Program” under “ST editor window”. mDI0 := DI0;...
  • Page 97: Download And Run Program

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 4. Download and run program Following steps 1-10 describe an example of outputting 1 into digital output bit 0. Step 11 and 12 describe an example of inputting counter input 0 data. Select the [Online] –...
  • Page 98 Set "0" in the “Start Address" and click the [Scan] icon. Double click on the part where "0" is shown and change it to "1". You can see that DO0 LED of CONTEC CPS-PC341MB-ADSC1-9201 is on. Choose the [Read Input Registers (0x04)] in “Function Code”.
  • Page 99 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Enter “3” into “Start Address”, and “2” into “Number of Registers”, then click the [Scan] icon. Lower 16-bit of the counter 0 is displayed on the left, and Upper 8-bit of the counter is displayed on the right.
  • Page 100: Use The Controller As Modbus Rtu Master

    This section describes an example of using a controller as Modbus RTU Master to input/output data with Modbus RTU Slave. Here, CONTEC CPS-PC341MB-ADSC1-9201 is used as Modbus RTU Master, and CONTEC CPSN- MCB271-S1-041 is used as Modbus RTU Slave. Connect LAN A of the controller to LAN port of CODESYS developing PC.
  • Page 101: Add Slave Device

    Choose the name of connected Modbus model for device, and ST for IEC program language. *See “Create a New Project (page 57)” for how to create the project. Right-click on the controller [Device (CODESYS Control CONTEC CPS-PCXXXXXXXXXX)] on the device window and select the [Add device].
  • Page 102 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Set the parameter in order to communication by Modbus RTU. On the Device window, double click the [Modbus_Slave_COM_Port] icon to open Device Configuration window. Open the [General] tab. Enter the slave device address into the [Slave Address].
  • Page 103: Modbus Rtu Master Setting

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Modbus RTU Master setting This section describes how to create samples of 2-bit digital output and 8-bit digital input. Here, Modbus register of slave device is registered as below. Name/Function code Address Data...
  • Page 104 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Click the [ModbusGenericSerialSlave I/O Mapping]. Allocate "DI0","DOBIT0","DOBIT1" to Channel0 [0], Channel1 [0], Channel2 [0] respectively. — 104 —...
  • Page 105: Create And Build A Program

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 4. Create and build a program Double click the [PLC_PRG (PRG)] icon on the device window to open the “ST editor window”. When ST editor window appears, write the following source code between VAR and END_VAR in the “Variable declaration”.
  • Page 106: Download And Run Program

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Now, see whether you can execute [Rebuild] in CODESYS [Build] menu to confirm the process succeeds properly. 5. Download and run program Select the [Online] – [Login] on the CODESYS menu. Click the [Yes] in the download confirmation dialog.
  • Page 107: Use The Controller As Modbus Rtu Slave

    This section describes an example of using a controller as Modbus RTU Slave to input/output data with Modbus RTU Master. Here, the PC with CODESYS developing environment is used as Modbus RTU Slave, and CONTEC CPS-PC341MB-ADSC1-9201 is used as Modbus RTU Slave for CODESYS programming.
  • Page 108: Slave Setting

    Choose ST for IEC program language. *See “Create a New Project (page 57)” for how to create the project. Right-click on the controller [Device (CODESYS Control CONTEC CPS-PCXXXXXXXXXX)] on the device window, and select the [Add device]. In the [Add device] dialog box, select [Fieldbuses – Modbus – Modbus Serial Port – Modbus COM] and click the [Add device] button.
  • Page 109 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Set the parameter in order to communication by Modbus RTU. On the Devices window, double click the [Modbus_Serial_Device] icon to open Device Configuration window. Open the [General] tab. Enter the slave device address into the [Unit ID].
  • Page 110 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide On the Devices window, double click the [Modbus_Serial_Device] icon to open Device Configuration window. Click the [Modbus Serial Device I/O Mapping]. Define variables as follows: Variable (Input value) Channel Address Input...
  • Page 111 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide — 111 —...
  • Page 112: Create A Program And Build

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Create a program and build Double click the [PLC_PRG (PRG)] icon on the device window to open the “ST editor window”. Write the following source code in “Program” under “ST editor window”. mDI0 := DI0;...
  • Page 113: Download And Run Program

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 4. Download and run program Following steps 1-10 describe an example of outputting 1 into digital output bit 0. Step 11 and 12 describe an example of inputting counter input 0 data. Select the [Online] –...
  • Page 114 Set "0" into the "Start Address", and "2" into "Number of Coils", then click the [Scan] icon. Double click on the part where "0" is shown and change it to "1". You can see that DO0 LED of CONTEC CPS-PC341MB-ADSC1-9201 is on. — 114 —...
  • Page 115 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Choose the [Read Input Registers (0x04)] in “Function Code”. Enter “3” into “Start Address”, and “2” into “Number of Registers”, then click the [Scan] icon. Lower 16-bit of the counter 0 is displayed on the left, and Upper 8-bit of the counter is displayed on the right.
  • Page 116: Opc Ua Server Setting

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 7. OPC UA Server setting Add the OPC-UA Server functions to CODESYS. 1. Device preparation Open the project created in the “Basic programming procedure (page 57)” on CODESYS. In this section, use UaExpert by Unified Automation as OPC-UA Client software.
  • Page 117 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide When “Symbol configuration” window appears, select variables to be used for OPC-UA Server from the list. In this example, check off the box of [DO0] under the [IoConfig_Global_Mapping]. Build the program to see whether errors don’t occur, then log in to the controller to start the operation.
  • Page 118: Opc-Ua Client Setting

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. OPC-UA Client setting Start UaExpert of OPC-UA Client software and click the [+] icon to add server. Double click the [Double click to Add Server...]. Enter IP address of the controller "opc.tcp://10.1.1.101" into URL. When the tree created, select the [CODESYS OPC UA Server] and click the [OK].
  • Page 119 Choose the server and click the Connect Server icon. Variables registered in CODESYS OPC Configurator is listed under [Root¥Objects¥Contec/Cortex/Linux¥Application¥PLC_PRG¥] in the [Address Space] tree hierarchy. Drag variables you wish to monitor (DO0 -in this example) into the [Data Access View] window to check the status of the variables.
  • Page 120: Counter Input

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 8. Counter Input To perform the counter input, connect the I/O module CPS-CNT-3202I to CPU configurable controller. After completing the programming preparation described in the ”Basic programming procedure (page 57)”, Follow steps in the diagrams below to perform programming.
  • Page 121: Event Procedure Flow

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 2. Event procedure flow — 121 —...
  • Page 122: Count Value Setting Operation Flow

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Count value setting operation flow — 122 —...
  • Page 123: Sample Program

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 4. Sample program Sample programs listed in the previous pages are offered. Program title Function Sample 1 To set CPS-CNT-3202I and perform the counter input. Sample 2 When an event in which the value of counter input coincides with Compare value output occurs.
  • Page 124 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide  Sample 1 To set CPS-CNT-3202I and perform the counter input. Variable declaration uiState: UINT := 0; dwCounter: DWORD; Program CASE uiState OF CNT0_OutCtrl := 0; CNT0_EventReset := 0; uiState := 1;...
  • Page 125 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide  Sample 2 When an event in which the value of counter input coincides with Compare value output occurs. Variable declaration uiState: UINT := 0; dwCounter: DWORD; byEvent: BYTE; Program CASE uiState OF CNT0_OutCtrl := 0;...
  • Page 126 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide END_CASE  Sample 3 To change the count value during an operation. Variable declaration uiState: UINT := 0; dwCounter: DWORD; byEvent: BYTE; Program CASE uiState OF CNT0_OutCtrl := 0; CNT0_EventReset := 0;...
  • Page 127 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide byInCtrl := CNT0_InCtrl; dwCounter := CNT0_CntVal; IF (byInCtrl AND 16#02) = 16#02 THEN uiState := 6; END_IF CNT0_OutCtrl := CNT0_OutCtrl AND 16#FD; uiState := 7; byInCtrl := CNT0_InCtrl; dwCounter := CNT0_CntVal;...
  • Page 128: File Access

    * See “Create a New Project (page 57)” for how to create the project. Double-click the [Library Manager] on the device window. Click “Add Library” and choose “CONTEC File Access Library” under “(Miscellaneous)” tree hierarchy, then click the [OK]. 2. Function list...
  • Page 129: Data Type

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Data type  ERROR Name Value Meaning This indicates successful completion. NO_ERROR INVALID_PARAM This indicates an invalid parameter. This indicates resource insufficiency. INTERNAL_ERROR This indicates an invalid handle number. INVALID_HANDLE NOT_EXIST This indicates no file exists.
  • Page 130: Function Details

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 4. Function details  CFA_FileAccess Operating functions This controls access to the specified area. Input value Name Data type Meaning eArea AREATYPE This specifies area types to access. As RAM area is always Read/Write-able, no control by this function is necessary.
  • Page 131 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Output value Name Data type Meaning eError ERROR This indicates an error code. hFile DWORD This specifies a handle number of the file.  CFA_FileClose Operating functions This closes a file. Input value Name Data type...
  • Page 132 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide  CFA_FileRead Operating functions This reads data from a file. Input value Name Data type Meaning hFile DWORD This specifies a handle number of the file pBuffer POINTOR TO This specifies an address of the area to store data that are read.
  • Page 133 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide  CFA_FileSeek Operating functions This moves a file pointer to the specified position. Input value Name Data type Meaning hFile DWORD This specifies a handle number of the file diOffset DINT This specifies the number of the bytes to move from the reference...
  • Page 134 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide  CFA_FilePutLine Operating functions This writes a string to a file. A carriage return will be automatically added at the end of the string. Input value Name Data type Meaning hFile DWORD...
  • Page 135: Operating Functions

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide  CFA_StringSeparate Operating functions This separates a string with a delimiter. Input value Name Data type Meaning pszString POINTER TO This specifies an address to separate a string. STRING pszSeparator POINTER TO...
  • Page 136: Sample Program

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 5. Sample program Here are sample programming steps. Double click the [PLC_PRG (PRG)] icon on the device window to open the “ST editor window”. When “ST editor window” appears, write the following source code between VAR and END_VAR in the “Variable declaration”.
  • Page 137 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Program CASE uiState OF CFA_FileAccess.eArea := eAreaType; CFA_FileAccess.bMount := TRUE; CFA_FileAccess.bWriteEnable := TRUE; CFA_FileAccess(eError => eError); IF eError = 0 THEN uiState := 1; ELSE uiState := 5; END_IF CFA_FileOpen.eArea := eAreaType;...
  • Page 138 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide  Sample2 To read a file on a USB device. Variable declaration uiState: UINT := 0; eAreaType: INT := CONTEC_File_Access_Library.AREATYPE.USB; sFileName: CONTEC_File_Access_Library.FILENAME := 'sample1.dat'; hFile: CONTEC_File_Access_Library.HANDLE := 16#FFFFFFFF; eError: CONTEC_File_Access_Library.ERROR;...
  • Page 139 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide CFA_FileRead.pBuffer := ADR(byBuffer); CFA_FileRead.szBuffer := 128; CFA_FileRead(hFile := hFile, szSize => szSize, eError => eError); IF eError = 0 THEN IF szSize = 0 THEN uiState := 3; END_IF ELSE uiState := 3;...
  • Page 140 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide  Sample3 To get a file size by using a file pointer move function. Variable declaration uiState: UINT := 0; eAreaType: INT := CONTEC_File_Access_Library.AREATYPE.USB; sFileName: CONTEC_File_Access_Library.FILENAME := 'sample1.dat'; hFile: CONTEC_File_Access_Library.HANDLE := 16#FFFFFFFF;...
  • Page 141 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide CFA_FileClose(hFile := hFile, eError => eError); uiState := 4; CFA_FileAccess.eArea := eAreaType; CFA_FileAccess.bMount := FALSE; CFA_FileAccess.bWriteEnable := FALSE; CFA_FileAccess(eError => eError); uiState := 5; END_CASE — 141 —...
  • Page 142 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide  Sample 4 To delete a file on a USB device. Variable declaration uiState: UINT := 0; eAreaType: INT := CONTEC_File_Access_Library.AREATYPE.USB; sFileName: CONTEC_File_Access_Library.FILENAME := 'sample1.dat'; eError: CONTEC_File_Access_Library.ERROR; CFA_FileAccess: CONTEC_File_Access_Library.CFA_FileAccess; CFA_FileDelete: CONTEC_File_Access_Library.CFA_FileDelete;...
  • Page 143 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide  Sample5 To write or read strings by single line for the file on RAM area. Variable declaration uiState: UINT := 0; eAreaType: INT := CONTEC_File_Access_Library.AREATYPE.RAM; sFileName: CONTEC_File_Access_Library.FILENAME := 'sample2.txt'; hFile: CONTEC_File_Access_Library.HANDLE := 16#FFFFFFFF;...
  • Page 144 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide CFA_FilePutLine.pszString := ADR(sStringData2); CFA_FilePutLine(hFile := hFile, eError => eError); uiState := 3; CFA_FileClose(hFile := hFile, eError => eError); uiState := 4; CFA_FileOpen.eArea := eAreaType; CFA_FileOpen.sFileName := sFileName; CFA_FileOpen.sFileMode := 'r'; CFA_FileOpen(hFile =>...
  • Page 145: Transfer Data To Cloud Server

    *See “Create a New Project (page 57)” for how to create the project. Double-click the [Library Manager] on the device window. Click the [Add Library] and choose [CONTEC File Access Library] under “(Miscellaneous)” tree hierarchy, then Click the [OK]. 2. Function list...
  • Page 146: Function List

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Function list  ERROR Name Value Meaning NO_ERROR This indicates successful completion. INVALID_PARAM This indicates an invalid parameter. INTERNAL_ERROR This indicates resource insufficiency. TX_NODATA This indicates no file exists or no data in the data file. TX_PENDING Data sending was not performed due to the calling the Cloud sending function in a short period.
  • Page 147 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide  FILEPARAM Name Value Meaning MAX_SIZE This indicates a data file maximum size in 1K byte. TIME_FORMAT This indicates the format type of the time data. 0: YYYYMMDD,hhmmss, millisecond 1: YYYYMMDDhhmmss 2: YYYYMMDDhhmm 3: YYYYMMDD...
  • Page 148: Function Details

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 4. Function details  CDT_FileSetValue Operating functions Create a data file to send to the server. Data are separated with a comma in a CSV format to be saved. Input value Name Data type...
  • Page 149 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide  CDT_FileSetParameter Operating functions Set the details of parameter regarding a data file. Input value Name Data type Meaning iFileNo This specifies file number (0 to 9). eParamNo FILEPARAM This specifies the parameter number.
  • Page 150 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide  CDT_CloudSend Operating functions Send the created data file to the Cloud service. The data file that has been sent will be deleted. Input value Name Data type Meaning iFileNo This specifies file number (0 to 9).
  • Page 151 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Output value Name Data type Meaning eError ERROR This indicates an error code.  CDT_CloudGetInformation Operating functions Get information regarding sending to the Cloud. Input value Name Data type Meaning eInfoNo CLOUDINFO...
  • Page 152: Sample

    — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide 5. Sample Here are sample programming steps. Double click the [PLC_PRG (PRG)] icon on the device window to open the “ST editor window". When “ST editor window” appears, write the following source code between VAR and END_VAR in the “Variable declaration”.
  • Page 153 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide Program CASE uiState OF CDT_FileSetParameter.eParamNo := CONTEC_Data_Transfer_Library.FILEPARAM.MAX_SIZE; CDT_FileSetParameter.pValue := ADR(usFileSize); CDT_FileSetParameter(iFileNo := iFileNo, eError => eError); CDT_FileSetParameter.eParamNo := CONTEC_Data_Transfer_Library.FILEPARAM.TIME_FORMAT; CDT_FileSetParameter.pValue := ADR(iTimeFormat); CDT_FileSetParameter(iFileNo := iFileNo, eError => eError); dwTimerCount1 := 0;...
  • Page 154 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide CDT_FileSetValue.pValue := ADR(DiData[iIndex]); CDT_FileSetValue(eError => eError); END_FOR CDT_FileSetValue.eType := CONTEC_Data_Transfer_Library.DATATYPE.VAL_LREAL; FOR iIndex := 0 TO 3 DO CDT_FileSetValue.pValue := ADR(TempData[iIndex]); CDT_FileSetValue(eError => eError); END_FOR CDT_FileSetValue.eType := CONTEC_Data_Transfer_Library.DATATYPE.CRLF; CDT_FileSetValue.pValue := 0; CDT_FileSetValue(eError =>...
  • Page 155 — — Communication Settings PAC Series, Integrated Type/Configurable Type, System Setup Guide  Sample2 To set the time data obtained in application. It is necessary to add “SysTime” in “System”-“SysLibs” of the [Library Manager] for SysTimeRtcHighResGet(). Variable declaration uiState: UINT := 0; iFileNo: INT := 0;...
  • Page 156: Monitoring Edit

    Monitoring Edit This chapter describes the CONPROSYS HMI (Human Machine Interface), with which you can create a monitoring screen through a web browser and check the operations, errors, or standstill in the facilities. — 156 —...
  • Page 157: Use Conprosys Hmi

    — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide 1. Use CONPROSYS HMI To perform monitoring with this product, create a monitoring screen by the CONPROSYS HMI software that is included in the controller. 1. CODESYS project setting Create a CODESYS project by following the procedure described in the “Create a New Project (page 57)”...
  • Page 158: Create And Build A Program

    — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide 2. Create and build a program This example demonstrates the following CODESYS program. I/O functions from hardware are not used in this sample, only software variables are listed. Incrementer is a variable that performs count-up per cycle time.
  • Page 159 — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide Write the following source code in “Program” under “ST editor window”. IF Switch = TRUE THEN Incrementer := Incrementer + 1; IF Incrementer = 100 THEN Incrementer := 0; END_IF Status := 'BUSY';...
  • Page 160: Create A Monitoring Screen With Hmi Editor

    — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Create a monitoring screen with HMI Editor Start the Web browser on the PC connected with the controller and enter “http://10.1.1.101/” (the IP address of the PLC controller) in the address field. * See “Set the Computer Network (page 18)”...
  • Page 161 — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide Activate the ON switch and click the [Link Box] icon in Property tab located right-hand on the editor screen. Click “Refresh” in Device Tree. This updates the lists of the variables used in CODESYS. Choose “Switch”...
  • Page 162: Hmi Run By Viewer

    — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide 4. HMI run by viewer Choose “Run” in the Mode located upper right on the screen. From the [Debug] menu in CODESYS, Select the [Start]. Turning on the ON switch placed on the canvas updates the counts of Incrementer range from 0 to 100.
  • Page 163: Available Components With Iec Data Type

    — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide 5. Available components with IEC data type See below for available IEC data types of CONPROSYS HMI. BOOL BYTE USINT WORD UINT      DWORD UDINT LWORD ULINT...
  • Page 164: Conprosys Hmi Outline

    — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide 2. CONPROSYS HMI Outline 1. What You Can Do With CONPROSYS HMI Place the supplied controls on the page and create a monitoring screen. Input signal status can be monitored on the screen.
  • Page 165: Hmi Editor Work Areas

    — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide 2. HMI Editor Work Areas HMI Editor has the following work areas. Name Function Menu bar The menu bar is used to execute commands with menu buttons. Control selection area Select the controls to place on the layer area.
  • Page 166: Basic Procedure For Creating A Monitoring Screen

    — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide 4. Basic Procedure for Creating a Monitoring Screen  Place a Control (1) Select a control from the Components tree displayed on the left. (2) Drag and drop it on the Layer area.
  • Page 167 — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide  Align the Position or Adjust the Size of Controls Click the placed control to activate. Drag the border to change the position, adjust the size or the angle.
  • Page 168 — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide  Configure the Layer Select “Layer” tab at the upper right on the screen to open the layer properties. In the “Settings” of the layer properties area, click the [...] button to open the dialog box. You can set a size of monitoring screen or the background here.
  • Page 169 — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide  Save the Settings to ROM. After creating the monitoring screen, save the file with a new name. After saving, perform “Save to ROM” in the [File] before shutting down the power. * If you do not save the settings to ROM, the contents return to those before setting upon rebooting or shutting down.
  • Page 170: Summary Of Available Controls

    — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. Summary of Available Controls CONPROSYS HMI provides the following controls. Control Name Description Label This control displays a string. Border This control is a border with a title. Image This control displays an image.
  • Page 171 — — Monitoring Edit PAC Series, Integrated Type/Configurable Type, System Setup Guide Control Name Description Polyline This control is used to draw a polyline on the page. Bezier Curve This control is used to draw a Bezier curve on the page. Rectangle This control is used to draw a rectangle on the page.
  • Page 172: Set Up Troubleshooting

    Set Up Troubleshooting This section describes how to check and solve the troubles when the product does not function properly. — 172 —...
  • Page 173: If You Encounter A Problem

    — — Set Up Troubleshooting PAC Series, Integrated Type/Configurable Type, System Setup Guide 1. If you encounter a problem? Perform the following checks if you encounter a problem in the use of this product. 1. General  Check the LEDs on the front panel Check that PWR LED is on.
  • Page 174 Setup your browser as follows: Proxy server setting Set “do not use proxy server”. Dialup setting Set “do not dial”.  Product does not function properly Contact CONTEC to have the product examined. — 174 —...
  • Page 175: System Reference

    System Reference This section lists specifications hardware CONPROSYS HMI. — 175 —...
  • Page 176: Hardware Specification

    — — System Reference PAC Series, Integrated Type/Configurable Type, System Setup Guide 1. Hardware Specification 1. CPS-PC341EC-1-9201 specification Item CPS-PC341EC-1-9201 CODESYS Version V3.5 SP7 Patch2 or later version supporting Language LD, SFC, FBD, ST, IL, CFC (IEC61131-3-complied) functions Field bus EtherCAT Master, Modbus TCP Slave Communication protocol OPC-UA Server...
  • Page 177: Cps-Pcs341Ec-Ds1-1201 Specification

    — — System Reference PAC Series, Integrated Type/Configurable Type, System Setup Guide 3. CPS-PCS341EC-DS1-1201 specification Item CPS-PCS341EC-DS1-1201 CODESYS Version V3.5 SP7 Patch2 or later version supporting Language LD, SFC, FBD, ST, IL, CFC (IEC61131-3-complied) functions Field bus EtherCAT Master, Modbus TCP Slave Communication protocol OPC-UA Server Program size...
  • Page 178: Conprosys Hmi Specification

    — — System Reference PAC Series, Integrated Type/Configurable Type, System Setup Guide 2. CONPROSYS HMI Specification Item Specification Supporting IEC data type BOOL BYTE USINT WORD UINT DWORD UDINT LWORD ULINT SINT DINT LINT REAL LREAL STRING CONPROSYS HMI reserved variables PLC status Item name: Status/PLCStatus Access: R...
  • Page 179 — — System Reference PAC Series, Integrated Type/Configurable Type, System Setup Guide Item Specification PLC status Item name : Status/PLCStatus Access : R Data type : BYTE Data range : 0 (PLC stopped) or 1 (PLC busy) CPS-PCS341EC-DS1-1201 Digital input bit 0 - 3 CPS-PCS341MB-DS1-1201 I tem name : IoVariables/DI0 - 3 Access : R...
  • Page 180: Appendix

    Appendix This section describes additional information specification and the product. — 180 —...
  • Page 181: Data Transfer Format

    — — Appendix PAC Series, Integrated Type/Configurable Type, System Setup Guide 1. Data Transfer Format Data is transferred to the server via “http” or “https”. Data is posted to the specified URL by the following parameters.  Transfer Parameter List Transfer Contents Parameter 1 Parameter 2...
  • Page 182 — — Appendix PAC Series, Integrated Type/Configurable Type, System Setup Guide Connection timeout……………………20 seconds Web Sever response timeout………60 seconds  Data Transfer Web Sever Use the URL you specified in “Data transfer setting” -”Data transfer URL” in CONPROSYS WEB Setting. ...
  • Page 183: Customer Support And Inquiry

    Customer Support and Inquiry CONTEC provides the following support services for you to use CONTEC products more efficiently and comfortably. — 183 —...
  • Page 184: Services

    — Customer Support and Inquiry PAC Series, Integrated Type/Configurable Type, System Setup Guide 1. Services CONTEC offers the useful information including product manuals that can be downloaded through the Contec website. Download https://www.contec.com/download/ You can download updated driver software, firmware, and differential manuals in several languages.
  • Page 185: Index

    Index — 185 —...
  • Page 186 — — Index PAC Series, Integrated Type/Configurable Type, System Setup Guide OPC UA Server setting ..............116 OPC-UA Client software .............. 116 B OPC-UA Symbol configuration ..........69 Basic programming procedure ........... 57 P C PAC series functionality ..............7 Parameter ....................
  • Page 187: Revision History

    For product information: Contact your retailer if you have any technical questions about a  CONTEC product or need its price, delivery time, or estimate information. Company and product names that are referred to in this manual are generally trademarks or ...
  • Page 188 3-9-31, Himesato, Nishiyodogawa-ku, Osaka 555-0025, Japan https://www.contec.com/ No part of this document may be copied or reproduced in any form by any means without prior written consent of CONTEC CO., LTD. PAC Series, Integrated Type/Configurable Type, System Setup Guide NA04589 (LYTJ744) 12112018_rev4 [02222016]...