ABB-800XA创建用户自定义功能块面板
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Exercise6.3Creating a Faceplate for the User_defined Function Block(Optional)
6.3.1Description
We are going create a solution with a block,called myTank_FB,.It will have the
following characteristics.
∙A variable called TankLevel,which represents the level in the Tank
∙A variable FlowSpeed,which sets the speed of filling
∙A variable called OnOff which starts/stops the filling of the Tank
∙A parameter MaxAlarm which sets the level for a HH Alarm
∙A parameter MinAlarm which sets the level for a LL Alarm
We would like to have the following aspects connected to the myTank_FB
∙Graphical Element showing the Tank,the name,the alarm limits and the Level
∙A Faceplate for control of the Tank
∙Trend Display showing the Level
∙A history log logging the Level
∙An Alarm and Event list showing the Tank Alarms
6.3.2Solution Steps
Process Portal A and Control Builder is an an integrated DCS System.This means that
you only need to engineering they system once.All objects that you create in the
Control Builder will automatically appear in Process Portal and vice versa.
6.3.2.1Start Plant Explorer
Start Plant Explorer and open navigate to the Control Stucture
Open the Project in the Control Structure
It may take a minute or two to open the Project.
6.3.2.2Create a new of Program
Create a new Program and call it Exercise and assign a Task to the it.Process Portal
gets confused if you have several applications with the same name.Be sure to select a
unique name for your application.
Attach it to a Task in the Controller
6.3.2.3Creation of your Library
The next step is to create a library,so we can re-use the solution we create today in
several projects.
Create a Library called YourName DemoLib,for example demoLib.
6.3.2.4Creation of myTank_FB
In the library we should create a function block type called myTank_FB.
Control Builder is part of the Industrial IT,which leads to that what you create in the
Control Builder is also created in the Plant Explorer.
Create the functionality of the Tank Block as described below.We will later increase
the functionality.
Note that you need to be in the Control Builder to makes the changes in the code.
Either you switch to the Control Builder using the Tabs or you can right mouse click
on you Function Block in Plant Explorer and select Function Block Editor.
Code and Parameters
Variables
6.3.2.5Creation of Graphic Element on myTank_FB
The next step is to create a Graphic Element on the myTank_FB type in Process Portal.
We want to create a Graphic Element that shows the value of Level in a Numeric
Display and in a Bar Graph and show the name of the function block.
Locate the myTank_FB in the Object Type Structure and select New Aspect.
Create a new Graphic Element PG2and call it Graphic Element.Edit the element.
Create the static part as follows
I used the following elements
1.For the tank top,bottom and body
2.For the Name
3.For the Bar Graph
4.For the Numeric Level
It is time to connect the elements to the process.What we are going to use it the Expression Builder.By doing this is in Object Type Structure we assign the variables relatively to the Tank Object Type.This means that the assignments will work for any tank that we create,i.e.we do not need to assign the Name and the Level to each Tank. It is done automatically.
Select the Numeric and jump to the properties window.Set the parameter No1~5as
well as the blow graphic.Adjust the No.6parameter to a proper value.
For the No.7parameter,jump to the Expression Editor from selecting radio buttons within the Properties Window to add dynamic value:TankLevel.
Continue to add the Level to the input of the BarGraph.
Connect the TextElement’s Text property to the Name of the Function Block.
Save the graphic and test the behavior.Testing,while in the Graphic Editor,can be done by“View>Test Data”.
Take a look in the Object Type Structure on the graphic element.
6.3.2.6Creation of the your first program
Lets create a small application consisting of two instances of the myTank_FB and test
the functionality.We will use the Function Block Editor to write our application in
Program2
Connect Libraries
The first step we need to do is to Connect the myUserLib to our Application.Go the
Control Structure and select your application.Press Connect Libraries
Select myUserLib and press OK
6.3.2.7Create the Program
Go to Excise_No2and declare a Function Block called myTank1and assign FS1
(Flow Speed1)to the input and set it to5.Repeat the procedure for another Tank
called myTank2and use the input FS2(Flow Speed2)and set it to10.
The solution is below
Variables and Code
Function Blocks
As soon as you press Apply in the Editor Window you will get the Function Blocks in the Control Structure of Process Portal.This is what we call Integrated Engineering.
Take a look in the Control Structure and you will see both Tanks.
We would like to see if our programs works.Go to Simulate mode and test your program.
Below is the Excise_No2in simulation mode
You can see the value of the parameters,but if you want to see the variables,for example the level you need to go down one level.You can do that my right mouse clicking on the function block and select“Online Editor”
By doing that you get a view of the code inside the Function Block.
In this mode you will see all variables inside the function block.
Go download and go on-line
Now when you know your element is working,it is time to download and go-online.
Remember to set you System Identity for you SoftController to your IP address
(127.0.0.1:2for the SoftController)
6.3.2.8Check that you have live data
You can check that you have live data by looking at the Function Block aspects in the
Control Structure.
Locate the Exercise,Program1,select the Function Block and the tab Property View
and select“Subscribe for live data”
If you get values in the table you know that you have live data.
If you do not get live data,make sure that you have started the OPC Server and that
you have selected your PC as the provider.
6.3.2.9Creation of the faceplate for myTank_FB
Now we want to create a faceplate,to control our Level in the myTank_FB.
First of all we need to add the code that makes is possible to stop the TankLevel in the
Tank.
Go back to the Control Builder and edit the myTank_FB by adding an OnOff variable
and use it as below.
Create the Faceplate
The Faceplate is the main aspect for the faceplate.Locate the myTank_FB in the
Object Type Structure and create a Faceplate PG2aspect named Faceplate.
Take a look at the faceplate.At this moment it is just empty.We would like to fill it with some information and some actions buttons.
The first step is to select the Config view and create two buttons On and Off to set the value of the running variable.Switch to Config View and select the Buttons tab.
Click Icon/Labels to specify what icon or text you want to have on the button.
The next step is to select what property we want to set.This button should set the OnOff.
The third step is to set what property value we should write to the controller when we push the button.We would like to write True to the OnOff when we push the Open Button.
You can also supply a tool tip.The last thing you need to do is to select in what positions the button should appear.The positions are numbered from left to right. Repeat the procedure for the Close Buttons.Call it C.The last thing you need to do is to set the position of the Button in the Faceplate.
Go back to the Faceplate View and take a look at your Faceplate.
Go back to the Control Structure and select the Overview Graphics on Excise_No2. Right mouse click on Tank1and select the Faceplate.Try to Open and Close the Tank.
Tank2has the same functionality since we built the Faceplate on the Type.
It would be nice if an operator could open the Faceplate by just clicking on the Object. It is quite easy to configure that behavior.Go back to the Object Type Structure and select the Faceplate Aspect.Right mouse click and select Properties.
Select Default Aspect in the Aspect Details Tab.
Go back to the Overview Graphics and click on the Tank to bring up the faceplate. Creation of a Faceplate Element
We want to have a faceplate element in the middle of the faceplate that show a bar
graph with the level.We also want to be able to set the level manually.
In order to do that,we need to create a faceplate element on the myTank_FB.A
Faceplate Element is an element that can accept input to the controller.
Edit the faceplate element.We want to be able to click and set the level and turn the Level on and off.
We are going to use the ToggleButton and the Bar
Tie the Level to the Bar value in the Properties Window.
Attach the Toggle button to the OnOff signal
Save the Faceplate Element
You need to out this faceplate element in to the faceplate.Go to the Object Type Structure and select Config View on the Faceplate and select to include the Faceplate Element in the Elements tab.
Click Apply
Open your Overview Graphics and select the Faceplate.It shall now have a nice Faceplate Element in the Faceplate.You can set the level and toggle On Off with the
Toggle Button.
Add an indicator
We would like to have an Indicator showing the status of the running variable.
Select the ConfigView on the Faceplate in the ObjectType structure.
Click in the Icons/Labels Window and supply the what shall be shown as the indicator
We need to decide when what icon should be shown.Click in the Expression Window to supply an Expression
Iif($'.:OnOff',0,1)
This expression means:Show label number0if OnOff is TRUE otherwise show label number1.
Select the position to show the Indicator
Open your Overview Graphics and select the Faceplate.It shall now have a nice Faceplate Element in the Faceplate.You can set the level and toggle On Off with the Toggle Button.
6.3.2.10Creation of an Overview Display
We would like to have an Overview Displays that holds both of our Tanks.Go to the
Function Structure and create a new Graphic Display PG2.
Right mouse click to Edit.
We would,of course,like to re-use instead of creating a new Tank Element.
A graphic element may be used in any graphic display.To add an element to the
display,select the Element Browser icon from the toolbar:
All of the dynamic linking to the process data is already done.This is the power of
using graphic elements.Therefore we are going to use the Element Explorer to select
the Graphic Elements on our Tanks.
Select myTank1and Mytank2in the Control Structure,all reusable graphic elements
are listed.This time myTank1own a graphic element named graphic element only.
Select and add the graphic element in the display by several methods: -select the element and click on the edit panel
-double-click the selected graphic element
-drag and drop the element on to the edit panel
-select the graphic element and press“Enter”.
Arrange them and insert a text as a Headline.
There are two modes which can be selected in the Graphics Builder:
•Edit Mode
This is the default mode and allows the user to build the graphic aspect without any interactive connection to dynamic data.
•Live Mode
This allows the user to view the behavior of graphic aspects with dynamic values.
Please use Live mode to see result below.
As you see you can have live data in the Graphics Builder.
Save the Graphics.
If you do not see the live data please make sure you have selected the Live Data option 6.3.2.11Add a Trend Display for myTank_FB
We would like to have a run-time trend showing the Level of the Tank.Go to the
Object Type Structure and select the myTank_FB and create a Trend Display.
We create Trend Display on the type.In order to get a relative path,type in“.”(you
type in a dot and the dot will be replace by the type name)for the Object.Select the
Function Block as the Aspect and the TankLevel as the property.
Also set the high range to100.00
Save the trend.
Open your Overview Graphics and select the Trend Display.
Change the time range to a minute.
Configure history to log the TankLevels
We would like to historize the TankLevel.
Go to the Control Structure and create a Log Configuration Aspect on Tank1.
The Log Configuration Aspect lets you define what property to log and what template to use.The template defines how to log,e.g.how often and how large of a storage each tag has.
Click on the TankLevel to log it.
Select the Template you would like to use
Press OK and Apply.
Now you TankLevel for Tank1is being Historized.
Repeat the Procedure for Tank2and its TankLevel.
6.3.2.12Add an Aspect Link to the Trend on the Faceplate
We want to have an Aspect Link on the faceplate to the Trend Display.Go back to the
Object Type Structure and select Config View on the Faceplate and the Indicators Tab.
Select the View you want the button to open.
Select to use the Aspect Icon as the Icon/Label
Select the position to be number6for all different sizes of the faceplate.
Open your Overview Graphics and select the Faceplate
6.3.2.13Adding Alarming to the myTank_FB
Configure the Alarm Handling for the myTank_FB
In order to get the Alarming functionality in the Controller you need to insert the
AlarmEventLib into the project
Connect the Alarm&EventLib to the Application.
Connect the Alarm&Event Lib to myUserLib.
We will add the alarming to our myTank_FB type,which means that all our instances will get the Alarm features.
Add two FunctioBlocks of the AlarmCond type,called HIHI and LOLO,to the myTank_FB.
We would like to be able to change the HIHILimit and the LOLOLimit from the user interface.In order to get the correct Name displayed in the Alarm and Event List,we need to add a Name parameter and assign in the program.
Declare variables and write the code as below
Parameters
Since we added some Parameters we needed to update the Control Logic.
Download the code to the Controller
Setup AC800M/C OPC Server to collect Alarms
If you have not configured the OPC Server to collect Alarms from your controller,
please follow the steps below.(You need to do this every time you re-start your
system or you need to configure the OPC Server to Auto Load the configuration)
Open the OPC Panel from the Start Menu
Type in the IP-address of your controller and press Connect
Your OPC Server is now connected to your Controller
Connect Process Portal to the OPC Server
If you have not connected the OPC Server to Process Portal A,please follow the steps
below.You only need to do this once
Open Plant Explorer and the Service Structure and locate Event collector and new a
service group object named AC800M OPC AE Collector.
Add a service Provide object named AC800M OPC AE Provider in this group.
.
Click Add and select the OPC AE Server for AC800M.Click Apply in the Service
Group Definition Aspect.
You have now setup the Alarm Collection in Process Portal
Check the Alarming
Open your Overview Graphics and select the Alarm List for Tank1.Note:The Alarm
List was created automatically on the myTank_FB and it is configured to show alarms
only for the selected object.
You can also check the Alarms for Tank2by right mouse clicking on the Tank2and
selecting the Alarm&Event List.
Create an Alarm&Event List for an Area
We would like to have an Alarm List for that shows all alarms from Tank1and Tank2.
Go to Excise_No2and create an Alarm&Event list
This Alarm&Event List should show the Alarms coming from Excise_No2and
below,i.e.myTank1and myTank2.
Select the Config View on the Alarm&Event List and select“Objects and Decedents”.
Press Apply.
Open your Overview Graphics and select the Alarm List for Excise_No2by selecting
it from the Context Menu for Excise_No2.
Adding the Object Description
We would like to get the Object Description from the object in the Controller to be
presented in the Alarm&Event List.
To do that we need to add a parameter,called Description,on the Function Block.Go
to the Control Builder and the parameter.
Of course we also need to add Description variables to our instances in the Control
Logic as in blow screen dump
Download to the controller.
Now the Control Logic is prepared,but we need to do one more thing in Process Portal to get the Description available.Every time you change a Description in the controller you need to locate the Name Uploader Aspect in the Control Structure. Locate it and press upload.By doing this the descriptions on the Function Blocks in
the Controller will be transferred to Process Portal
You can bring up the Alarm&Event List,when the synchronization is done,and you
should see the object description.
Include Alarm Limits in Faceplate
We would like to see the Alarm Limits in the Faceplate.
Go to the Object Type Structure and select the faceplate element of myTank_FB.
Select Edit.。