You are currently reviewing an older revision of this page.
Brandon Moberg
Application Name
Version
OpenPlant PowerPID V8i SELECTseries 5
08.11.10.202 and higher
Process & Instrumentation V8i SELECTseries 4
08.11.09.140 and higher
File Name
OpenPlant_PID
OpenPlant_PID_Supplemental_Imperial
PlantProjectSchema
PlantProjectSchema.01.04.Autoplant_PIW.01.04.mapping
NONE
OpenPlant PowerPID
Bentley Class Editor V8i
Project Administrator
DataManager
Text Editor
This document defines the process of implementing a secondary instrument database table in a PowerPID environment. The situation is that additional fields are required in the instrument table to store information needed for control valves. There is a 255 field limit within any one database table in the plant project database and the addition of new fields will exceed this limit. This “How To” will guide you through the process of creating the additional instrument table and building the mapping in the PowerPID schemas.
This process will require the following skill set.
Below are two processes to add the new table – one in an Access based project and the second in a SQL Server based project. For the SQL Server based project you will find a script that will create the table in a SQL Server project. This is provided to simplify the process.
ACCESS BASED PROJECT
NOTE – KEYTAG field must be set as the Primary Key field and
PROJ_ID field is only required for a Multi-Project mode project.
INSTR_EXT1 TABLE
Column Name
Data Type
Length
Allow Nulls
Is Primary Key
KEYTAG
Text
10
NO
YES
DESIGN_CODE
25
BODY_STYLE
20
ACTUATOR_STYLE
15
POSITIONER_REQUIRED
5
KEYTAG_GUID_PK
AutoIncrement
TSTRIP_ID_GUID_FK
LOOP_ID_GUID_FK
PANEL_ID_GUID_FK
PLANT_KEY_GUID_FK
SEGMENT_ID_GUID_FK
DS_ID_GUID_FK
PROJ_ID
4
SQL SERVER BASED PROJECT
USE [xxxxx]
GO
/****** Object: Table [dbo].[INSTR_EXT1] ******/
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
CREATE TABLE [dbo].[INSTR_EXT1](
[KEYTAG] [varchar](10) NOT NULL,
[DESIGN_CODE] [varchar](25) NULL,
[BODY_STYLE] [varchar](20) NULL,
[ACUATOR_STYLE] [varchar](15) NULL,
[POSITIONER_REQUIRED] [varchar](5) NULL,
[KEYTAG_GUID_PK] [uniqueidentifier] NULL,
[TSTRIP_ID_GUID_FK] [uniqueidentifier] NULL,
[LOOP_ID_GUID_FK] [uniqueidentifier] NULL,
[PANEL_ID_GUID_FK] [uniqueidentifier] NULL,
[PLANT_KEY_GUID_FK] [uniqueidentifier] NULL,
[SEGMENT_ID_GUID_FK] [uniqueidentifier] NULL,
[DS_ID_GUID_FK] [uniqueidentifier] NULL,
CONSTRAINT [INSTR_EXT1_PK] PRIMARY KEY CLUSTERED
(
[KEYTAG] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
Now that the new table is defined you need to assign it to the required tag types as a Supplemental Table. This is performed in the Project Administrator. This process applies to all database types.
Next you must add the newly created table to the project. This will make the table available for the Process Instrument View which will be modified later. This is performed in the Project Administrator. This process applies to all database types.
7. As a minimum check on DataManager [DMGR] and Project Administrator [PA]. Others can be selected as well based on the need for this table in those applications. Pick OK.
8. Pick OK in the Edit Table [INSTR_EXT1] dialog box.
9. Pick Close in the TablesinPROJDATA dialog.
10. Exit Project Administrator.
Edit the default Process Instrument List view to include the INSTR_EXT1 table fields
In order to be able to add new valves to the view in DataManager as well as be able to browse for tags in the database while in PowerPID you must modify the Process Instrument List view to include the new table. This is performed in DataManager and Access. This process applies to all database types.
11. Pick OK.
12. To add the INSTR_EXT1 fields to the view, scroll the list of field names in the INSTR_EXT1 table and double click the DESIGN_CODE, BODY_STYLE, ACTUATOR_STYLE and POSITIONER_REQUIRED fields. They will be added to the end of the field list below
13. Save the view. Exit Access.
14. Pick OK in the Design View – Process Instrument List dialog.
15. To test the view modification, locate the Process Instrument List view and double click it. It should load in DataManager.
SPECIAL NOTE: If mapping a class such as equipment where the base table (EQUIP) is NOT the tag registry this mapping is slightly different. You must map the TAG_REG table to the EQUIP_SUPPLEMENTAL table. DO NOT map the EQUIP_SUPPLEMENTAL to the EQUIP base table. So in the Join Properties dialog shown above the Left Table Name would be TAG_REG and the Right Table Name would be EQUIP_SUPPLEMENTAL table.
Now that the database table has been defined and the tag types adjusted to use it you need to modify the mapping in the schemas to include the new table. This process is completed using the Class Editor.
11. Move to the Select tab. You must now add the Join Table clause. Pick the Add… button and in the Edit Join Clause dialog set the Joined Table Name to INSTR_EXT1 and the Main Table Name to INSTR Set both column names to KEYTAG. See below.
12. Pick the OK button.
13. From the menu select DatabaseMapping > Save. Then select DatabaseMapping > Close.
14. Right click on the PlantProjectSchema in the tree and from the context menu select Close.
SPECIAL NOTE: When adding the supplemental table to an equipment class you MUST add the Supplemental table to the EQUIPMENT class AND the specific subclasses that will be writing the data to the supplemental equipment table. Just like property mappings, class table mappings are not inherited and MUST be added to all equipment classes that use them. For example, the PUMP class requires the new EQUIP_SUPP table. When you perform the edits above, you need to perform these on the EQUIPMENT class AND the PUMP class. Properties only have to be mapped at the class level that require them and not the upper level class.
On the Select Statement tab you would add the supplemental table and the join would be EQUIP_SUPPLEMENTAL.KEYTAG = TAG_REG.EKYTAG.
Now that the database table has been defined and the mapping between the Control Valve class and the new tables complete you will add properties to the Control Valve class into which you can add the additional data.
6. Save the schema.
Now that the properties are defined on the Control Valve class you need to map these properties to the INSTR_EXT1 table fields. This process is completed using the Class Editor and Database Mapping tools.
10. Pick OK.
11. Repeat this process for the three remaining new properties mapping them to their respective field in the new table.
12. From the menu pick DatabaseMapping > Save.
The last part of the process is to test the results. This will verify the changes made. Your test should include the following: