Download - Automatic Generation Tools
![Page 1: Automatic Generation Tools](https://reader035.vdocuments.us/reader035/viewer/2022062222/56816301550346895dd3771f/html5/thumbnails/1.jpg)
Ivan Prieto Barreiro - EN-ICE 1
Automatic Generation Tools
UNICOS Application Builder Overview
11/02/2014
![Page 2: Automatic Generation Tools](https://reader035.vdocuments.us/reader035/viewer/2022062222/56816301550346895dd3771f/html5/thumbnails/2.jpg)
EN-ICE 2
UAB: UNICOS Application Builder• Software factory used to develop UNICOS applications.
• Main features:• Provide a unified and highly customizable code generation
environment for PLC, SCADA and other UNICOS target platforms.
• Keep the internal UNICOS types and engineering/process knowledge separated from UAB to maximize reusability.
• Enforce input consistency and validity through automatic checking of syntax and grammar.
• Flexibility: Easy to adapt the framework for new UNICOS packages.
• Scalability: Modular architecture based on plug-ins.
11/02/2014
![Page 3: Automatic Generation Tools](https://reader035.vdocuments.us/reader035/viewer/2022062222/56816301550346895dd3771f/html5/thumbnails/3.jpg)
EN-ICE 3
UAB Modular ArchitectureUAB Core
• Common utilities required by most of the plug-ins (user report, logging, …).• Dynamically discovering the different plug-ins.• Load the UNICOS project data.• Connect plug-ins with external files (specs, device type definitions, …).
UAB Plug-ins• Platform dependent (Siemens, Schneider, WinCC O. A., …).• The plug-ins define the structure and format of the generated files (XML, SCL, …).
UAB Resources• Set of resources required by the plug-ins.
(Device Type Definitions, Jython Templates…).
UAB Components• Logical integration of UAB plug-ins.• Friendly user interface (Wizard).• Detected by installation and update
tool (UAB Bootstrap).
11/02/2014
![Page 4: Automatic Generation Tools](https://reader035.vdocuments.us/reader035/viewer/2022062222/56816301550346895dd3771f/html5/thumbnails/4.jpg)
EN-ICE 4
P
anel
: Win
CC
Fle
x
P
LC
: S7
S
CA
DA
: Win
CC
O
A
UAB Core
CPC Wizard
Inputs
Specifications
Device Instantiation Templates
Process LogicTemplates
Baselines
SCADATouch Panel
PLC
Device Types
AnalogAlarm
PID
Control System Developer
Outputs
ControlApplication
PLC S7
Application Generation Workflow
Resources Component Plug-ins
Core
11/02/2014
![Page 5: Automatic Generation Tools](https://reader035.vdocuments.us/reader035/viewer/2022062222/56816301550346895dd3771f/html5/thumbnails/5.jpg)
5
CPC Wizard Screenshots
11/02/2014 EN-ICE
![Page 6: Automatic Generation Tools](https://reader035.vdocuments.us/reader035/viewer/2022062222/56816301550346895dd3771f/html5/thumbnails/6.jpg)
EN-ICE 6
UCPC Plug-insThe UNICOS CPC component includes the following plug-ins:
• Siemens PLC• S7 Instance Generator• S7 Logic Generator
• Schneider PLC• Unity Instance Generator• Unity Logic Generator
• CoDeSys (Twincat, SoMachine)• CoDeSys Instance Generator• CoDeSys Logic Generator
• SCADA• WinCC OA Generator• Touch Panel Generator (Magelis, TIA Portal, WinCC Flexible)
• General Purpose• Expert User Generator
11/02/2014
![Page 7: Automatic Generation Tools](https://reader035.vdocuments.us/reader035/viewer/2022062222/56816301550346895dd3771f/html5/thumbnails/7.jpg)
EN-ICE 7
S
CA
DA
: EPI
CS
P
LC
: S7
P
anel
: Win
CC
Fle
x
S
CA
DA
: Win
CC
O
A UAB Core
CPC Wizard
Inputs
Specifications
Device Instantiation Templates
Process LogicTemplates
Baselines
SCADATouch Panel
PLC
Device Types
AnalogAlarm
PID
Outputs
ControlApplication
PLC S7
Use Case: New Target Platform
Resources Component Plug-ins
Core
11/02/2014
1. New target platform: EPICS2. New plug-in: EPICS 3. New Wizard panel for EPICS4. New Jython Templates for EPICS5. New Baseline for EPICS
![Page 8: Automatic Generation Tools](https://reader035.vdocuments.us/reader035/viewer/2022062222/56816301550346895dd3771f/html5/thumbnails/8.jpg)
EN-ICE 8
Plug-in & Templates Execution Flow
11/02/2014
Execute template
UAB CoreUtilities
Return
Method call
Method return
Continueplug-in execution
Method call
Method return
When the generate button is pressed, the wizard will call the plug-in associated with the panel to perform the generation.
Callplug-in
![Page 9: Automatic Generation Tools](https://reader035.vdocuments.us/reader035/viewer/2022062222/56816301550346895dd3771f/html5/thumbnails/9.jpg)
EN-ICE 9
UAB Plug-ins
11/02/2014
Features• Platform dependent (Siemens, Schneider, WinCC O. A., …).• The plug-ins define the structure and format of the generated files (XML, SCL, …).
Generation Workflow1. Get the required parameters and data sources (specs file, templates location,
output folder and output file(s) location).2. Process the selected templates (global templates, device type templates, post-
process templates).3. Write the output files with the data provided by the templates.
Reusability• In some cases it is possible to reuse the same plug-in for different target
platforms (when the plug-in functionalities are equal or very similar).• Example: The CPC Touch Panel generator is used for several targets: Magelis, TIA
Portal and WinCCFlexible.
![Page 10: Automatic Generation Tools](https://reader035.vdocuments.us/reader035/viewer/2022062222/56816301550346895dd3771f/html5/thumbnails/10.jpg)
EN-ICE 10
Device Type Definitions
11/02/2014
FEDeviceOutputs: Device output InterfaceisCommunicated: Front-end <> SCADA comm.
isSpecificationAttribute: Spec fields
![Page 11: Automatic Generation Tools](https://reader035.vdocuments.us/reader035/viewer/2022062222/56816301550346895dd3771f/html5/thumbnails/11.jpg)
EN-ICE 11
Jython TemplatesFeatures
• The templates are specialized scripts used to generate code for the target platform.
• The templates are located in the Resources Package (separated from the plug-ins).
Different Nature• Device Type Templates: Generate code related to an specific
device type. One template for each existing device type.• Global Templates: Used to generate code not related to the
device types (like front-end configuration).• Semantic Rules: Used to validate the user inputs. These
templates are shared by all the plug-ins.
11/02/2014
![Page 12: Automatic Generation Tools](https://reader035.vdocuments.us/reader035/viewer/2022062222/56816301550346895dd3771f/html5/thumbnails/12.jpg)
EN-ICE 12
Device Type Templates
11/02/2014
• Generate code related to an specific device type. One template for each device type.
Worksheet reference
Getting data from the specs
Getting device addresses
Writing device importation line
![Page 13: Automatic Generation Tools](https://reader035.vdocuments.us/reader035/viewer/2022062222/56816301550346895dd3771f/html5/thumbnails/13.jpg)
EN-ICE 13
Device Type Templates
11/02/2014
• Development for EPICS target platform:• Try to reuse the existing plug-ins and device type templates (WinCC OA).• Create a new CPC application using the CPC Wizard and resources package (v1.6.0)• Modify the WinCCOA device type templates in the application folder to generate the
required output for EPICS.• If the generated file is plain-text (comma separated or similar) Modification is straightforward.• If the generated file is xml Use a different API to create the files (IOutputFileBuffers @see
Javadoc for UAB Core v1.5.2)
Recommendation
![Page 14: Automatic Generation Tools](https://reader035.vdocuments.us/reader035/viewer/2022062222/56816301550346895dd3771f/html5/thumbnails/14.jpg)
EN-ICE 1411/02/2014
Questions?