getting started with ac500-eco starter-kitftp.gongkong.com/uploadfile/datum/2009-11/... · this is...
TRANSCRIPT
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 1 -
Getting Started
with
AC500-eCo
Starter-Kit
About this heft:
This is an introduction to descript how to use the AC500-eCo Starter-Kit. For further information about the AC500-eCo please refers to the system date of the AC500. Chapter 1 Starter-Kit Descriptions: describes the contents of the AC500-eCo Starter-Kit, a short information of the hardware and how to mounting the Starter-Kit. After that, when you want directly program, you can start with the chapter 3. Chapter 2 AC500 Software Description: gives general information about the PS501 Control Builder. Chapter 3 Programming Example: gives 2 little examples to describe how to create a program with the AC500-eCo Starter-Kit. The Appendix (Chapter 4) gives the further information of the AC500-eCo Hardware and the Software. It contains also another example.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 3 -
Table of Contents
About this heft: ...............................................................................................................- 2 -
1. AC500-eCo Starter-Kit Description ...........................................................................- 4 - 1.1 General Information about the AC500-eCo Starter-Kit ...............................................- 4 -
1.2 Mounting of the AC500-eCo Starter-Kit .....................................................................- 5 -
1.3 Installation the PS501 Control Builder ........................................................................- 7 -
2. Short Description PS501 Control Builder.................................................................- 8 - 2.1 Features of the PS501 Control Builder ........................................................................- 8 -
2.2 PS501 Control Builder Overview ..............................................................................- 10 -
3. Programming Example.............................................................................................- 11 - 3.1 Example for electric Motor Initiation Control and Rotation......................................- 11 -
3.2 Simple Example for Getting started ...........................................................................- 18 -
3.2.1 Creating a new Project ........................................................................................- 18 -
3.2.2 Saving the Project to the PC................................................................................- 19 -
3.2.3 Specifying the Hardware Configuration .............................................................- 20 -
3.2.4 Opening the function Block Diagram Editor and Program.................................- 21 -
3.2.5 Compiling the Project..........................................................................................- 22 -
3.2.6 Setting the Communication Parameters ..............................................................- 23 -
3.2.7 Testing the Program without PLC Hardware connected.....................................- 24 -
3.2.8 Downloading the Program to the PLC ................................................................- 24 -
3.2.9 Program Visualization.........................................................................................- 25 -
3.2.10 Change the Inputs Status with the Simulator ....................................................- 28 -
3.2.11 Exit the Software...............................................................................................- 29 -
4. Appendix ...................................................................................................................- 30 - 4.1 PS501 Control Builder Operators Overview..............................................................- 30 -
4.2 Order Number ............................................................................................................- 33 -
4.3 Detail Faulty Code .....................................................................................................- 34 -
4.4 Bus System Overview ................................................................................................- 35 -
4.5 Example for a Hot Water Tank ..................................................................................- 37 -
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 4 -
1. AC500-eCo Starter-Kit Description
1.1 General Information about the AC500-eCo Starter-Kit
The AC500-eCo Starter-Kit contents following elements: 1. AC500 CPU PM554-R with AC power supply; 2. RS485-USB Programming cable; 3. A simulator; 4. A 5 poles terminal block for the power supply; 5. Software installs CD with the technical information AC500 in PDF and the getting started program examples; 6. Getting Started heft for AC500-eCo Starter-Kit (this heft); 7. AC500 brochure 8. Screw driver Short introduction about the CPU PM554-R: Power Supply: 100-240V AC; Onboard I/O: 8 digital inputs, 6 digital relay outputs; Interrupt inputs: 4 configurable (I0…I3); Fast counter: I0 as a configurable fast counter input; Output Voltage: 24V DC; PWM: 2 configurable PWM outputs; LED: displayed for the signal status Elements of the PM554-R:
1. LED PWR is green = CPU power on
2. LED RUN is green = CPU in run mode
3. LED ERR is red = Error indicated
4. Allocation of signal name (with 6 and 7
correspondences)
5. yellow LEDs to display the inputs and the
output (8 IN and 6 OUT)
6. Allocation of terminal number
7. Allocation of signal name
8. AC Power Supply terminal block
9+10. 9 and 11 poles I/O terminal block( fixed
screw-type terminals)
11. RUN/STOP switch (only be used with
screw driver)
12. COM1 RS485
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 5 -
1.2 Mounting of the AC500-eCo Starter-Kit
1. Wiring of the CPU Power Supply
CAUTION Failure to heed precaution can result in injury to people or product to property.
Be sure that the CPU is in STOP mode.
100-240V AC
The supply voltage 100~240V AC is connected to a 5-pole removable terminal block. At first, you must insert the 5 pole terminal block to the CPU. The 5 poles from left to right are L, N, FE, L+ and M. FE is for functional earth. L and N are connected to AC power supply source. L+ and M are for the voltage outputs 24V DC and 0V. After wiring, you will see the LED PWR turn to
green that means Power ON like follow:
2. Wiring the onboard I/Os of the CPU The following figure shows the electrical connection of the PM554 onboard digital inputs:
Figure 1 Wiring of the PM554 onboard digital inputs (sink or source)
L N FE L+ M
100-240V 0V FE 24V 0V
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 6 -
The following figure shows the electrical connection of the onboard digital relay outputs.
Figure 2 Wiring of the PM554-R onboard digital outputs (source)
3. Connect the PLC with your PC
Figure 3 PLC connect the PC with programming cable
4. Install the drive of the USB cable
TK503 Programming cable
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 7 -
1.3 Installation the PS501 Control Builder
If "Auto run" is set for the CD-ROM drive on your PC, the CD-ROM menu is opened automatically. Otherwise, you can start it by executing the file "CD_Menu_V5x.exe" which is located in the root directory of the CD-ROM. For instance, select "Start" -> "Run" and then enter "[X]:\CD_Menu_V5x.exe" (Where [x:] is the CD-ROM drive) to execute this file. You can switch the user interface language by selecting the desired language from the "Please select language" list box. The installation menu of PS501 is opened by clicking the button "Installation PS501".
Figure 4 Installation Menu
Clicking on "Read me for installation" to display the read me file containing additional information regarding the installation of the software. Sequence of the installation The following installation menus are available: 1. Step 1: Installation of the Control Builder software 2. Step 2: Installation the GSD and EDS files 3. Opt. 1: Installation of the documentation If you require all components, carry out the installation following the order given above (steps 1-3). If only the programming software is required, you just have to install the Control Builder (step 1). During the installation of the programming software, the communication drivers and the OPC server are installed as well. The following system requirements must be fulfilled: - Windows 2000 or Windows XP - Internet Explorer 4.01 ("Version 4.72.2106.7" or higher) Registry: HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Version
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 8 -
2. Short Description PS501 Control Builder
2.1 Features of the PS501 Control Builder
As one member of Automation Alliance, the PS501 Control Builder is the engineering tool for all CPU performance classes of the AC500, designed for standardized IEC61131-3 programming in six different languages. Use of the editor and debugging functions is based upon the proven development program environments of advanced programming languages.
Figure 5 Features of PS501
This software has following features:
Programming in conformity with IEC 61131-3 • Five standardized programming languages: Function Block Diagram (FBD),
Instruction List (IL), Ladder Diagram (LD), Structured Text (ST) and Sequential Function Chart (SFC)
• free graphical function chart (CFC) Debugging functions for the program test: Single step, Single cycle, Breakpoint Offline simulation
IEC 61131-3 commands can be simulated without a PLC being connected, including the relevant malfunctions. After the program test, the application can be downloaded to the control system.
Sampling trace
Timing diagrams for process variables and storage of data in a ring buffer with event trigger.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 9 -
Recipe management and watch lists Values of selected variables are displayed. Pre-defined values can be assigned to variables which can then be downloaded to the control system all at once (“Write recipe”). Ongoing values from the control system can also be pre-assigned for reading into the Watch and Recipe Manager, and stored in memory there (“Read recipe). These functions are also helpful, for example, for setting and entering control parameters.
Visualization
Includes color change, moving elements, bitmaps, text display, allows input of set point values and display of process variables read from the PLC, dynamic bar diagrams, alarm and event management, function keys and ActiveX elements.
Configurators of the communication interfaces
Integrated configurator for Ethernet, Modbus and CS31. Open interfaces
DDE and OPC. Programming
Serial or via Ethernet networks. Engineering interface
Provides access from the programming system to an external project database in which the program source code of one or several automation projects is managed. Optionally, a version control system, such as Visual Source Safe, can be used in order to ensure data consistency of the program code for several different users and projects.
• Comprehensive libraries. • Windows 32-bit standard. • Operating systems Windows 2000 and XP.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 10 -
2.2 PS501 Control Builder Overview
Figure 6 PS501 Overview
A project is put into a file named after the project. The first POU (Program Organization Unit) created in a new project will automatically be named PLC_PRG. The process begins here and other POUs can be accessed from the same point (programs, function blocks and functions). PS501 Control Builder provides extensive online help. Use the Help button of the menu bar or press F1 to obtain the information.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 11 -
3. Programming Example
This chapter will show you how to use the Starter-Kit with 2 different examples. You will find another example with PM554 and expansion S500-eCo module in the appendix.
3.1 Example for electric Motor Initiation Control and Rotation
We take the widespread use's three-phase mouse cage type asynchronous motor as the examples. Introduced that the electric motor starts (network 1) after 15 seconds later, it’s carries on the star – triangle (Y-∆) voltage dropping transformation (network 2). And only after the initiation (network 3) can this motor to the forward (network 4) or reversing (network 5) rotation control. This program used LD (Ladder Diagram) as program language. Following symbol table we use for all onboard I/Os configuration. Symbol name Comment in PLC configuration Meaning
ObDI00 Motor START with SB1 Switch SB1 to start the Motor ObDI01 Triangle initialization START
with SB2 Switch SB2 to start the Y->Δ initialization
ObDI02 Transistor ON with KH1 Transistor KH1 must always ON ObDO00 Motor ON KM1 Motor is on ObDO01 Triangle KM2 Motor is on with triangle type ObDO02 Star KM3 Motor is on with star type ObDI03 Transistor ON with KH2 Transistor KH2 must always ON ObDI04 Motor forward rotation with SB3 Switch SB3 to start the motor forward
rotation ObDI05 Motor reversing with SB4 Switch SB3 to start the motor reversing
rotation ObDO03 Motor forward KM4 Motor is forward ObDO04 Motor reversing KM5 Motor is reversing Need circuit diagram
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 12 -
1. Open a new project:
2. Open the program “Motor” from the CD
Click on the open folder button: in the Tool bar or click “file/open” and select the program “Motor.pro”. After that the program has been downloaded into your PC.
1. Open the PS501 Control
Builder software:
Start Program 3S Software CoDeSys V2.3 CoDeSys V2.3
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 13 -
3. How to understand the program
4. Setting the communication Parameters In order to send the program out of the PC we have to define the PC interface settings. Select the menu item "Online/Communication Parameters".
Network
Contact negated Contact
Series contact
Comment
Coil
Parallel contact
Function Block TIMER
PT is the turn on delay time, in this example is 15
second. After that enter the Output。 T36.Q
means the output value of the TON36.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 14 -
In the "Communication Parameters" dialog window, click on the "Gateway" button and then following the steps below:
Confirm your settings with "OK". 5. Compiling the project. In order to build the project, select the menu item “Project/Build”.
If no errors were detected, the message “0 errors, 0 warnings” is displayed in the message box. 6. Downloading the program to the PLC Now we can download the program to the PLC. Change the RUN/STOP switch to the RUN mode. First we have to load the program to the controller. To do this, select the menu item “Online/Login”.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 15 -
When no more Errors and Warning message appear, select the menu item “Online/RUN”.
. 7. Error Code When the CPU connects with the PC, it can detect carious errors according to the error classes. Error class E1 to E4 can be showed by applying the commands “diagshow all” in PLC browser in Resources.
You can also find all commands of the PLC browser by click the button on the right side.
More detailed Error code information please check Appendix 4.3
8.... Check the program with the PLC
In PLC Configuration windows you can change the digital input status to check your program. First you change the onboard digital inputs (ObDI00, ObDI01 and ObDI02) status from 0 to 1, in order to do this, double click on the quarter before the input name or you can open the first three switch of the simulator. After the program run, the status of the onboard digital outputs will be changed.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 16 -
After 15 seconds start the triangle initialization.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 17 -
After that the motor can forward rotation.
Or reversing.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 18 -
3.2 Simple Example for Getting started
Now we will learn how to program with the PS501 Control Builder. In this example, we use the programming language FBD.
3.2.1 Creating a new Project
1. Open the Software
2. Create the new project
1.Open the PS501 Control Builder software:
Start Program 3S Software CoDeSys V2.3 CoDeSys V2.3
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 19 -
The “New POU” window shows which is used to define the type of the POU. In this example, only “PLC_PRG” is used, we do not need to add more POUs, moreover, the FBD is used for programming in this POU. Finally, click the “OK” button. The PLC_PRG is the main program. Note: All necessary libraries are loaded automatically. You have finish to open a new project.
3.2.2 Saving the Project to the PC
Before designing, we should save the project, click the shortcut “Save” on the top of the window, or go to menu: “File/Save”.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 20 -
3.2.3 Specifying the Hardware Configuration
In order to specifying the hardware configuration, you must configuring the I/O parameters and define the symbolic names for I/Os.
Use the same procedure like above for the rest necessary inputs and outputs. Choose the I05 for Input5, O00 and O01 for Output0 and Output1.
Now you finish the AC500 basic set-up.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 21 -
3.2.4 Opening the function Block Diagram Editor and Program
1.From the Resources we now want to switch to the Function Block Diagram editor: Click on
the tab and then double click on the entry PLC_PRG (PRG). The Function Block Diagram editor is opened. 2. Following shows you how to created the program.
3.Position the mouse cursor into the insertion mark of network “0001” and click the right mouse button, select “network (after)”, you can now program in second network .
after click shows Then you have 0002 as the second network after the first network: 0001.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 22 -
4.Repeat the seconds steps to program the second network. You can also insert your comment with click the right mouse button, select “Comment”.
3.2.5 Compiling the Project
The definition of the project is now completed and the project can be built.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 23 -
3.2.6 Setting the Communication Parameters
In order to send the program out of the PC we have to define the PC interface settings. Select the menu item "Online/Communication Parameters".
In the "Communication Parameters" dialog window, click on the "Gateway" button and then follow the steps below:
Confirm your settings with "OK".
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 24 -
3.2.7 Testing the Program without PLC Hardware connected
Now we go to the off-line simulation mode. Select “Online/Simulation Mode” for simulation without controller. If you want to store your program in the Flash memory of the PLC to protect it against voltage breakdown you can select "Online/Create boot project".
Using "Online/Logout", the connection to the PLC is disconnected and the Force function is canceled.
3.2.8 Downloading the Program to the PLC
Before you download the program to the PLC, change the RUN/STOP switch to the RUN mode. First we have to load the program to the controller. To do this, select the menu item “Online/Login”.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 25 -
When no more Errors and Warning message appear, select the menu item “Online/RUN”.
Now your PC has been connected with the PLC.
3.2.9 Program Visualization
1. A visualization object is a CoDeSys object which is managed in the “Visualization” register of the Object Organizer. In order to create a visualization object in the Object Organizer, you
must select the register card for in the Object Organizer.
2. Enter the visualization element:
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 26 -
3. Double click on the elements for configuring this element. Establishes its parameter according to the following steps.
Set the communication between this element and I04.
To write the comments on the element.
When I04 change the
status, change this
element’s
color
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 27 -
Use the same procedure for Input05. 4. We have finish the input elements. Setting of the output elements is principle the same steps, it’s different on the parameter setting: In category Text: enter “digital output00” instead of “digital input04”; In category Variables: enter “.O00” instead of “.I04”; Use red as inside color and choose green as the alarm color. Using the same procedure for OutputO01.Then we finish our program. Red means Outputs are now 0.
Other category we using default for this example.
After of all click “OK” to confirm the configuration.
When the status of this element changes, change the color too.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 28 -
5. Click Online/Login and then Online/Run to visualization our Program.
3.2.10 Change the Inputs Status with the Simulator
When you put the 6. switch of the simulator from STOP mode to RUN mode (e.g. I05 from 0 to 1), you will also see the changes like the figure above.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 29 -
3.2.11 Exit the Software
To exit the software, select the menu item "File/Exit". But before that you must logout.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 30 -
4. Appendix
4.1 PS501 Control Builder Operators Overview
Name Meaning Variable Type Arithmetic Operators ADD Addition BYTE,WORD,DWORD,SINT,USINT,IN
T,UINT,DINT,UDINT,REAL and LREAL MUL Multiplication BYTE,WORD,DWORD,SINT,USINT,IN
T,UINT,DINT,UDINT,REAL and LREAL
SUB Subtraction BYTE,WORD,DWORD,SINT,USINT,INT,UINT,DINT,UDINT,REAL and LREAL
DIV Division BYTE,WORD,DWORD,SINT,USINT,INT,UINT,DINT,UDINT,REAL and LREAL
MOD Modulo division BYTE,WORD,DWORD,SINT,USINT,INT,UINT,DINT and UDINT
MOVE Assignment of a variable to another variable of an appropriate type
INDEXOF find the internal index for a POU
SIZEOF determine the number of bytes required by the given variable
Bitstring Operators AND Logic AND BOOL, BYTE, WORD or DWORD
OR Logic OR BOOL, BYTE, WORD or DWORD
XOR Logic XOR BOOL, BYTE, WORD or DWORD
NOT Negative BOOL, BYTE, WORD or DWORD
Bit-Shift Operators SHL Bitwise left-shift of an operand : erg:= SHL
(in, n) in gets shifted to the left by n bits.
BYTE, WORD, DWORD
SHR Bitwise right-shift of an operand: erg:= SHR (in, n) in gets shifted to the right by n bits.
BYTE, WORD, DWORD
ROL Bitwise rotation of an operand to the left: erg:= ROL (in, n) in will be shifted one bit position to the left n times while the bit that is furthest to the left will be reinserted from the right.
BYTE, WORD, DWORD
ROR Bitwise rotation of an operand to the right: erg = ROR (in, n) in will be shifted one bit position to the right n times while the bit that is furthest to the left will be reinserted from the left.
BYTE, WORD, DWORD
Selection Operators SEL Binary selection
MAX Maximum function Any type of variable
MIN Minimum function Any type of variable LIMIT MAX is the upper and MIN the lower limit for
the result Any type of variable
MUX Multiplexer Any type of variable
Comparison Operators GT Greater than BOOL,BYTE,WORD,DWORD,SINT,USI
NT,INT,UINT,DINT,UDINT,REAL,LREAL,TIME,DATE,TIME_OF_DAY, DATE_AND_TIME and STRING
LT Less than BOOL,BYTE,WORD,DWORD,SINT,USINT,INT,UINT,DINT,UDINT,REAL,LREAL,TIME,DATE,TIME_OF_DAY, DATE_AND_TIME and STRING
LE Less than or equal to BOOL,BYTE,WORD,DWORD,SINT,USINT,INT,UINT,DINT,UDINT,REAL,LREAL,TIME,DATE,TIME_OF_DAY, DATE_AND_TIME and STRING
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 31 -
GE Greater than or equal to BOOL,BYTE,WORD,DWORD,SINT,USI
NT,INT,UINT,DINT,UDINT,REAL,LREAL,TIME,DATE,TIME_OF_DAY, DATE_AND_TIME and STRING
EQ Equal to BOOL,BYTE,WORD,DWORD,SINT,USINT,INT,UINT,DINT,UDINT,REAL,LREAL,TIME,DATE,TIME_OF_DAY, DATE_AND_TIME and STRING
NE Not equal to BOOL,BYTE,WORD,DWORD,SINT,USINT,INT,UINT,DINT,UDINT,REAL,LREAL,TIME,DATE,TIME_OF_DAY, DATE_AND_TIME and STRING
Address Operators ADR Returns the address of its argument DWORD
ADRINST Within a function block instance returns the address of the instance
DWORD
BITADR Returns the bit offset within the segment DWORD
Calling Operators CAL Calling a function block or a program
Type conversions BOOL_TO Conversions
Conversion from type BOOL to any other type
TO_BOOL Conversions
Conversion from another variable type to BOOL
Conversion between Integral Number Types
Conversion from an integral number type to another number type
REAL_TO-/ LREAL_TO conversions
Converting from the variable type REAL or LREAL to a different type
STRING,BOOL,REAL and LREAL
TIME_TO/ TIME_OF_DAY Conversion
Converting from the variable type TIME or TIME_OF_DAY to a different type
DWORD. For the STRING type variable, the result is a time constant.
DATE_TO/DT_TO Conversions
Converting from the variable type DATE or DATE_AND_TIME to a different type
DWORD. For the STRING type variable, the result is a time constant.
STRING_TO Conversions
Converting from the variable type STRING to a different type
TRUNC Converting from REAL to INT
Numeric Operations ABS Returns the absolute value of a number.
ABS(-2) equals 2.
SQRT Returns the square root of a number. IN can be BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL.
LN Returns the natural logarithm of a number. IN can be BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL.
LOG Returns the logarithm of a number in base 10.
IN can be BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL.
EXP Returns the exponential function. IN can be BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 32 -
SIN Returns the sine of a number. IN can be BYTE, WORD, DWORD,
INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL.
COS Returns the cosine of number. The result is calculated in arch minutes.
IN can be BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL.
TAN Returns the tangent of a number. The value is calculated in arch minutes.
IN can be BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL.
ASIN Returns the arc sine (inverse function of sine) of a number.
IN can be BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL.
ACOS Returns the arc cosine (inverse function of cosine) of a number. The value is calculated in arch minutes.
IN can be BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL.
ATAN Returns the arc tangent (inverse function of tangent) of a number.
IN can be BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL.
EXPT Exponentiation of a variable with another variable:
IN1 and IN2 can be type BYTE, WORD, DWORD, INT, DINT, REAL, SINT, USINT, UINT, UDINT, OUT must be type REAL.
Initialization Operator INI Operator The INI operator can be used to initialize
retain variables which are provided by a function block instance used in the POU.
The operator must be assigned to a boolean variable.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 33 -
4.2 Order Number
CPUs
Type Program memory
Cycle time in ms 1000 instructions Bit/Word/Float. Point
Onboard I/Os DI/DO/AI/AO
Power supply Order Number
PM554-T 128 KB 0.3 / 0.3 / 6 8 / 6 / – / – 24 V DC 1TNE968900R0100
PM554-R 128 KB 0.3 / 0.3 / 6 8 / 6 / – / – 24 V DC 1TNE968900R0200
PM554-R-AC 128 KB 0.3 / 0.3 / 6 8 / 6 / – / – 100-240V AC 1TNE968900R0220
PM564-T * 128 KB 0.3 / 0.3 / 6 6 / 6 / 2 / 1 24 V DC 1TNE968900R1100
PM564-R * 128 KB 0.3 / 0.3 / 6 6 / 6 / 2 / 1 24 V DC 1TNE968900R1200
*All analog inputs on AC500 CPU PM564 can be configured as digital inputs.
The I/O modules
Type DI/ DO/ DC Inputs-signal Outputs-type Outputs-signal Order Number
DI561 8 / – / – 24 V DC – – 1TNE968902R2101
DI562 16 / – / – 24 V DC – – 1TNE968902R2102
DI571 8 / – / – 100-240 V AC – – 1TNE968902R2103
DO561 – / 8 / – 24 V DC Transistor 24 V DC, 0,5 A 1TNE968902R2201
DO571 – / 8 / – – Relay 24 V DC, 120/240 V AC, 2A
1TNE968902R2202
DO572 – / 8 / – – Triac 100-240 V AC, 0,3A 1TNE968902R2203
DX561 8 / 8/ – 24 V DC Transistor 24 V DC, 0,5 A 1TNE968902R2301
DX571 8 / 8 / – 24 V DC Relay 24 V DC, 120/240V AC, 0,5 A
1TNE968902R2302
DC561 – / – / 16 24 V DC Transistor 24 V DC, 0.1A 1TNE968902R2001
AI561 4 / 0 -2.5...+2.5 V, -5...+5 V, 0...5 V, 0...10 V, 0...20 mA, 4...20 mA
– 1TNE968902R1101
AO561 0 / 2 – -10...+10 V, 0...20 mA, 4...20 mA
1TNE968902R1201
AX561 4 / 2 -2.5...+2.5 V, -5...+5 V, 0...5 V, 0...10 V, 0...20 mA, 4...20 mA
-10...+10 V, 0...20 mA, 4...20 mA
1TNE968902R1301
AI562 2 / 0 PT100, PT1000, Ni100, Ni1000, Resistance: 150Ω, 300Ω
– 1TNE968902R1102
AI563 4 / 0 S, T, R, E, N, K, J, Voltage range : ±80 mV
– 1TNE968902R1103
The Starter-Kit Type Description Order Number
Starter-Kit CPU: PM554-R, AC power supply, TK503 programming cable, PS501 Control Builder software for Starter-Kit
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 34 -
Accessories
Type Descriptions Order Number
MC502: SD Memory Card 512 MB 1SAP180100R0001
MC503: SD Memory Card adapter 1TNE968901R0100
TK503: Programming cable USB => RS485 SUB-D, 5 m 1TNE968901R1100
TK504: Programming cable USB => RS485 Terminal block, 5 m 1TNE968901R2100
TA561-RTC: Real time clock 1TNE968901R3200
TA560: Lithium Battery 1TNE968901R3201
TA562-RS: Serial communication interface COM2, RS485, terminal block 1TNE968901R4300
TA562-RTC-RS: Serial communication interface COM2 with real time clock, RS485, terminal block
1TNE968901R5210
TA563-9 9 poles terminal block for S500 I/O modules, Screw Front / Cable Side, 1TNE968901R3101
TA563-11 11 poles terminal block for S500 I/O modules, Screw Front / Cable Side, 1TNE968901R3102
TA564-9 9 poles terminal block for S500 I/O modules, Screw Front / Cable Front, 1TNE968901R3103
TA564-11 11 poles terminal block for S500 I/O modules, Screw Front / Cable Front, 1TNE968901R3104
TA565-9 8 poles terminal block for S500 I/O modules, Spring Front / Cable Front, 1TNE968901R3105
TA565-11 11 poles terminal block for S500 I/O modules, Spring Front / Cable Front, 1TNE968901R3106
TA566: Wall Mounting Accessory for AC500 CPU and S500 I/O modules 1TNE968901R3107
TA567: Option cover for AC500 CPU module 1TNE968901R3202
TA568: 5 poles terminal block for AC500 CPU power supply, Cable Front / Screw Side
1TNE968901R3108
4.3 Detail Faulty Code
Error class E1 to E4 can be showed by applying the commands “diagshow all” in PLC browser in application software PS501 Control Builder.
Error class
Type Meaning Example
E1 Fatal error A safe function of the operating system is no longer guaranteed.
Checksum error in the system Flash or RAM error
E2 Severe error The operating system is functioning without problems, but the error-free processing of the user program is no longer guaranteed.
Checksum error in the user Flash, independent of the task duration
E3 Light error It depends on the application, if the user program should be stopped by the operating system or not. The user should decide which reaction is necessary.
Flash could not be programmed, I/O module has failed.
E4 Warning Error in the periphery (e.g. I/O) which only can have influence in the future. The user should decide the reaction to provide.
Short-circuit at an I/O module, the battery is exhausted or not inserted.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 35 -
4.4 Bus System Overview
Brief information about Ethernet Ethernet
Ethernet operates with a data rate of 10 MBit/s and as Fast-Ethernet with 100 MBit/s. Ethernet utilizes the producer/consumer model. This means that every station possesses equal rights. While it is transmitting, all other stations listen in and accept the data directed to them. Bus access is regulated by the CSMA/CD procedure (Carrier-Sense Multiple-Access with Collision Detection), where each station may autonomously transmit when the bus is free. If a collision occurs, if two stations begin to transmit simultaneously, both of them will stop transmission and wait for a randomly determined time before they transmit again. Ethernet defines the Layers 1 (Physical Link) and 2 (Data Link) of the OSI model. The AC500 supports transmission and reception of data using TCP/IP and/or UDP/IP. Further application layers can be implemented by subsequent loading. Simultaneous operation of TCP/IP, UDP/IP and application layer is also assured. The IP, TCP, UDP, ARP, RP, BOOTP, and DHCP protocols are supported as a standard feature, as application layer Modbus/TCP. Topology
Star- or ring-shaped using Ethernet hub or switch. Data transmission
Max. 10 MB/s with 10 Base T and max. 100 MB/s with Fast-Ethernet. Transmission media
Twisted-pair cables with RJ45 connector. The maximum cable length is 100 m for 100 MB/s. Diagnostics
Detailed diagnostic messages for rapid trouble-shooting are shown on the CPU display or can be called using the programming tool. In addition, the device status is indicated at the communication module by four LEDs.
Brief information about Modbus Modbus® RTU (developed by Modicon in 1979)
Modbus® RTU is an open master/slave protocol, and can be easily implemented on serial interfaces. Numerous automation systems have Modbus® RTU interfaces as standard or optional features, and are thus easily able to communicate with the AC500 via its integrated COM1 and COM2 interfaces (RS232 or RS485). The Modbus® is used not only in industrial applications, but also in building installations, in energy optimization systems, for long-distance data transmission and for linking up operator panels. Communication
By polling, i.e. the master transmits a request to the slave and then receives the response. Both interfaces COM1 and COM2 can operate simultaneously as Modbus interfaces. The Modbus operating mode of an interface is set using the engineering tool. Topology
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 36 -
Point-to-point via RS232 or multi-point via RS485. With RS232, a maximum of one master and one slave is possible, while with RS485 one master and a maximum of 31 slaves can be operated. The maximum cable length is 15 m with RS232 and 1.2 km with RS485. Data transfer
Max. 187.5 kB/s. Each telegram has a 16-bit CRC appended. The telegrams permit process data (input/output data) to be written and read, either individually or in groups. The data are packed in the RTU format. Transmission media
May vary. One widely used option is the RS485 bus physics, a twisted-pair, shielded cable with terminators. Diagnostics
Detailed diagnostic messages for rapid trouble-shoot-ing are shown on the CPU display or can be called using the programming tool.
Brief Information about CS31 CS31 (Communication Serial, developed by ABB in 1989) for continuity and migration
CS31 is a proprietary master/slave field bus. It is characterized by simple handling, easy configuration, and inexpensive installation. The COM1 interface of the AC500 can be configured as a CS31 field bus master. Communication
Is handled using polling, i.e. the master sends a request to the slave and then receives the response. The CS31 operating mode of COM1 is set using the engineering tool. Topology
Multi-point line, RS485, approved without branch lines. A system consists of one master and up to 31 slaves. The maximum cable length is 500 m, or 2 km with an amplifier. Slaves are primarily decentralized input/output modules with integrated CS31 bus connection. Data transmission
Is performed at 187.5 kB/s. Each telegram has an 8-bit CRC appended. The telegrams enable process data (input/output data) to be written and read. Transmission medium
Primarily a twisted-pair, shielded cable with terminators. Other transmission media: fiber-optic cables via a converter (glass fibers max. 3 km, plastic max. 100 m), contact lines, slip rings (bus length max. 50 m) and data photocells. Diagnostics
Detailed diagnostic messages for rapid trouble-shooting are shown on the CPU display or can be called using the programming tool.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 37 -
4.5 Example for a Hot Water Tank
Program part 1: One pump is connected to the Tank via a Valve. One sensor will measure the liquid level of Tank. If the liquid level of the tank is lower than 4m, the valve of the pump opens, if the liquid level is higher than 9m, the valve of the pump closes. Program part 2: On the other side, one heater is inserted into the Tank. One RTD sensor (Ni1000) will measure the temperature of the liquid. If the temperature is higher than 120°C, the switch of heater will open to heat the liquid. If the temperature is lower than 60°C, the switch of the heater will close. Program part 3: In the output part, if the liquid level is between 4m and 9m, the temperature is between 60°C and 120°C, the user open the switch of the tank, the water will flow into the user’s part. The following components are required for this example:
• One CPU type PM554
• One 100-240V AC power supply;
• One S500 digital I/O module DX561;
• One S500 analog input module AI561;
• One S500 analog RTD input module AI562 with Ni1000, -50°C…+150°C (2 wire);
• A PC with the programming software PS501 installed;
• One cable (TK503) to connect the PC to the CPU. Symbol table to this example: %QX4000.0 Alarm for underflow or overflow of liquid level
(waterLevel) PM554_DO
%QX4000.1 Alarm for highest or lowest value of water temperature (waterTemp)
PM554_DO
%QX4000.2 Alarm for user, can’t use hot water PM554_DO %IX0.0 Switch for user take the hot water DX561_DI %QX0.0 Start watering DX561_DO %QX0.1 Start warming DX561_DO %QX0.2 User may take the hot water DX561_DO %IW1 Measurement value of liquid level AI561_AI %IW5 Measurement value of temperature AI562_AI_RTD For this example we use Structured Text (ST) as program language.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 38 -
1. Open a new project: OPEN: First start the AC500 Control Builder
programming software, click to create a new project.
Select the CPU type:
Select the program language:
Select the desired CPU (in this example PM554) in the appearing window. Then in the appearing window click “OK”.
Keep the settings “PLC_PRG” and “Program” for the name and the type for this new POU, select “ST” for the language of the POU and confirm with “OK”.
The ST Editor is opened.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 39 -
Save the program:
2. Specifying the hardware configuration:
The software has to be informed about the hardware configuration. Click on , double click the object “PLC Configuration”. If the AC500 compact folder in the PLC
configuration tree is closed, click on the symbol.
The I/O devices connected directly to the I/O bus of the CPU will be entered: click on “I/O-Bus [FIX]” and press the right mouse button to add the expansion module, in this example we choose DX561, AI561 and AI562.
Save the project with menu item “file/save as”. Enter Tank as Project name and complete your input with “Save”.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 40 -
3. Symbolic comments for I/Os Click once on digital output 0 for onboard I/Os, by “Base parameters” window enter “waterLevel,ALARM” for the comment. Complete your input by pressing the <Enter> key.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 41 -
Use the same procedure for other onboard outputs.
Click once on analog input 0 of AI561, by “Base parameters” window enter “Fluid position gathering” for the comment.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 42 -
Click on the “channel parameters” tab which next to the tab “Base parameters”, change the value “0...10V” instead of “not used”. Complete your input by pressing the <Enter> key.
Use the same procedure to configure the analog input of AI562. Only use “Temperature gathering” for the comment and choose “2 wire NI1000 -50…+150deg” for the value.
5. Opening the ST (Structured Text) editor
From the resources we now want to switch to the structured editor, click on the tab and then double click on the entry PLC_PRG (PRG). The structured text editor is opened. 6. Organization the program
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 43 -
We want to divide our program into 3 parts. Part 1: Fluid_Position_Control; part 2: temp_Control and part 3: output_Control. To do this, position the mouse cursor to the POUs Folder, right click on the mouse and select “Add object”.
In the appearing window enter “Fluid_Position_Control” for the name of the first part of the program.
Use the same procedure for part 2 and part 3. Then we have the structure of the whole program.
7. Programming
Click once on tab, in the right window you can enter the program for first part of our example. Use “(* *)” for all your information, program comments.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 44 -
Use the same way to create the next 2 parts of this program.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 45 -
Now we have four programs, but only the PLC_PRG (PRG) is the main program, others are the user defined program. These three programs will be called by the main program, so we can put them into a folder. To do this, mouse right clicks on the Folder “POUs” and chooses “New Folder”.
Right mouse click on the “New Folder” and choose “Rename Object…”. Rename this Folder as “Real_Control”.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 46 -
then
Push three user defined programs in the Real_Control folder. Now we see a main program (PLC_PRG) and three user defined program under Real_Control folder.
In order to program the main program, double click on the PLC_PRG (PRG). In the programming window, mouse right click and choose “Input assistant”.
In the appearing window choose “User defined Programs/Fluid_Position_Control (PRG)” and confirm with “OK”.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 47 -
And choose the other program sequential. After that we finish our main program.
The programming of the project is now completed. 8. Compiling the project. In order to build the project, select the menu item “Project/Build”.
If no errors were detected, the message “0 errors, 0 warnings” is displayed in the message box.
____________________________________________________________________________________________________
Getting Started with AC500-eCo Starter-Kit - 48 -
9. Connect the CPU and the S500 module.
• Connect the PM554 to 24 V DC;
• Connect the PM554 onboard inputs and outputs with the power supply;
• Connect to the COM1of the PM554 to the COM1 interface of the PC with TK503 programming cable;
• Connect the DX561 (I/Os, with CPU, with power supply);
• Connect the AI561 (Input, with DX561, with power supply);
• Connect the AI562 (Input, with AI561, with power supply). Further wiring information of the CPU and the I/O modules please refer to the system data of the AC500 PLC.
CAUTION Failure to heed precaution can result in injury to people or product to property.
8. Downloading the program to the PLC After us wiring the hardware, we can now download the program to the PLC. First we have to load the program to the controller. To do this, select the menu item “Online/Login”.
When no more Errors and Warning message appear, select the menu item “Online/RUN”.
Now you can check your program with the PLC.