Export database

You can export the content of the P&ID database as neutral ASCII files.

Do the following:

  1. On the Tools tab, click Script and execute the export script ExportPdDb.bs from the /PMS_HOME/pd/macro directory.

  2. Select if you want to export only checked in data.

    It is better to check in the diagrams prior to exporting the database and export only checked-in data. Thus you avoid getting duplicate entries to you export file.

  3. Select if you want to have the name of the fields on the first row of the export file.

  4. Select the main tables you want to export.

  5. Select the sub-tables related to the main table/tables you want to export.

Two files per selected sub-table are created in the project directory ../<workspace>/<application area>.pd/ExportPdDb:

  • C_SUBTABLE.dat
  • C_SUBTABLE.dbs

The first character C means the name of the main table, as follows:

C

Main table

A

Armatures

E

Equipments

I

Instruments

The .dbs file

The. dbs file describes the data fields listed in the .dat file. For more information on the structure of database tables, see Structure of database tables (1) and Structure of database tables (2).

The following example shows an exported A_VALVES.dbs file.

Copy
/*
ARMATURES
col                 ;typ   ;isk;len;edi;vle;amx;qid         ;min  ;max  ;tag;
=============================================================================
*/
PosId               ;WSTRING;1  ;21 ;1  ;1  ;   ;            ;     ;     ;vpo;
RoleInProcess       ;WSTRING;   ;41 ;1  ;1  ;   ;            ;     ;     ;U20;
Status              ;SHORT ;1  ;   ;0  ;   ;   ;            ;-127 ;127  ;   ;
Revision            ;SHORT ;   ;   ;0  ;   ;   ;            ;-127 ;127  ;   ;
TypeTbl             ;WSTRING;   ;101;0  ;1  ;   ;            ;     ;     ;   ;
Pipeline            ;WSTRING;   ;101;0  ;1  ;   ;            ;     ;     ;   ;
Spec                ;WSTRING;   ;40 ;1  ;1  ;   ;            ;     ;     ;   ;
InsulationSpec      ;WSTRING;   ;40 ;1  ;1  ;   ;            ;     ;     ;   ;
MenuItmData         ;STRING;   ;40 ;1  ;1  ;   ;            ;     ;     ;   ;
Description         ;WSTRING;   ;79 ;1  ;1  ;   ;            ;     ;     ;   ;
DmPartCode          ;STRING;   ;37 ;1  ;1  ;   ;            ;     ;     ;   ;
Compartment         ;WSTRING;   ;40 ;2  ;1  ;   ;            ;     ;     ;   ;
EstimatedX          ;FLOAT ;   ;   ;2  ;   ;   ;3 [mm]      ;-100000;1e+07;   ;
EstimatedY          ;FLOAT ;   ;   ;2  ;   ;   ;3 [mm]      ;-100000;1e+07;   ;
EstimatedZ          ;FLOAT ;   ;   ;2  ;   ;   ;3 [mm]      ;-10000;100000;   ;
ObjectIsInModel     ;INT   ;   ;   ;0  ;   ;   ;            ;     ;     ;   ;
PdObjectId          ;STRING;   ;24 ;0  ;1  ;   ;            ;     ;     ;   ;
PosIdNull           ;INT   ;1  ;   ;0  ;   ;   ;            ;     ;     ;   ;
IntegrationEpdOid   ;STRING;   ;23 ;0  ;1  ;   ;            ;     ;     ;   ;
PdPipelineOid       ;STRING;   ;24 ;0  ;1  ;   ;            ;     ;     ;   ;
PdSpeckOid          ;STRING;   ;24 ;0  ;1  ;   ;            ;     ;     ;   ;
PdInsulationSpeckOid;STRING;   ;24 ;0  ;1  ;   ;            ;     ;     ;   ;
pd_col_name_for_ns_field_count;INT   ;   ;   ;1  ;   ;   ;            ;-1   ;5    ;   ;
PosIdOld            ;WSTRING;   ;21 ;0  ;1  ;   ;            ;     ;     ;   ;
EdmOid              ;STRING;   ;23 ;0  ;1  ;   ;            ;     ;     ;   ;
/*
VALVES
col                 ;typ   ;isk;len;edi;vle;amx;qid         ;min  ;max  ;tag;
=============================================================================
*/
NS                  ;FLOAT ;   ;   ;1  ;   ;   ;0 [mm]      ;0    ;10000;   ;
NS2                 ;FLOAT ;   ;   ;1  ;   ;   ;0 [mm]      ;0    ;10000;   ;
NS3                 ;FLOAT ;   ;   ;1  ;   ;   ;0 [mm]      ;0    ;10000;   ;
DimDescription      ;WSTRING;   ;31 ;1  ;1  ;   ;            ;     ;     ;   ;
Connection1         ;WSTRING;   ;2  ;1  ;1  ;   ;            ;     ;     ;   ;
Connection2         ;WSTRING;   ;2  ;1  ;1  ;   ;            ;     ;     ;   ;
Connection3         ;WSTRING;   ;2  ;1  ;1  ;   ;            ;     ;     ;   ;
ValveBody           ;WSTRING;   ;40 ;1  ;1  ;   ;            ;     ;     ;   ;
ValveActuator       ;WSTRING;   ;40 ;1  ;1  ;   ;            ;     ;     ;   ;
ClosingType         ;WSTRING;   ;40 ;1  ;1  ;   ;            ;     ;     ;   ;
PN                  ;FLOAT ;   ;   ;1  ;   ;   ;8 [bar]     ;0    ;1000 ;   ;
MaxTemp             ;FLOAT ;   ;   ;1  ;   ;   ;16 [C]      ;0    ;1000 ;   ;
Length              ;FLOAT ;   ;   ;1  ;   ;   ;3 [mm]      ;0    ;10000;   ;
Mass                ;FLOAT ;   ;   ;1  ;   ;   ;6 [kg]      ;0    ;10000;   ;
Actuator            ;WSTRING;   ;20 ;1  ;1  ;   ;            ;     ;     ;   ;
BodyMater           ;WSTRING;   ;20 ;1  ;1  ;   ;            ;     ;     ;   ;
BoxMater            ;WSTRING;   ;20 ;1  ;1  ;   ;            ;     ;     ;   ;
Ball/Flap/DiscMater ;WSTRING;   ;20 ;1  ;1  ;   ;            ;     ;     ;   ;
PackingMater        ;WSTRING;   ;20 ;1  ;1  ;   ;            ;     ;     ;   ;
Manufacturer        ;WSTRING;   ;79 ;1  ;1  ;   ;            ;     ;     ;   ;
ManufCode           ;WSTRING;   ;20 ;1  ;1  ;   ;            ;     ;     ;   ;
Notes               ;WSTRING;   ;79 ;1  ;1  ;   ;            ;     ;     ;   ;
Status              ;SHORT ;   ;   ;0  ;   ;   ;            ;-127 ;127  ;   ;
PdObjectId          ;STRING;   ;24 ;0  ;1  ;   ;            ;     ;     ;   ;

The meaning of the abbreviations:

Abbreviation

Description

col

Name of the database field (column)

typ

Data type

isk

Is a key field

len

Length of the field

edi

Field is editable by the user

vle

Length of the field vary

amx

Allocated maximum of an array type field

qid

The quantity id number of the float type field

min

The minimum value

max

The maximum value

tag

Attribute tag

The .dat file

The .dat file lists the values of the fields separated with semicolons.

The following example shows the header row of A_VALVES.dat file and one valve row:

Copy
PosId;RoleInProcess;Status;Revision;TypeTbl;Pipeline;Spec;InsulationSpec;MenuItmData;Description;DmPartCode;Compartment;EstimatedX;EstimatedY;EstimatedZ;ObjectIsInModel;PdObjectId;PosIdNull;IntegrationEpdOid;PdPipelineOid;PdSpeckOid;PdInsulationSpeckOid;pd_col_name_for_ns_field_count;PosIdOld;EdmOid;NS;NS2;NS3;DimDescription;Connection1;Connection2;Connection3;ValveBody;ValveActuator;ClosingType;PN;MaxTemp;Length;Mass;Actuator;BodyMater;BoxMater;Ball/Flap/DiscMater;PackingMater;Manufacturer;ManufCode;Notes;Status;PdObjectId;
V049;;1;3;VALVES;CIP-01;;;V%D2429T2.7.1.26;Four way valve;;;0.000000;0.000000;0.000000;0;SqN2lUhhHt6G8OjKY8W3HW;0;RqOkTfx6IyQaNLOwwwUuSW;ZNgW._.GJTMkkAB7B2cI0G;;;1;;;76.199997;0.000000;0.000000;;;;;;;;0.000000;0.000000;0.000000;0.000000;;;;;;;;;1;SqN2lUhhHt6G8OjKY8W3HW;

Quantities are printed in the base units, for example "NS" is printed in mm. Check the .dbs file to see the unit in which each quantity type field is printed.