Library Creation Exercise Guide

Library Creation Exercise Guide
Preparation
1.
2.
3.
4.
Open PPT
Open CODESYS 2 instances of CODESYS (a library is general and not project specific if
open in its own instance. If a library is created in the project it’s not available for the
complete project but only for that device. Also it limits the possibility to have more people
working in parallel.)
Check in CODESYS that the online help for XML Utility available is for both English and
German version of CODESYS. Inform that XML Utility package is pre-installed
Use SP6 due to future features
Process
1.
2.
3.
4.
5.
6.
Start CODESYS
New Project  Libraries  CODESYS Library
Under POU  Project Information  (Template already filled out but need a few
adjustments)
a. Change Title: Kuehlschrankprojekt
b. Change Library Category  Add  From description file  C:\Program Files
(x86)\3S CODESYS\CODESYS\Templates\Library_Template ( I chose
Application because it will then land early in the list when looking for it, these
options are delivered with CODESYS and if you open the xml file you see more
details to what is available and how to add it.)
c. Under Properties/ Place Holder  Change Value to something like KLT or
PMAT
d. Add another value: Key: DocFormat and Value: reStructuredText (standard
format for documentation in source code. Not CODESYS specific. New feature
since V3.5 SP 5 )
In Development Tree/Libname/Function Blocks: Add Object  POU
Name it MyPOU
Add following data
7.
Press
3S-Smart Software Solutions GmbH  Memminger Straße 151  87439 Kempten  Germany
Tel: +49-831-54031-0  Fax: +49-831-54031-50  [email protected]  www.codesys.com
China Branch Office − CODESYS Software System (Beijing) Co.,Ltd.  100025 BEIJING P.R.C.  China
Library Creation exercise guide v2.docx: Version 1.0
2/5
CODESYS Inspiring Automation Solutions
8.
9.
Datenblatt Library Creation Exercise Guide
Start CODESYS with the Kühlschrankprojekt
Click Library Manager  Add Library  Click Display Advanced Libraries
10. Find your created library and press OK
11. Show inside the Library Folder/FunctionBlock the created documentation
3S-Smart Software Solutions GmbH  Memminger Straße 151  87439 Kempten  Germany
Tel: +49-831-54031-0  Fax: +49-831-54031-50  [email protected]  www.codesys.com
China Branch Office − CODESYS Software System (Beijing) Co.,Ltd.  100025 BEIJING P.R.C.  China
Library Creation exercise guide v2.docx: Version 1.0
3/5
CODESYS Inspiring Automation Solutions
Datenblatt Library Creation Exercise Guide
Next Exercise
Add Table
2.
3.
In Development Tree/Libname/Function Blocks: Add Object  POU, Set as Function with
Return value: INT
Name it POUTable
Add following data
4.
5.
6.
Open your project file
Go to Library Manager  Libname  Function Blocks  POUTable
In the right hand window check the tab: Documentation: Voila! All documentation is there
1.
Add Picture
7.
In Development Tree/Webinarlibrary basic
a. Add Folder and name it: Image (Why not use the Object Bildersammlung?
-Very complex answer…Because it’s not yet added to the extract process…)
b. Right click and Add External file  browse for the right image file  don’t forget
to click the “Embed into project” , double check the exact file name in Name:
and press Add
c. Under Libname/Function Blocks  Add object: POU
i. Name it POUPicture
ii. Add following data:
3S-Smart Software Solutions GmbH  Memminger Straße 151  87439 Kempten  Germany
Tel: +49-831-54031-0  Fax: +49-831-54031-50  [email protected]  www.codesys.com
China Branch Office − CODESYS Software System (Beijing) Co.,Ltd.  100025 BEIJING P.R.C.  China
Library Creation exercise guide v2.docx: Version 1.0
4/5
CODESYS Inspiring Automation Solutions
Datenblatt Library Creation Exercise Guide
Count the folder levels and add / for each level.
Width must be directly under image
8.
9.
10.
11.
Open your project file
Go to Library Manager  Libname  Function Blocks  POUPicture
In the right hand window check the tab: Documentation: Voila! See documentation is there
In the future you can use: @FILE(image name)
1.
2.
Show that the XMLpackage is installed
Open Kühlschrankproject and type XMLGetElemnt (feature: you search for a part of the
library and CODESYS gives you the right library file).
3.
Add Library file:
a. Go to Library Manager
b. Add Library
Online Help Creation
3S-Smart Software Solutions GmbH  Memminger Straße 151  87439 Kempten  Germany
Tel: +49-831-54031-0  Fax: +49-831-54031-50  [email protected]  www.codesys.com
China Branch Office − CODESYS Software System (Beijing) Co.,Ltd.  100025 BEIJING P.R.C.  China
Library Creation exercise guide v2.docx: Version 1.0
5/5
CODESYS Inspiring Automation Solutions
4.
5.
6.
Datenblatt Library Creation Exercise Guide
c. Search XMLgetElement
Show that the library file contains a lot of documentation such as:
a. Library description including pictures
b. FBs etc…
Add a new PLC_PRG (Program or FB) and create a function that you want to show in F1
Do the following:
VAR
XMLElementGetter: Press F2  Structured Types  XML  Select XMLGetElement;
7. Put curser onto the XMLGetElement and Press F1
8. Show the automatic F1Help contains this data.
This is what we want to achieve with the documentation that it also lands into the online help.
3S-Smart Software Solutions GmbH  Memminger Straße 151  87439 Kempten  Germany
Tel: +49-831-54031-0  Fax: +49-831-54031-50  [email protected]  www.codesys.com
China Branch Office − CODESYS Software System (Beijing) Co.,Ltd.  100025 BEIJING P.R.C.  China
Library Creation exercise guide v2.docx: Version 1.0
CODESYS Inspiring Automation Solutions
3S-Smart Software Solutions GmbH  Memminger Straße 151  87439 Kempten  Germany
Tel: +49-831-54031-0  Fax: +49-831-54031-50  [email protected]  www.codesys.com
China Branch Office − CODESYS Software System (Beijing) Co.,Ltd.  100025 BEIJING P.R.C.  China
Datenblatt Library Creation Exercise Guide
Library Creation exercise guide v2.docx: Version 1.0