Upload
vuxuyen
View
224
Download
3
Embed Size (px)
Citation preview
© ABB Group – Version 3.1 (2012-04)
Technical Guides
Scalable PLC AC500
Control Builder PS501 Libraries Basic module
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 2
Library manager
3S CoDeSys libraries
AC500 libraries
User libraries
PS501 Libraries Contents
© ABB Group March 11, 2013 | Slide 2
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 3
Library manager
3S CoDeSys libraries
AC500 libraries
User libraries
PS501 Libraries Coming up
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 4
PS501 Libraries Library Manager (1)
Libraries contain POUs, data types and global variables
There are three different types of libraries:
The Library Manager shows all libraries linked to the current
project
For a new project standard CoDeSys libraries and appropriate
AC500 libraries according to the PLC configuration (AC500
hardware) are linked
Additional libraries can be inserted
Libraries provided by CoDeSys
Target system libraries (AC500 libraries)
User libraries
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 5
PS501 Libraries Library Manager (2)
or “Window”\”Library
Manager”
Click on “Resources“\”Library
Manager”
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 6
PS501 Libraries Library Manager (3)
Parameter details of
the selected POU
Graphic of selected POU
Available POUs inside the
selected library
Libraries of the current
project
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 7
Library manager
3S CoDeSys libraries
AC500 libraries
User libraries
PS501 Libraries Coming up
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 8
PS501 Libraries Standard 3S CoDeSys libraries (1)
The CoDeSys libraries
standard.lib and util.lib are
always available as soon as
a new project is created
They contain all function
blocks required by the
IEC 61131-3
The library path: C:\Program Files\3S Software\CoDeSys V2.3\Library
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 9
PS501 Libraries Standard 3S CoDeSys libraries (2)
Note:
The IEC standard functions like logic functions, comparison,
arithmetic functions, type conversion etc. are supported beyond
the libraries as operators automatically associated in “FBD
Operators”
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 10
Library manager
3S CoDeSys libraries
AC500 libraries
User libraries
PS501 Libraries Coming up
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 11
PS501 Libraries AC500 Libraries
For a new project appropriate
AC500 libraries are linked
according to the configuration
of the project selected in “PLC
Configuration”
The link is performed by
selecting menu item “Build
F11”
The library path:
C:\Program Files\Common Files\CAA-Targets\ABB_AC500\Library
or
…\ABB_AC500\AC500_V12\Library
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 12
Library manager
3S CoDeSys libraries
AC500 libraries
User libraries
PS501 Libraries Coming up
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 13
1. Create own user POUs
2. Export the user POUs
3. Create a new project
4. Import all user POUs
5. Store the project as a
user library
Create your own library:
PS501 Libraries User Library
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 14
PS501 Libraries Create User POU MaxMin
Right click on “POU”\
“Add Object”
Programming language
Name
POU type
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 15
Example:
A function block named
“MaxMin”, which
calculates the maximal
and the minimal value of
four integer values is to be
created
PS501 Libraries Programming the User POU
MaxMin
Value2
Value1 Maximum
Minimum Value3
Value4
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 16
PS501 Libraries Test the POU (1)
1.”Network”\
“Box”\
“F2”
2. Click on “User
defined Function
Blocks”
3. Click on
“MaxMin(FB)”
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 17
PS501 Libraries Test the POU (2)
Test the function
block instance with
four integer inputs
and two integer
outputs
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 18
PS501 Libraries Export the User POU
www.infoPLC.net
PS501 Libraries Procedure of Creating the Library
The Project is created by use of PS501
Next steps
PS501 version older
than V 2.x?
yes no
Next steps
Start Start
www.infoPLC.net
PS501 Libraries Create a New Project
1. Exit the current project.
2. Create a new project.
There is no need to create a
configuration.
3. Open the CoDeSys project.
4. Delete in the CoDeSys project
the POU PLC_PRG.
5. Delete the subdirectories of
Global Variables when no
global variables are used
for library.
www.infoPLC.net
PS501 Libraries Import the POUs
1. Import all POUs you have exported
and wish to be contained in this
library.
2. Compile the project.
Ignore the error
message about the
missing PLC_PRG.
www.infoPLC.net
PS501 Libraries Save the User Library (1)
2. Switch to Configuration Tool. Right-click on the
project branch and select “Save V2.3 project as
library…“.
1. Save the CoDeSys project by use of item “File/Save“.
www.infoPLC.net
PS501 Libraries Save the User Library (2)
1. Select:
the destination path on the hard disk
the library‘s name
the library type „Internal library“.
2. Save and close the project.
It is your source file you can use for modification
in the library.
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 24
PS501 Libraries Insert a User Library in a Project
“Insert” \
“Additional Library…”
Skip the procedure for PS501-Version 1.x
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 25
PS501 Libraries Create a new Project
Create a new project in
CoDeSys and delete
PLC_PRG POU
Delete also the global
variable list in this project
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 26
PS501 Libraries Import all User POUs
1. Import all user POUs to be
contained into a common
library.
2. Rebuild all. Igore the error
message about the missing
PLC_PRG.
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 27
PS501 Libraries Save User Library
Store this project as an “Internal Library”
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 28
PS501 Libraries Insert a User Library in a Project
“Insert” \
“Additional Library…”
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 29
1. Create the POUs, “Rebuild all”, “Login” and test their function as usual
2. Export the POUs
3. Open a new project, import all POUs you want to load into the new library and
„Rebuild all“
4. Store this project under a new name (name of the library) in a directory
Delete PLC_PRG and the global variable list
“File”
“save as” in the folder you
want the library to be stored.
Select “Internal library“ and
enter a <name> for the library
“Project”
“Export”
mark the POUs <POUs- name> .exp Result
<POUs- name> in Object Organizer Result
“Project”
1: “Import”
2: “Rebuild all”
PS501 Libraries User Libraries - Summary
A new library is created under
< name>. Lib Result
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 30
PS501 Libraries Cross-References to Documentation
1. CoDeSys Help\Target System\AC500 / S500\
Function Block Libraries AC500\
2. CoDeSys Help\CoDeSys Libraries\
www.infoPLC.net
© ABB Group March 11, 2013 | Slide 31
www.infoPLC.net