Escolar Documentos
Profissional Documentos
Cultura Documentos
User Guide
Disclaimer
Information of a technical nature, and particulars of the product and its use, is given by AVEVA
Solutions Ltd and its subsidiaries without warranty. AVEVA Solutions Ltd and its subsidiaries disclaim
any and all warranties and conditions, expressed or implied, to the fullest extent permitted by law.
Neither the author nor AVEVA Solutions Ltd, or any of its subsidiaries, shall be liable to any person or
entity for any actions, claims, loss or damage arising from the use or possession of any information,
particulars, or errors in this publication, or any incorrect use of the product, whatsoever.
Copyright
Copyright and all other intellectual property rights in this manual and the associated software, and every
part of it (including source code, object code, any data contained in it, the manual and any other
documentation supplied with it) belongs to AVEVA Solutions Ltd or its subsidiaries.
All other rights are reserved to AVEVA Solutions Ltd and its subsidiaries. The information contained in
this document is commercially sensitive, and shall not be copied, reproduced, stored in a retrieval
system, or transmitted without the prior written permission of AVEVA Solutions Ltd. Where such
permission is granted, it expressly requires that this Disclaimer and Copyright notice is prominently
displayed at the beginning of every copy that is made.
The manual and associated documentation may not be adapted, reproduced, or copied, in any material
or electronic form, without the prior written permission of AVEVA Solutions Ltd. The user may also not
reverse engineer, decompile, copy, or adapt the associated software. Neither the whole, nor part of the
product described in this publication may be incorporated into any third-party software, product,
machine, or system without the prior written permission of AVEVA Solutions Ltd, save as permitted by
law. Any such unauthorised action is strictly prohibited, and may give rise to civil liabilities and criminal
prosecution.
The AVEVA products described in this guide are to be installed and operated strictly in accordance with
the terms and conditions of the respective license agreements, and in accordance with the relevant
User Documentation. Unauthorised or unlicensed use of the product is strictly prohibited.
First published September 2007
AVEVA Solutions Ltd, and its subsidiaries
AVEVA Solutions Ltd, High Cross, Madingley Road, Cambridge, CB3 0HB, United Kingdom
Trademarks
AVEVA and Tribon are registered trademarks of AVEVA Solutions Ltd or its subsidiaries. Unauthorised
use of the AVEVA or Tribon trademarks is strictly forbidden.
AVEVA product names are trademarks or registered trademarks of AVEVA Solutions Ltd or its
subsidiaries, registered in the UK, Europe and other countries (worldwide).
The copyright, trade mark rights, or other intellectual property rights in any other product, its name or
logo belongs to its respective owner.
Contents
Page
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3:2
12.0
5:1
5:1
5:2
5:4
5:4
5:5
5:5
ii
12.0
iii
12.0
iv
12.0
Introduction
1.1
Initialisation
Navigation
Attribute retrieval
Error handling
Utility routines
The initialisation routines allow access to the requested PDMS project and MDB
configuration in line with the normal PDMS entry procedure. The routines open all
authorised databases in read mode only. The navigation routines follow the current PDMS
navigation techniques and standards. The PDMS concept of 'current element' is thus
maintained. All data attributes are retrieved by first moving to the required element using
the navigation routines, and then calling the appropriate attribute retrieval routine.
No facilities are provided for writing or updating data in PDMS databases.
1.2
1:1
12.0
1.3
1.4
1.5
1:2
12.0
Programming Techniques
2.1
FORTRAN 77
PDMS DARs are written in FORTRAN 77 and can be called from any FORTRAN 77
program or from any other program that can call ANSI standard FORTRAN 77 subroutines.
It is not within the scope of this manual to explain FORTRAN 77 programming methods. If
necessary, the following text book is recommended:
If the programmer does not wish to pass character strings into the application program or
can convert to and from hollerith constants or ASCII integer arrays, it would be possible to
interface PDMS DARs to a FORTRAN 66 application program via a neutral interface.
2.2
Declarations
The subroutine summaries define the argument declarations that are used within the DARs.
Character and logical arguments must be explicitly declared in calling routines.
The following naming convention has been adopted in the subroutine specifications:
CHARACTER
CD3xxx
INTEGER
ID3xxx
REAL
RD3xxx
LOGICAL
LD3xxx
Character and logical arguments must be explicitly declared in calling routines. Integer and
real arguments comply with the default FORTRAN 77 naming convention and need not be
declared.
Wherever assumed size arrays or character strings are used
e.g.
INTEGER
ID3XYZ(*)
CHARACTER*(*)
CD3XYZ
2:1
12.0
the programmer must provide the appropriate explicit declaration in the application program.
Functions are avoided in PDMS DARs but some general utility functions are provided. The
calling routine must make the following declarations where these functions are used:
INTEGER
D3ULEN
LOGICAL
D3UCTI
LOGICAL
D3UCTR
LOGICAL
D3UGTU
LOGICAL
D3UCLU
2.3
CHARACTER Handling
The handling of character variables is the most significant difference between FORTRAN 66
and FORTRAN 77.
Whenever character arguments are passed into a DARs routine, the routine will ignore any
trailing blanks. Character arguments returned by a routine are padded with blanks to the
end of the character string. A returned character argument will never be undefined. A blank
string ' ' will be returned as a 'minimum' ('blank' as distinct from 'null').
Programmers should be aware that an assignment such as:
CHARACTER*10
CD3XYZ
.
.
CD3XYZ =
'ABC'
2:2
ABC'
12.0
If the programmer wishes to know the significant length of a returned string (e.g. the
significant length of 'ABC
' is 3), he may use the general utility function D3ULEN.
e.g.
EXTERNAL
INTEGER
D3xxxx, D3ULEN
D3ULEN, NC
CHARACTER*10 CD3XYZ
CALL D3xxxx(.........,CD3XYZ,.....)
PRINT *, CD3XYZ(1:D3ULEN(CD3XYZ)), ' returned'
or
NC = D3ULEN(CD3XYZ)
PRINT *, CD3XYZ(1:NC), ' returned'
would print
ABC returned
rather than
ABC
returned
IF (D3ULEN(CD3XYZ).EQ.0) THEN
PRINT *, 'blank string returned'
ELSE
.....
ENDIF
2.4
Error Handling
The DARs routines trap user input argument errors and cases where return character
arguments are too short for the data being returned. The way in which such errors are
handled varies according to the routine and is detailed in the 'Subroutine Specifications'.
Many other potential errors are detected by the routines in the course of execution. All error
conditions are communicated to the calling program through a return status code argument
(always named ID3ERR in the subroutine specifications). A zero status code signifies
successful execution; a positive value indicates an error condition.
Each subroutine specification lists the status codes applicable to it and a full list is provided
in Appendix Error Codes and Messages.
2:3
12.0
Whenever an error condition is returned, the DARs set an internal error flag. This prevents
entry into the next DARs routine (unless it is D3FIN, D3EMSG, D3ERST or D3UMON). The
purpose of this action is to make the error obvious to the programmer (or to the user) and to
prevent subsequent return of useless data. When such a failure occurs, helpful information
concerning the source of the error is output to the screen. The programmer can obtain even
more information by setting the monitor flag at an appropriate point.
In some circumstances, the programmer deliberately creates an error condition. This is a
convenient way to terminate a loop. Routine D3ERST is provided to allow the programmer
to reset the internal error flag in such a situation. Thus, the internal error flag is a device to
trap errors not expected by the programmer.
The following extract from D3QMEM in the auxiliary routine library illustrates use of these
principles. The status code returned by a routine can be converted into a message by a call
to D3EMSG.
20
CONTINUE
IF ( ID3ERR .EQ. 0 ) THEN
NMEMB = NMEMB + 1
Read type
CALL D3RTYP( CD3TEX, ID3ERR )
IF ( ID3ERR .NE. 0 ) GOTO 12345
CD3TYP(NMEMB) = CD3TEX
Read name/reference
CALL D3RNAM( 'NAME', CD3TEX, ID3ERR )
IF ( ID3ERR .NE. 0 ) GOTO 12345
CD3NAM(NMEMB) = CD3TEX
ELSE
2:4
12.0
End of list
100
CONTINUE
.
.
12345
CONTINUE
CALL D3EMSG(ID3ERR,.TRUE.,CMESS)
PRINT*, 'Error in subroutine ABC, please report to
xxx')
It is good practice if the programmer provides his own error trapping as illustrated above,
particularly in a released applications program. The user can then be given an appropriate
message, rather than receiving a message from the DARs error handling system.
2:5
12.0
2:6
12.0
3.1
3.2
3.3
Current Element
The navigation routines follow the current PDMS navigation techniques and standards. The
PDMS concept of 'current element' is thus maintained. All data attributes are retrieved by
first moving to the required element using the navigation routines, and then calling the
appropriate attribute retrieval routine.
3.4
User-Defined Attributes
The routines that retrieve attributes may be used for both system-defined and user-defined
attributes (UDAs). As with PDMS, DARs routines identify UDAs by a leading ':' character in
the UDA name.
3.5
3:1
12.0
The same technique is also applied to text attributes. In earlier versions of PDMS all text
attributes were of fixed length (e.g. STEX could be of length 15, 30, 45, 60, 75, 90, 105 or
120). With dynamic text, the user may define text of any length up to a maximum (typically
120). Where dynamic text is defined and no text has been provided, DARs will return the
error condition Attribute unset.
3.6
Monitoring
The monitoring facility enables the programmer to set the level of information displayed by
the Data Access routines. It is set by an argument passed to the initialisation routine D3INIT
and can be reset at any point by a call to D3UMON. If the monitor option FULL is selected,
then every time a data access routine is called, the name of the routine is displayed along
with the values of all the input arguments, and on exit the returned argument values are
displayed, together with all warning and error conditions encountered. Alternatively, the
programmer may set the monitor level to OFF. In this case, he can use the routine
D3EMSG to display error messages as he wishes. Note that even if the monitor level is set
to OFF, some important low level messages will still be displayed on the screen.
3.7
Site File
PDMS DARs operate a sitefile checking procedure in the same manner as PDMS. A DARs
program user is included in the count of PDMS users. A PDMS DARs application program
will not continue to execute if a fatal sitefile error is encountered. Sitefile warning messages
and fatal error messages will be output to the terminal.
3.8
Multibyte Text
If a PDMS project has been identified as multibyte (PROJECT MBCHARSET in the ADMIN
module), it is possible for users to enter multibyte element names and attributes in some
PDMS modules. This allows Far Eastern users to enter Kanji text, which is stored in PDMS
as multibyte text (two bytes per Kanji character). This also applies to the Chinese alphabet.
Kanji and Chinese text can be input to or returned by DARs routines. The method of
interpreting multibyte names and text accessed through DARs is detailed in Multibyte Text
Handling.
3:2
12.0
4.1
Introduction
The use of data access routines is best illustrated by reference to some simple examples.
The examples used in this section are based on the PDMS project used in the acceptance
test. Details in this section are applicable to any machine type.
Where the examples use a PRINT (or list-directed WRITE) statement, programmers should
note that the default format obtained is dependent on the compiler. Further, some compilers
skip column 1 whether outputting to terminal or file. This is not the case when a FORMAT
specifier is used with a WRITE statement, where the programmer can control the placement
of characters, including the use of column 1. In this situation, the output should not be
dependent on the compiler. The output for these examples is therefore system-dependent
in some minor respects (e.g. spacing of numbers and number of decimal places). The
output shown in this section is typical.
Example 1 is a simple example, involving navigation to the last flange in the first branch of a
named pipe.
Example 2 is a longer example, involving calls to several of the auxiliary routines.
FORTRAN source files for the two examples are included with a release of data access
routines.
4.2
Example 1
The FORTRAN 77 code for the application program is as follows:
PROGRAM EXMPL1
C
SPCREF, CATREF
CD3MSG
CHARACTER*6
CD3WOR, WORDS(100)
REAL PARAMS(100)
C
4:1
12.0
D3RWA,
D3EMSG, D3FIN,
D3FEND,
ID3ERR, ID3NOU, I
INTRINSIC
INT
C
C
Project entry
CALL D3INIT( 'DAR', 'SYSTEM', 'XXXXXX', 'FULL',
' ', ID3ERR )
IF ( ID3ERR .NE. 0 ) GOTO 12345
Select MDB
CALL D3MMDB( 'DESIGN/PLANT', ' ', ID3ERR )
IF ( ID3ERR .NE. 0 ) GOTO 12345
4:2
12.0
', CD3WOR
ENDIF
100
CONTINUE
200
CONTINUE
C
12345
CONTINUE
Exit project
CALL D3FIN( ID3ERR )
Exit DARs
4:3
12.0
CALL D3FEND
END
Compilation, loading and running instructions are detailed in Running Examples.
The program output first illustrated is for the situation where the project DAR does not exist.
The program therefore returns from D3INIT with an error status, which is trapped by the
program. The output, with monitor level in D3INIT set to 'FULL', is as follows:
<site data>
DAR
Username
SYSTEM
Password
XXXXXX
Monitoring level
FULL
Read/Write key
Exiting subroutine D3INIT
Output arguments:
Error code
108
<site data>
4:4
12.0
A second possible error situation, where the MDB does not exist, gives the following output,
with monitor level in D3INIT set to 'FULL':
<site data>
DAR
Username
SYSTEM
Password
XXXXXX
Monitoring level
FULL
Read/Write key
Exiting subroutine D3INIT
Output arguments:
Error code
DESIGN/PLANT
Read/Write key
Opening databases
Mode
Type
Name
----
----
----
Read
DESI
STRUC/S
Read
DESI
PIPE/MAXDBLENGTH31AFTERTHESLASH
Read
CATA
CATAL/C
Read
PROP
PIPE/PROP
4:5
12.0
Read
DESI
PIPE/DR
Read
DICT
PIPE/DR
/100-B-1
BRAN
List position
LAST
Element type
FLAN
4:6
SPRE
12.0
/A3B/100F1
Error code
/A3B/100F1
CATR
/FUAAPAMM
Error code
/FUAAPAMM
NONE
100.0000
Element
254.0000
4:7
12.0
Element
31.80000
Element
54.10000
Element
25.00000
Element
114.3000
Element
BWD
Element
FGD
BWD
Element
FGD
Success
4.3
Example 2
This example is based on part of the acceptance test and calls several of the auxiliary
routines (D3QMEM, D3QSIT etc.). The FORTRAN code for those routines (provided in
source form; see Auxiliary Subroutine Library) may be studied in conjunction with the bare
application code:
C------------------PROGRAM EXMPL2
C------------------LOGICAL
C
PROJIN, MDBIN
Optional declarations
INTEGER
IFINDM
EXTERNAL
IFINDM = 0
C
Project entry
IF ( .NOT. PROJIN() ) GOTO 12345
MDB selection
IF ( .NOT. MDBIN() ) GOTO 12345
Design db test
CALL DECCHK
4:8
12.0
Exit
12345 CONTINUE
CALL D3FIN( IFINDM )
CALL D3FEND
END
TEXT
Optional declarations
INTEGER
IERR
EXTERNAL
D3INIT, D3EMSG
TEXT
Optional declarations
INTEGER
IERR
EXTERNAL
D3MMDB, D3EMSG
4:9
12.0
C---------------------SUBROUTINE DECCHK
C----------------------
CHARACTER*50
TEXT, NAMES(100)
CHARACTER*6
TYPES(100),
LNTP
LOGICAL
LOGICAL
CHARACTER*50
CHARACTER*50
CHARACTER*50
CHARACTER*120
INTEGER
INTEGER
INTEGER
D3XLEN
REAL
HPOS(3),
POS(9)
REAL
ORI(3), ANGL
TYPE,
HDIR(3),
HCON,
TCON,
TPOS(3),
FLOW,
TDIR(3),
Optional declarations
INTEGER
REAL
REAL
EXTERNAL
D3MNAM,
D3MNUM,
D3MREL, D3RORL
4:10
D3UMON,
D3RPAT,
12.0
EXTERNAL
D3RPRL, D3EMSG
EXTERNAL
D3QMEM,
D3QSIT,
D3QPIP, D3QBRA
D3XLEN,
D3QZON,
EXTERNAL
D3QTEE,
D3QELB,
D3QNOZ, D3MMDB
D3QEQU,
D3QBOX,
Look at world
CALL D3QMEM( IDISP, 100, TYPES, NAMES, ISIZ, IERR )
IF ( IERR .NE. 0 ) GOTO 12345
PRINT*, ' '
Look at site
CALL D3MNAM( '/EQU', IERR )
IF ( IERR .NE. 0 ) GOTO 12345
CALL D3QMEM( IDISP, 100, TYPES, NAMES, ISIZ, IERR )
IF ( IERR .NE. 0 ) GOTO 12345
PRINT*, ' '
CALL D3QSIT( IDISP, TYPE, NAME, OWNE, LOCK, POS, ORI,
IERR )
4:11
12.0
Look at zone
CALL D3MNUM( 'zone', 3, IERR )
IF ( IERR .NE. 0 ) GOTO 12345
CALL D3QMEM( IDISP, 100, TYPES, NAMES, ISIZ, IERR )
IF ( IERR .NE. 0 ) GOTO 12345
PRINT*, ' '
CALL D3QZON( IDISP, TYPE, NAME, OWNE, LOCK, POS, ORI,
PSPE,
+
name
/EQU
got
',
GOTO 12345
ENDIF
PRINT*, ' '
C
Pipe details
CALL D3MNAM( '/250-B-5', IERR )
IF ( IERR .NE. 0 ) GOTO 12345
CALL D3QMEM( IDISP, 100, TYPES, NAMES, ISIZ, IERR )
IF ( IERR .NE. 0 ) GOTO 12345
PRINT*, ' '
CALL D3QPIP( IDISP, TYPE, NAME, OWNE, LOCK, BUIL, SHOP,
+
4:12
12.0
REV,
/250-B-5
got
',
GOTO 12345
ENDIF
C
Branch details
CALL D3MNUM( 'BRAN', 1, IERR )
IF ( IERR .NE. 0 ) GOTO 12345
CALL D3QMEM( IDISP, 100, TYPES, NAMES, ISIZ, IERR )
IF ( IERR .NE. 0 ) GOTO 12345
PRINT*, ' '
CALL D3QBRA( IDISP, TYPE, NAME, OWNE, LOCK, BUIL, LHEA,
+
/250-B-5/1
got
GOTO 12345
ENDIF
C
4:13
12.0
Tee details
CALL D3MREL( 'FIRS', 'TEE', IERR )
IF ( IERR .NE. 0 ) GOTO 12345
CALL D3QTEE( IDISP, TYPE, NAME, OWNE, LOCK, POS , ORI ,
+
TSPE, IERR )
Elbow details
CALL D3MREL( 'PREV', 'ELBOW', IERR )
IF ( IERR .NE. 0 ) GOTO 12345
CALL D3QELB( IDISP, TYPE, NAME, OWNE, LOCK, POS , ORI ,
+
4:14
12.0
Equi details
CALL D3MNAM( '/1501B', IERR )
IF ( IERR .NE. 0 ) GOTO 12345
CALL D3QMEM( IDISP, 100, TYPES, NAMES, ISIZ, IERR )
IF ( IERR .NE. 0 ) GOTO 12345
PRINT*, ' '
CALL D3QEQU( IDISP, TYPE, NAME, OWNE, LOCK, FUNC, DSCO,
+
name
/1501B
got
',
GOTO 12345
ENDIF
C
Box details
CALL D3MREL( 'FIRS', 'BOX', IERR )
IF ( IERR .NE. 0 ) GOTO 12345
4:15
12.0
Nozzle details
CALL D3MREL( 'next', 'nozz', IERR )
IF ( IERR .NE. 0 ) GOTO 12345
CALL D3QNOZ( IDISP, TYPE, NAME, OWNE, LOCK, TEMP, PRES,
+
POS, ORI,
DUTY,
CREF,
ISPE, IERR )
CATR,
ANGL,
HEIG,
RADI,
12345 CONTINUE
CALL D3UMON('NONE')
CALL D3EMSG( IERR, .TRUE., TEXT )
RETURN
END
The output from this example is as follows. Messages
'Entering D3Q...' and 'Exiting D3Q...' result from setting the
4:16
12.0
<site data>
Select MDB
Success
/*
SITE
/NEGATIVE-SITE
SITE
/DIMENSION-SITE
SITE
/VOLCAL.SITE
SITE
/EX1-SITE
SITE
/HANG-SITE
SITE
/CIVIL
SITE
/INTEST-SITE
SITE
/EQU
SITE
/OBSTR
10
GPWL
/GW1
Exiting D3QMEM
Entering D3QMEM
4:17
12.0
Members of SITE
/EQU
ZONE
/EQ1
ZONE
/EQ2
ZONE
/EQ3
Exiting D3QMEM
Entering D3QSIT
Attributes of SITE
/EQU
Entering D3QCMA
TYPE
SITE
NAME
/EQU
OWNE
/*
LOCK
Exiting D3QCMA
POS
0.0000000E+0
0
0.0000000E+00
0.0000000E+
00
ORI
0.0000000E+0
0
0.0000000E+00
0.0000000E+
00
Exiting D3QSIT
Entering D3QMEM
Members of ZONE
/EQ3
EQUI
/EQUIP-FALL
PIPE
/FALL
PIPE
/100-B-2
PIPE
/50-W-3000
PIPE
/50-WD-2400
PIPE
/50-W1-3400
PIPE
/80-S12-1400
PIPE
/200-N12-1000
PIPE
/50-N12-1800
4:18
12.0
10
PIPE
/150-W12-2000
11
PIPE
/150-W12-2200
12
PIPE
/100-C-12
13
PIPE
/100-C-13
14
PIPE
/150-A-57
15
PIPE
/150-A-3
16
PIPE
/40-B-10
17
PIPE
/80-A-11
18
PIPE
/80-B-14
19
PIPE
/100-B-1
20
PIPE
/80-B-7
21
PIPE
/150-B-6
22
PIPE
/100-B-8
23
PIPE
/50-B-9
24
PIPE
/200-B-4
25
PIPE
/250-B-5
Exiting D3QMEM
Entering D3QZON
Attributes of ZONE /EQ3
Entering D3QCMA
TYPE
ZONE
NAME
/EQ3
OWNE
/EQU
LOCK
Exiting D3QCMA
POS
0.0000000E+0
0
0.0000000E+00
100000.0
ORI
0.0000000E+0
0
0.0000000E+00
0.0000000E+
00
PSPE
=0/0
4:19
12.0
ISPE
=0/0
TSPE
=0/0
Exiting D3QZON
Entering D3QMEM
Members of PIPE
/250-B-5
BRAN
/250-B-5/1
BRAN
/250-B-5/2
Exiting D3QMEM
Entering D3QPIP
Attributes of PIPE
/250-B-5
Entering D3QBPA
Entering D3QCMA
TYPE
PIPE
NAME
/250-B-5
OWNE
/EQ3
LOCK
Exiting D3QCMA
BUIL
SHOP
TEMP
-100000.0
PRES
0.0000000E+00
PSPE
/A3B
ISPE
=0/0
TSPE
=0/0
MATR
=0/0
FLUR
=0/0
CASR
=0/0
CCEN
4:20
12.0
CCLA
DUTY
Unset
LNTP
Unset
EREC
DSCO
Unset
PTSP
Unset
INSC
Unset
SAFC
Exiting D3QBPA
BORE
0.0000000E+00
REV
-1
Exiting D3QPIP
Entering D3QMEM
Members of BRAN
/250-B-5/1
GASK
=8196/556
FLAN
=8196/557
ELBO
=8196/558
ELBO
=8196/559
REDU
=8196/560
TEE
/250-B-5/1-T1
REDU
=8196/562
ELBO
=8196/563
ELBO
=8196/564
10
FLAN
=8196/565
11
GASK
=8196/566
Exiting D3QMEM
Entering D3QBRA
Attributes of BRAN
4:21
/250-B-5/1
12.0
Entering D3QBPA
Entering D3QCMA
TYPE
BRAN
NAME
/250-B-5/1
OWNE
/250-B-5
LOCK
Exiting D3QCMA
BUIL
SHOP
TEMP
466.0000
PRES
340.0000
PSPE
/A3B
ISPE
=0/0
TSPE
=0/0
MATR
=0/0
FLUR
=0/0
CASR
=0/0
CCEN
CCLA
DUTY
Unset
LNTP
Unset
EREC
DSCO
Unset
PTSP
Unset
INSC
Unset
SAFC
Exiting D3QBPA
LHEA
LTAI
DETA
4:22
12.0
LSTR
HBOR
200.0000
TBOR
200.0000
HCON
FGD
TCON
FGD
FLOW
Unset
HSTU
/A3B/200P
HREF
/1301-S2
TREF
/1301-S3
HPOS
-319150.0
297760.0
2105.000
HDIR
0.0000000E+0
0
0.0000000E+00
1.000000
TPOS
-319150.0
302640.0
2105.000
TDIR
0.0000000E+0
0
0.0000000E+00
1.000000
Exiting D3QBRA
PH
Coordinate system
/EQ3
N 297760
200
Connection type
FGD
Error code
N 0
U 2105
U 1
4:23
12.0
PPoint number
ptail
Coordinate system
worl
N 302640
E 0
Bore
200
Connection type
FGD
Error code
N 0
U 102105
U 1
NONE
Entering D3QTEE
Attributes of TEE
/250-B-5/1-T1
Entering D3QCPA
Entering D3QCMA
TYPE
TEE
NAME
/250-B-5/1-T1
OWNE
/250-B-5/1
LOCK
Exiting D3QCMA
POS
-318315.3
300229.6
3886.000
ORI
0.0000000E+0
0
0.0000000E+00
0.0000000E+
00
SPRE
/A3B/250T
LSTU
=0/0
BUIL
SHOP
ORIFL
POSFL
ISPE
=0/0
4:24
12.0
TSPE
=0/0
Exiting D3QCPA
CREF
/250-B-5/2
ANGL
90.00000
HEIG
0.0000000E+00
RADI
0.0000000E+00
LOFF
Exiting D3QTEE
Entering D3QELB
Attributes of ELBO =8196/559
Entering D3QCPA
Entering D3QCMA
TYPE
ELBO
NAME
=8196/559
OWNE
/250-B-5/1
LOCK
Exiting D3QCMA
POS
-318315.3
297759.1
3885.950
ORI
180.0000
0.0000000E+00
90.00000
SPRE
/A3B/200EL
LSTU
/A3B/200P
BUIL
SHOP
ORIFL
POSFL
ISPE
=0/0
TSPE
=0/0
Exiting D3QCPA
CREF
=0/0
4:25
12.0
ANGL
90.00000
RADI
0.0000000E+00
Exiting D3QELB
P1
Coordinate system
WORL
N 297759
Direction
vector
E -1
unit
Bore
200
Connection type
BWD
Error code
N 0
U 103886
U 0
P2
Coordinate system
WORL
N 298064
Direction
vector
E 0
unit
Bore
200
Connection type
BWD
Error code
N 1
U 103886
U 0
4:26
12.0
Monitoring level
NONE
Entering D3QMEM
Members of EQUI
/1501B
BOX
=8196/151
PYRA
=8196/152
CYLI
=8196/153
CYLI
=8196/154
RTOR
=8196/155
NOZZ
/1501B-SUCT
NOZZ
/1501B-DISC
Exiting D3QMEM
Entering D3QEQU
Attributes of EQUI
/1501B
Entering D3QCMA
TYPE
EQUI
NAME
/1501B
OWNE
/EQ2
LOCK
Exiting D3QCMA
FUNC
Unset
DSCO
Unset
PTSP
Unset
INSC
Unset
POS
-314490.0
303145.0
340.0000
ORI
0.0000000E+0
0
0.0000000E+00
180.0000
ISPE
=0/0
Exiting D3QEQU
4:27
12.0
owne
E -1
Y axis
Z axis
Error code
N 0
U 0
E 0
N -1
U 0
E 0
N 0
U 1
WORL
E -1
Y axis
Z axis
Error code
N 0
U 0
E 0
N -1
U 0
E 0
N 0
U 1
ZONE
N 303145
Error code
U 340
4:28
12.0
Coordinate system
/EQU
N 303145
Error code
U 100645
NONE
Entering D3QBOX
Attributes of BOX
=8196/151
Entering D3QCMA
TYPE
BOX
NAME
=8196/151
OWNE
/1501B
LOCK
Exiting D3QCMA
XLEN
510.0000
YLEN
1390.000
ZLEN
110.0000
POS
0.0000000E+0
0
-676.0000
-285.0000
ORI
0.0000000E+0
0
0.0000000E+00
0.0000000E+
00
LEVE
10
OBST
Exiting D3QBOX
4:29
12.0
PPoint number
P1
Coordinate system
OWNE
E 255
N -676
N 0
U -285
U 0
Connection type
Error code
P2
Coordinate system
WORL
E -314490
100360
E 0
N -1
303126
U 0
Connection type
0
Error code
Entering subroutine D3UMON
Input arguments:
Monitoring level
NONE
Entering D3QNOZ
Attributes of NOZZ
/1501B-SUCT
Entering D3QCMA
TYPE
NOZZ
NAME
/1501B-SUCT
OWNE
/1501B
4:30
12.0
LOCK
Exiting D3QCMA
TEMP
-100000.0
PRES
0.0000000E+0
0
POS
0.0000000E+0
0
0.0000000E+00
0.0000000E+
00
ORI
0.0000000E+0
0
0.0000000E+00
180.0000
CREF
/100-B-8/1
CATR
/NFAAPAMM
ANGL
90.00000
HEIG
100.0000
RADI
0.0000000E+0
0
DUTY
Unset
ISPE
=0/0
Exiting D3QNOZ
Success
4:31
12.0
4:32
12.0
Subroutine Specifications
5.1
Subroutine Summaries
5.1.1
5.1.2
5:1
12.0
5.1.3
5:2
12.0
5:3
12.0
generally be used in conjunction with the attribute retrieval routines (D3RINT, D3RIA,
D3RREA and D3RRA).
D3RPTX - Read REPORTER Text for a UDA
This routine reads the REPORTER text for a given UDA. REPORTER text may be up to 20
characters long and is used in column headers by the PDMS module REPORTER.
D3RDAT - Read Latest MDB Date-Stamp
This routine returns the latest date-stamp for any database in the mdb system.
D3RBDU - Read Bore and Distance Units
This routine returns the bore and distance units defined for the current MDB. It returns two
character strings containing the linear units.
D3RBOX - Read Enclosing Box Co-ordinates
This routine reads the co-ordinates of the surrounding box for the current element or its
leave tube. This is valid for any database element and is equivalent to the CLASHER
command 'QUERY BOX'.
5.1.4
If the
It returns the error message corresponding to a given error code. The routine will display
the error message if requested.
D3ERST - Reset Internal Error Flag
This routine resets the PDMS data access internal error flag.
Whenever a positive error code is returned by a PDMS data access routine, an internal error
flag is set to prevent the next routine from executing. If the programmer wishes to cancel an
intentional error condition and error handling has not been switched off by D3ECHK, then
this routine must be called to reset the error flag before the next routine is called.
5.1.5
5:4
12.0
5.1.6
5.1.7
5.2
5:5
12.0
CD3ERR
Description
This routine enables the user to switch the internal error handling mechanism on and off.
The default action at program entry is for error handling to be switched ON. When ON, the
user must call D3ERST to reset the internal error flag whenever a DARs routine generates
an error condition (see D3ERST). When OFF, routine D3ERST need not be called. Unlike
most other D3 routines, it does not require a previous successful call to D3INIT. Thus it can
be used to switch error handling off before the first call to D3INIT.
Arguments
CD3ERR
Errors/Warnings
No errors or warnings are generated by this routine
CD3MSG
LOGICAL
LD3DIS
INTEGER
ID3ERR
Description
This routine returns the error message corresponding to a given error code. Unlike other D3
routines, it does not require a previous successful call to D3INIT. Thus it can be used to
interpret a error code returned by D3INIT itself.
If the error code is invalid, the message 'Unknown error' will be returned.
5:6
12.0
LD3DIS
Display flag.
Errors
No errors or warnings can arise in the use of this routine, other than those described above.
It may return 'INVALID CALL TO D3EMSG' if called prior to a call to D3INIT.
SUBROUTINE D3ERST
Description
This routine resets the PDMS data access internal error flag.
Whenever a positive error code is returned by a PDMS data access routine, an internal error
flag is set to prevent the next D3 routine from executing. If the programmer wishes to
cancel an intentional error condition, and error handling has not been switched off by
D3ECHK, then routine D3ERST must be called to reset the error flag before the next routine
is called. The programmer should not call D3ERST without proper cause, otherwise the
purpose of the error flag is negated.
Arguments
None
Errors/Warnings
No errors or warnings are generated by this routine.
SUBROUTINE D3FEND
5:7
12.0
Description
This routine was necessary prior to Mk10.2 as a means of terminating DARs in conjunction
with D3IBEG. It remains available and results in a program exit, equivalent to a CALL EXIT
statement. Programmers should call D3FEND or EXIT but are advised not to use a STOP
statement as this may be trapped by Aveva software and give rise to a warning message.
Arguments
None
Errors/Warnings
No errors or warnings are generated by this routine.
D3FIN - Finish
Specification
ID3ERR
Description
This is the termination routine for a PDMS project.
This routine signals that the application has completed its function in respect of the current
PDMS project. It closes all PDMS database files and removes the user from the system
database/site-file. Any error code set on entry to this routine is preserved and returned.
This routine has no error conditions of its own.
This routine should always be called at the end of a data access applications program. It
may called several times in a program, in which case, calls should match the calls to D3INIT
one for one. If D3FIN is called without a previous call to D3INIT, it will have no effect.
This routine is called automatically from D3INIT in the event of an error condition and from
D3MMDB in the event of a serious error (e.g. corrupt databases). It is also called
automatically by D3INIT if there have been consecutive calls to D3INIT without a call to
D3FIN. Automatic calls are not shown when monitoring is activated.
If this routine is not called before terminating a program, or if the program terminates
abnormally, project database files will remain open (with some operating systems) and
should be closed by the user.
5:8
12.0
Arguments
ID3ERR
D3INIT - Initialise
Specification
INTEGER
ID3ERR
Description
This routine initialises the system for the PDMS data access routines and so must be called
before any of the other routines. It identifies the PDMS project, validates the PDMS project
username and password, and records the presence of the user in the PDMS system. If an
error occurs then an error code as specified below is returned and the project is closed
down with an automatic call to D3FIN. The project, username and password may be
entered as arguments or interactively at runtime in a manner similar to the PDMS entry
procedure.
This routine may be called more than once in a program. If the programmer has not
previously called D3FIN to close down the first project, then D3FIN will be called
automatically.
The user is allowed three attempts at calling D3INIT. After the third consecutive
unsuccessful attempt, a corresponding error condition will be raised and all successive
attempts will be unsuccessful. On successful completion of D3INIT the counter is reset and
the user is allowed a further three attempts at a subsequent project.
If any navigation or attribute retrieval routine is called prior to a successful D3INIT, error 3
(Routine D3INIT has not been called) will be returned to the user and no further action will
be taken.
A monitoring facility may be invoked to assist the programmer in tracking down errors.
Three levels of monitoring are available: FULL, SOME and NONE. 'SOME' monitoring will
cause the names of databases opened by D3MMDB to be output. 'FULL' monitoring will in
addition cause the details of all the data access routines which are called together with their
arguments to be output to the default output device, including all warning/error conditions
encountered. By default no monitoring is provided. The monitoring level can be changed
by a subsequent call to D3UMON.
Arguments
CD3PRJ
5:9
12.0
If the argument is blank (' '), the routine will prompt the user
interactively for the project name in the manner of the PDMS entry
procedure. The user is allowed three attempts to enter a valid project
name. As with PDMS, a valid but non-existent project name will result
in an error condition (error 108).
CD3USR
CD3PAS
CD3MON
CD3RWK
ID3ERR
Error code.
Success
101
102
Bad password
103
Unknown username
104
5:10
12.0
105
106
107
108
109
115
Sitefile/Security error
116
119
CD3NAM
INTEGER
ID3POS, ID3ERR
Description
This routine makes a named database in the current MDB current at the specified position.
Other databases are shuffled up or down, as necessary. This is equivalent to the PDMS
command CURRENT.
If an error occurs then an error code is returned as specified below and the named database
remains in an unchanged state. The change in database status is temporary, for the
duration of the DARs application, similar to the use of CURRENT in the DESIGN module.
Arguments
CD3NAM
ID3POS
ID3ERR
Error code.
5:11
12.0
Success
120
121
122
124
125
CD3NAM
INTEGER
ID3ERR
Description
This routine defers a named database in the current MDB. This database is also placed in
the last list order position and other databases are shuffled up to fill the gap. This is
equivalent to the PDMS command DEFER.
If an error occurs then an error code is returned as specified below and the named database
remains in an unchanged state. The change in database status is temporary, for the
duration of the DARs application, similar to the use of DEFER in the DESIGN module.
5:12
12.0
Arguments
CD3NAM
ID3ERR
Error code.
Success
120
121
123
CD3NM1, CD3NM2
INTEGER
ID3ERR
Description
This routine exchanges a current and a deferred database in the current MDB. One of the
named databases must have 'current' status and the other must have 'deferred' status
before this routine is called. Following successful execution their status and list order
positions will be reversed. This is equivalent to the PDMS command EXCHANGE.
If an error occurs then an error code is returned as specified below and the named
databases remain in an unchanged state. The change in database status is temporary, for
the duration of the DARs application, similar to the use of EXCHANGE in the DESIGN
module.
Error codes 122 and 123 require a slightly different interpretation than suggested by the
standard text (see below). Error codes 120 and 121 may apply to either database.
5:13
12.0
Arguments
CD3NM1
CD3NM2
ID3ERR
Error code.
Success
120
121
122
123
CD3MDB, CD3RWK
INTEGER
ID3ERR
Description
This routine (re)selects an MDB within the requested PDMS project. It closes any PDMS
databases that this user has open and, by default, it opens all current databases in the MDB
in read mode and updates the PDMS system database accordingly. Subsequent database
navigation will have access to the MDB databases in the order determined by the LIST MDB
command in PDMS. That is, the default database is the first database, which may for
example be a design database or a catalogue database. A further option allows the user/
programmer to specify the default database and, at the same time, to limit the number of
databases that are opened.
After a successful call to this routine, the current position is the world corresponding to the
default database.
If an error occurs then an error code as specified below is returned and all databases in the
MDB are closed. To allow the programmer to use this routine interactively, some error
conditions (110, 111, 117, 118) do no more than set the internal error flag and return the
error code. This allows the programmer to call the routine repeatedly to allow the user to
select a valid MDB. All other errors, which generally denote an more serious problem, result
in an automatic call to D3FIN to close the project down.
5:14
12.0
If any navigation or attribute retrieval routine is called prior to a successful D3MMDB, error 4
(Routine D3MMDB has not been called) will be returned to the user and no further action will
be taken.
When SOME or FULL monitoring is activated, a list of all databases opened, together with
open mode and database type, is output to the default output device.
Arguments
CD3MDB
Default database
DES/IGN
Design (DESI)
CAT/ALOGUE
Catalogue (CATA)
PROP DICT
PROP/ERTY
Properties (PROP)
CATA DICT
PAD/DLE
PADDLE (PADD)
DIC/TIONARY
Dictionary (DICT)
None
Blank or null
1st database
All
If a default database is specified, all databases of the types specified in the above table are
opened by this routine.
The MDB name (the string commencing with the first '/'), e.g. '/MDB1' will NOT be converted
to upper case (MDB name is case-sensitive). Names exceeding 32 characters will be
truncated.
Examples of valid entries for this argument:
DESI/PLANT
CAT/TEST
/PLANT
CD3RWK
ID3ERR
Error code.
Success
5:15
12.0
110
111
No databases to open
112
Corrupt databases
113
Databases in use
114
117
118
CD3NAM
INTEGER
ID3ERR
Description
This routine navigates the hierarchy by an element name or reference number. If an error
occurs then an error code as specified below is returned and the database position is not
updated.
Arguments
CD3NAM
ID3ERR
Error code.
Success
5:16
12.0
402
Undefined name/reference
CD3TYP
INTEGER
ID3LIS, ID3ERR
Description
This routine navigates the hierarchy by list order position. It enables the user to either move
to an explicit list order position, or to move to the nth member of a particular element. It
mimics PDMS commands such as '1', 'BRAN 3', 'EQUIP 1'. The type of element specified
may be a PDMS noun or special keywords to move in the current list or to move to a
member owned by the current element. If an error occurs then an error code as specified
below is returned and the database position is not updated.
Arguments
CD3TYP
ELEM/ENT
MEMB/ER
ID3LIS
ID3ERR
Error code.
Success
5:17
12.0
10
201
202
No members
203
List exhausted
205
ID3ERR
Description
This routine navigates to the owner of the current element. If an error occurs then an error
code as specified below is returned and the database position is not updated.
Arguments
ID3ERR
Error code.
Success
204
CD3NAM, CD3TYP
INTEGER
Description
This routine reads the name and status of the database in a defined position in the current
MDB. If executed within a loop, this is equivalent to the PDMS command STATUS.
5:18
12.0
If an error occurs then an error code is returned as specified below, ID3STA is returned as
zero and the character arguments are returned blank. The error code can be used to
terminate a loop if the user wishes to query the status of all databases.
Arguments
ID3POS
CD3NAM
CD3TYP
ID3STA
Current, Read
2:
Current, Closed
3:
Deferred
Error code
Success
125
5:19
12.0
CD3POS, CD3TYP
INTEGER
ID3ERR
Description
This routine navigates the hierarchy relative to the current database position, mimicking
PDMS commands such as PREV, LAST MEMB, NEXT BOX. The movement is specified
using the two arguments CD3POS, which specifies the relative position (PREV, NEXT,
LAST, FIRS) and CD3TYP which qualifies the above instruction with the type of element
required (a keyword or a PDMS noun). If an error occurs then an error code as specified
below is returned and the database position is not updated.
Arguments
CD3POS
FIRS/T
first element
LAST
last element
NEXT
next element
PREV/IOUS
previous element
CD3TYP
ELEM/ENT
MEMB/ER
TID3ERR
Error code
Success
5:20
12.0
201
202
No members
203
List exhausted
205
ID3ERR
Description
This routine restores the database position saved by the previous call to D3MSAV.
Calls to D3MSAV and D3MRST must be paired and can be nested to a depth of 10.
Attempts to restore a position when none has been saved or when any saved positions
have already been restored will result in error code 127. This could occur, therefore, if
nesting is unbalanced. When the routine fails, the database position is unchanged.
Arguments
ID3ERR
Error code.
Success
127
5:21
12.0
ID3ERR
Description
This routine saves the current database position so that it may subsequently be restored by
calling D3MRST. This is more efficient than using D3RNAM and D3MNAM.
Calls to D3MSAV and D3MRST must be paired and can be nested to a depth of 10.
Attempts to exceed this depth will result in the return of error code 126 and the position will
not be saved.
Arguments
ID3ERR
Error code.
Success
126
CD3BUN, CD3DUN
Description
This routine returns the bore and distance units defined for the current MDB. It returns two
character strings of maximum length 4 containing the linear units.
Arguments
CD3BUN
5:22
12.0
CD3DUN
ID3ERR
Error code.
Success
SUBROUTINE D3RBOX
LOGICAL
LD3TUB
INTEGER
ID3ERR
REAL
RD3BOX(6)
Description
This routine reads the co-ordinates of the surrounding box for the current element or its
leave tube. This is valid for any database element and is equivalent to the CLASHER
command 'QUERY BOX':
5:23
12.0
Arguments
LD3TUB
.TRUE.
Return box for leave tube (or branch head tube for branch)
.FALSE.
RD3BOX
Surrounding box
The box is returned as a six element real array containing the x/
y/z world co-ordinates of opposite corners of the box. The six
elements have the following arrangement:
1st corner - E (element 1), N (element 2), U (element 3)
2nd corner - E (element 4), N (element 5), U (element 6)
Array RD3BOX must be declared at least six elements.
ID3ERR
Error code.
Success
309
310
CD3DAT
INTEGER
ID3DAT(6), ID3ERR
Description
This routine returns the latest date-stamp for any database in the mdb system. For user
convenience, the date/time is returned in two arguments: an integer array and a character
string.
In a PDMS run, each database of the current MDB is date-stamped with the current
operating system date/time when a user with WRITE access leaves a design module (e.g.
DESIGN) after making a change to the data and without QUITting. This maintains a record
of the date and time of the last database change.
Error code 306 is returned if no date-stamps can be found.
5:24
12.0
Arguments
ID3DAT
ID3DAT(1)
ID3DAT(2)
ID3DAT(3)
Day (1 to 31)
ID3DAT(4)
Hour (0 to 23)
ID3DAT(5)
Minute (0 to 59)
ID3DAT(6)
Second (0 to 59)
The ID3DAT array must be dimensioned to a minimum of six. The array will be returned
as zeroes if an error condition occurs.
CD3DAT
11-16:
returns dd Mon yy
17-19:
No error code will be returned if a blank or truncated string is returned. A blank string will
be returned if an error condition occurs.
ID3ERR
Error code.
Success
5:25
12.0
306
No date-stamp found
CD3ATT
INTEGER
Description
This routine reads an integer array attribute of the current element. The attribute may be a
UDA. The maximum size of array required is specified by ID3NIN. The array must be
dimensioned at least this big. The number of values returned is output in ID3NOU. Any
excess elements of ID3NIN over ID3NOU are returned as zero.
The routine will return a single value for a single integer attribute.
If an error occurs then an error code is returned as specified below, ID3NOU is returned as
zero and ID3NIN elements of array ID3IA are returned as zero.
The routine will return the error 'Attribute not found' for a dynamic array attribute that has no
values set (see Dynamic Array Attributes).
The routine will return a valid (but meaningless) integer array for a text attribute. This
results from the way that text attributes are stored on the databases. Error code 302 will not
therefore be returned for a text attribute.
5:26
12.0
Arguments
CD3ATT
ID3NIN
ID3IA
ID3NOU
ID3ERR
Error code.
Success
301
302
308
Attribute unset
5:27
12.0
CD3ATT
INTEGER
ID3INT, ID3ERR
Description
This routine reads an integer attribute of the current element. The attribute may be a UDA.
If an error occurs then an error code is returned as specified below and the ID3INT
argument is returned as zero.
Arguments
CD3ATT
ID3INT
ID3ERR
Error code.
Success
301
302
5:28
12.0
CD3ATT
INTEGER
LOGICAL
LD3LA(ID3NIN)
Description
This routine reads a logical array attribute of the current element. The attribute may be a
UDA. The maximum size of array required is specified by ID3NIN. The array must be
dimensioned at least this big. The number of values returned is output in ID3NOU. Any
excess elements of ID3NIN over ID3NOU are returned as false.
The routine will return a single value for a single logical attribute.
The routine will return the error 'Attribute not found' for a dynamic array attribute that has no
values set (see Dynamic Array Attributes).
If an error occurs then an error code is returned as specified below, ID3NOU is returned as
zero and ID3NIN elements of LD3LA are returned as false.
The only use of logical arrays is for UDAs.
Arguments
CD3ATT
ID3NIN
LD3LA
ID3NOU
5:29
12.0
ID3ERR
Error code.
Success
301
302
308
Attribute unset
CD3ATT
INTEGER
ID3ERR
LOGICAL
LD3LOG
Description
This routine reads a logical attribute of the current element. The attribute may be a UDA. If
an error occurs then an error code is returned as specified below and LD3LOG is returned
as false.
Arguments
CD3ATT
LD3LOG
ID3ERR
Error code.
5:30
12.0
Success
301
302
CD3ATT, CD3NAM
INTEGER
ID3ERR
Description
This routine reads the name of the current element or the name of a reference attribute of
the current element. The reference attribute may be a UDA. It returns a reference number
if the requested name does not exist.
A name is returned with the leading '/' character. If a reference number is returned, it
includes the '=' and '/' characters.
If an error occurs then an error code is returned as specified below and CD3NAM is
returned as blank.
Use routine D3RREF to obtain the reference specifically even if a name is available.
Arguments
CD3ATT
CD3NAM
5:31
12.0
Error code.
Success
301
302
CD3CRD
INTEGER
ID3ERR
REAL
RD3ORI(9)
Description
This routine reads the orientation of the current element relative to a specified co-ordinate
system. Valid co-ordinate systems include PDMS names, PDMS reference numbers,
PDMS nouns and the text 'OWN/ER'. The orientation is returned as a nine element real
array containing the three unit vectors. Array RD3ORI must be declared at least nine
elements.
If an error occurs then an error code is returned as specified below and nine elements of
RD3ORI are returned as zero.
Arguments
CD3CRD
5:32
12.0
The input string will be tested against each type of input in turn.
An unrecognised entry for CD3CRD will result in error code 7
(Invalid co-ordinate system keyword) or error code 205 (Cannot
access this type of element).
When testing for 'OWNER' or a PDMS noun, input characters will
be converted to upper case. In the case of PDMS nouns,
abbreviations accepted in PDMS will be accepted by this routine
(e.g. 'ZON', 'WORL' are accepted).
When testing for a PDMS name, the input string will not be
converted to upper case and strings exceeding 50 characters will
be truncated.
For a reference number, any string that is not of the form '=m/n',
where m and n are valid integers, will be rejected with error code
9.
An undefined name or reference number will result in error code
402.
RD3ORI
ID3ERR
Error code.
Success
205
402
Undefined name/reference
5:33
12.0
INTEGER
ID3ERR
REAL
Description
This routine reads the PPoint attributes (position, direction, connection type and bore) for a
piping component or equipment primitive, relative to a specified co-ordinate system. Valid
co-ordinate systems include PDMS names, PDMS reference numbers, PDMS nouns and
the text 'OWN/ER'. For branch and piping component PPoints the co-ordinate system
'OWNER' is interpreted as 'ZONE' since 'BRAN' and 'PIPE' are not meaningful co-ordinate
systems.
The specified PPoint may be 'PH', 'PT', 'PA', 'PL', or 'P<n>'. Implied tubing points may thus
be obtained by interrogating the arrive and leave points of the appropriate components. For
equipment primitives, a zero bore and blank connection type are returned. Position and
direction are returned as real arrays of three elements each. Direction is in the form of a unit
vector.
Arrays RD3POS and RD3DIR must be declared at least three elements each.
If an error occurs then an error code is returned as specified below, 3 elements of RD3POS,
3 elements of RD3DIR, and RD3BOR are returned as zero, and CD3CON is returned blank.
Arguments
CD3POI
CD3CRD
5:34
12.0
RD3DIR
RD3BOR
CD3CON
ID3ERR
Error code.
Success
205
303
5:35
12.0
304
402
Undefined name/reference
CD3NAM, CD3TEX
INTEGER
ID3ERR
Description
This routine retrieves project code, name, number, description or message from the System
Database as a character string. The routine is equivalent to PDMS ADMIN/MONITOR
command 'Q/UERY PROJ/ECT <keyword>'.
If an error occurs then an error code is returned as specified below and the CD3TEX
argument is returned blank.
This routine may be called before D3MMDB has been called.
Arguments
CD3NAM
COD/E
project code
NUM/BER
project number
NAM/E
project name
DES/CRIPTION
project description
MES/SAGE
project message
The nomenclature of 'code' and 'name' may appear confusing. Project 'code' is the 3character code normally known as 'project name' (see CD3PRJ in routine D3INIT).
Project 'name' is a descriptive text (up to 119 characters), specified in the PDMS ADMIN
module.
CD3TEX
5:36
12.0
Error code.
Success
11
CD3CRD
INTEGER
ID3ERR
REAL
RD3POS(3)
Description
This routine reads the position of the current element relative to a specified co-ordinate
system. Valid co-ordinate systems include PDMS names, PDMS reference numbers,
PDMS nouns and the text 'OWN/ER'. The position is returned as a three element real array.
Array RD3POS must be declared at least three elements.
If an error occurs then an error code is returned as specified below and three elements of
RD3POS are returned as zero.
5:37
12.0
Arguments
CD3CRD
RD3POS
The position.
The position is returned as a three element real array
containing the three vectors in E, N, U order. Array
RD3POS must be declared at least three elements.
ID3ERR
Error code.
Success
205
402
Undefined name/reference
5:38
12.0
Specification
CD3ATT, CD3RPT
INTEGER
ID3ERR
Description
This routine reads the REPORTER text for a given UDA. REPORTER text may be up to 20
characters long and is used in column headers by the PDMS module REPORTER.
If no REPORTER text has been defined, the routine will return the UDA name.
Arguments
CD3ATT
:CONTROLLER
:CONT
CONT
assuming a minimum abbreviation of 4 or less.
CD3RPT
ID3ERR
Error code.
Success
307
5:39
12.0
CD3ATT
INTEGER
REAL
RD3RA(ID3NIN)
Description
This routine reads a real array attribute of the current element. The attribute may be a UDA.
The maximum size of array required is specified by ID3NIN. The array must be
dimensioned at least this big. The number of values returned is output in ID3NOU. Any
excess elements of ID3NIN over ID3NOU are returned as zero.
The routine will return a single value for a single real attribute.
The routine will return the error 'Attribute not found' for a dynamic array attribute that has no
values set (see Section Dynamic Array Attributes).
If an error occurs then an error code is returned as specified below, ID3NOU is returned as
zero and ID3NIN elements of array RD3RA are returned as zero.
Arguments
CD3ATT
ID3NIN
RD3RA
5:40
12.0
ID3NOU
ID3ERR
Error code.
Success
301
302
308
Attribute unset
CD3ATT
INTEGER
ID3ERR
REAL
RD3REA
Description
This routine reads a real attribute of the current element. The attribute may be a UDA. If an
error occurs then an error code is returned as specified below and the RD3REA argument is
returned as zero.
5:41
12.0
Arguments
CD3ATT
RD3REA
ID3ERR
Error code.
Success
301
302
CD3ATT, CD3REF
INTEGER
ID3ERR
Description
This routine reads the reference number of the current element or of a reference attribute of
the current element (e.g. a connection reference, specification reference). The reference
attribute may be a UDA.
If an error occurs then an error code is returned as specified below and CD3REF will be
returned zero.
Use routine D3RNAM to obtain the name, if available, in preference to the reference
number.
5:42
12.0
Arguments
CD3ATT
CD3REF
ID3ERR
Error code.
Success
301
302
INTEGER
CD3ATT, CD3RFA(ID3NIN)
Description
This routine reads a reference number array attribute of the current element, e.g.
connection reference array. The attribute may be a UDA. The reference numbers returned
by the routine will include the '=' and '/' characters. The maximum size of array required is
specified by ID3NIN. The array must be dimensioned at least this big. The number of
5:43
12.0
values returned is output in ID3NOU. Any excess elements of ID3NIN over ID3NOU are
returned as blank.
The routine will return a single value for a single reference attribute.
The routine will return the error 'Attribute not found' for a dynamic array attribute that has no
values set (see Dynamic Array Attributes).
If an error occurs then an error code is returned as specified below. Except for error code 5,
ID3NOU is returned as zero and ID3NIN elements of array CD3RFA are returned as blank.
Arguments
CD3ATT
ID3NIN
CD3RFA
ID3NOU
ID3ERR
Error code.
Success
5:44
12.0
301
302
308
Attribute unset
CD3ATT, CD3TEX
INTEGER
ID3ERR
Description
This routine reads a system-defined text attribute of the current element or a user-defined
text or word attribute.
The routine will return the error 'Attribute unset' for a dynamic text attribute that has no text
set (see Dynamic Array Attributes).
If an error occurs then an error code is returned as specified below and CD3TEX is returned
as blank.
In some circumstances, the routine will return a valid (but meaningless) text string for an
integer array attribute. This results from the way that text attributes are stored on the
databases. Error 302 will only be returned for an integer array attribute in circumstances
where the array does not convert into a valid text string.
5:45
12.0
Arguments
CD3ATT
CD3TEX
ID3ERR
Error code.
Success
301
302
308
Attribute unset
5:46
12.0
CD3TYP
INTEGER
ID3ERR
Description
This routine reads the PDMS 'type' attribute of the current element. If an error occurs then
an error code is returned as specified below and CD3TYP is returned as blank.
This routine gives the same result as calling D3RWOR with 'TYPE' as the attribute name.
Arguments
CD3TYP
ID3ERR
Error code.
Success
INTEGER
Description
This routine reads, for a specified element type, parallel lists of UDA names, lengths of
minimum valid abbreviations and attribute types. If an error occurs all lists will be set to
5:47
12.0
blanks, the number of attributes returned (ID3NUM) will be set to zero, and a value
indicating the type of error will be returned in ID3ERR. If no UDAs exist for the given
element type or if the element type is invalid, the number of attributes returned will be zero.
ID3MAX specifies the number of attributes expected to be returned in the list and must be
set by the call to the routine. If the actual number of UDAs associated with the given
element type exceeds this value the list will be truncated.
Arguments
CD3TYP
ID3MAX
CD3NMS
ID3ABV
CD3ATP
Array containing a list of the UDA types. Possible UDA types are:
REAL
: Real
INT
: Integer
REF
: Reference
TEXT
: Text
WORD
: Word
LOG
: Logical
This array variable should be declared to at least CHARACTER*4. If declared less than
this, the returned words will be truncated. No warning will be given if truncation occurs.
Truncation is only significant in distinguishing between 'REF' and 'REAL', so
CHARACTER*3 would be acceptable.
5:48
12.0
ID3NUM
ID3ERR
Error code.
Success
CD3ATT, CD3UNT
INTEGER
ID3ERR
Description
This routine returns a text string indicating the UNIT (of measurement) which applies to the
specified UDA. Only real or integer attributes may have a UNIT specified. This routine will
generally be used in conjunction with the attribute retrieval routines (D3RINT, D3RIA,
D3RREA and D3RRA). Thus, for example, an attribute value of 1000.0 and units of 'mm'
may be interpreted as 1000.0mm.
5:49
12.0
Arguments
CD3ATT
:CONTROLLER
:CONT
CONT
assuming a minimum abbreviation of four or less.
CD3UNT
ID3ERR
Error code.
Success
307
INTEGER
CD3ATT, CD3WA(ID3NIN)
Description
This routine reads a word array attribute of the current element (e.g. CTYP). The maximum
size of array required is specified by ID3NIN. The array must be dimensioned at least this
big. The number of values returned is output in ID3NOU. Any excess elements of ID3NIN
over ID3NOU are returned as blank.
The routine will return a single value for a single word attribute.
5:50
12.0
The routine will return the error 'Attribute not found' for a dynamic array attribute that has no
values set (see Section Dynamic Array Attributes).
If an error occurs then an error code is returned as specified below. Except for error code 5,
ID3NOU is returned as zero and ID3NIN elements of array CD3WA are returned as blank.
In some cases, word attributes are stored within a real array (e.g. the PARA attribute). In
this situation, the word attributes can be extracted by using successive calls to D3RRA and
D3UDEH, as illustrated by the following extract from Example 1 (see Example 1).
INTEGER
ID3NOU, ID3ERR, I
REAL
PARA( 100
CHARACTER*6
PARWOR( 100 )
INTRINSIC
INT
CONTINUE
ENDIF
Alternatively, the word parameters can be extracted using D3RWA with WPAR as the
attribute name, but this will extract any non-word Real numbers as blanks (see Example 1).
Arguments
CD3ATT
ID3NIN
5:51
12.0
CD3WA
ID3NOU
ID3ERR
Error code.
Success
301
302
308
Attribute unset
CD3ATT, CD3WOR
INTEGER
ID3ERR
Description
This routine reads a PDMS 'word' attribute of the current element (e.g. connection type).
UDAs of type WORD must be accessed by using routine D3RTEX.
If an error occurs then an error code is returned as specified below and CD3WOR is
returned as blank.
5:52
12.0
Arguments
CD3ATT
CD3WOR
ID3ERR
Error code.
Success
301
302
ID3UNI
Description
This routine accepts the return of a FORTRAN file unit number no longer needed by the
DARs application program. This routine should only be used for returning a unit previously
issued by the complementary routine D3UGTU.
The function's result is FALSE if the unit is invalid or was not issued by D3UGTU.
5:53
12.0
Arguments
ID3UNI
Function Value
D3UCLU
INTEGER
ID3INT
Description
This routine converts the digits in a given string to an integer value. The character string
may start with any number of spaces, optionally followed by + or -, and is terminated by the
end of the string. Trailing blanks are ignored.
The function's result is FALSE if a valid integer is not found or if a valid integer is found
along with further characters.
If the function is FALSE, an error code is returned to identify the cause of the failure. If the
failure is due to the presence of additional characters before and/or after an integer, these
character strings are returned as well as the integer.
It is the programmer's responsibility to declare the character arguments large enough to
hold the returned data. These character strings will be truncated if necessary.
5:54
12.0
Arguments
CD3STR
ID3INT
CD3BEF
CD3AFT
CD3ERR
NAN
Not a number
OOR
Out of range
BLA
Blank string
ADD
Additional data
The 'out of range' error indicates that an integer has been identified, but that its value is
outside the range of a FORTRAN INTEGER variable. The valid range is system
dependent (typically -2147483648 to +2147483647).
If the supplied string is shorter than 3, the returned code will be truncated. A declaration of
CHARACTER*1 is acceptable whether the programmer wishes to ignore the error or
distinguish between them. A declaration of CHARACTER*3 or more will return the full
string.
In the case of 'NAN', 'OOR' or 'BLA', no integer will be returned in ID3INT and blank strings
will be returned in CD3BEF and CD3AFT.
In the case of 'ADD', a valid integer has been found and is returned in ID3INT, but the
string contained characters before and/or after the valid integer. These additional
characters are returned in CD3BEF and CD3AFT.
Function Value
D3UCTI
.TRUE.
5:55
12.0
.FALSE.
if no integer.
.FALSE.
REAL
RD3VAL
Description
This routine converts the digits in a given string to a real number. The character string may
start with any number of spaces, optionally followed by + or -, and is terminated by the end
of the string. Trailing blanks are ignored.
The function's result is FALSE if a valid real number is not found or if a valid number is found
along with further characters.
The string must be of the following form:
(spaces)(+/-)nn(.((nn))(E(+/space/-)nn)
or
(spaces)(+/-).nn(E(+/space/-)nn)
e.g.
'
1.2
6.5E-03', '-.005E7'
If the function is FALSE, an error code is returned to identify the cause of the failure. If the
failure is due to the presence of additional characters before and/or after a real number,
these character strings are returned as well as the real value.
It is the programmer's responsibility to declare the character arguments large enough to
hold the returned data. These character strings will be truncated if necessary.
Arguments
CD3STR
RD3VAL
CD3BEF
5:56
12.0
CD3AFT
CD3ERR
NAN
Not a number
OOR
Out of range
BLA
Blank string
ADD
Additional data
The 'out of range' error indicates that a real number has been identified, but that its value is
outside the range of a FORTRAN double precision REAL variable. The valid range is
system dependent (typically about -1E308 to +1E308). A real number whose value is too
close to zero to be represented by a REAL variable (typically between -1E-308 and +1E308) will be returned as zero and will not return the 'out of range' error.
If the supplied string is shorter than 3, the returned code will be truncated. A declaration of
CHARACTER*1 is acceptable whether the programmer wishes to ignore the error or
distinguish between them. A declaration of CHARACTER*3 or more will return the full
string.
In the case of 'NAN', 'OOR' or 'BLA', no value will be returned in RD3VAL and blank strings
will be returned in CD3BEF and CD3AFT.
In the case of 'ADD', a valid real number has been found and is returned in RD3VAL, but
the string contained characters before and/or after the valid number. These additional
characters are returned in CD3BEF and CD3AFT.
Function Value
D3UCTR
.TRUE.
.FALSE.
if no real number.
.FALSE.
CD3WOR
INTEGER
ID3INT
5:57
12.0
Description
This routine converts a hashed PDMS word (a PDMS word represented as an integer
number) into the PDMS word.
It will normally be use to dehash a hashed word returned by a data access routine (e.g.
some elements of an integer array attribute may be hashed words).
A hashed PDMS word is an integer number in the range 531442 (A) to 387951929
(ZZZZZZ). This routine does not check that the decoded word is meaningful. If the
decoded word is illegal, a blank word is returned.
Arguments
ID3INT
CD3WOR
Errors/Warnings
As noted above, the routine will return a blank string if the integer number cannot be
decoded or if the character string is too short for the returned word.
Failure of this routine does not set the internal error flag.
CD3DAT
INTEGER
ID3DAT(6)
Description
This routine returns the current system date and time. For user convenience, the date/time
is returned in two arguments: an integer array and a character string.
5:58
12.0
Arguments
ID3DAT
ID3DAT(2):
ID3DAT(3):
Day (1 to 31)
ID3DAT(4):
Hour (0 to 23)
ID3DAT(5):
Minute (0 to 59)
ID3DAT(6):
Second (0 to 59)
The ID3DAT array must be dimensioned to a minimum of six. The array will be returned
as zeroes if an error condition occurs.
CD3DAT
11-16:
returns dd Mon yy
17-19:
Errors/Warnings
No errors or warnings can result from the use of this routine. If the array ID3DAT is not
dimensioned to at least six, a program crash is possible.
ID3UNI
5:59
12.0
Description
This routine supplies a valid available FORTRAN file unit number for use by the DARs
application program. This provides a mechanism for avoiding units that are already in use
by the DARS package, provided that the application calls this routine for ALL the file units it
needs.
This routine must be called immediately before the associated file opening statement.
i.e.
IF
(D3UGTU(IUNIT)) THEN
OPEN(IUNIT ...
NOT
DO 100 I=1,20
OK =
100
D3UGTU(IUNIT(I))
CONTINUE
OPEN (IUNIT(1)....
The function's result is FALSE if no further units are available. The application should use
the complementary routine D3UCLU to return units no longer needed and to allow them to
be re-allocated by this routine.
Arguments
ID3UNI
Function Value
D3UGTU
.TRUE.
.FALSE.
if no unit available.
5:60
12.0
Arguments
LD3INI
.TRUE.
.FALSE.
if no unit available.
CD3DAT
INTEGER
ID3ERR
Description
This routine checks whether any database in the current MDB has been date-stamped later
than a specified date/time. It returns a TRUE function value if any database has a later
date-stamp.
Refer to routine D3RDAT for an explanation of the date-stamp feature.
Arguments
CD3DAT
'13sept1997 12:15'
'13sept1997'
ID3ERR
Error code.
Success
5:61
12.0
12
Invalid date/time
13
Function Value
D3ULDS
.TRUE.
.FALSE.
CD3STR
Description
This routine returns the significant length of a character string. That is, the length after
stripping off all trailing blanks. Some compilers provide an intrinsic function for this purpose.
This routine may be used whether or not an intrinsic function is available.
The function returns zero for a blank string. It returns the declared length for an undefined
string.
Intrinsic function LEN should be used to obtain the declared length of a string.
5:62
12.0
Arguments
CD3STR
Function Value
D3ULEN
CD3MON
Description
This routine sets or resets the monitoring level. It re-defines the level set in the last call to
the routine or set in D3INIT.
Three levels of monitoring are available: FULL, SOME and NONE. 'SOME' monitoring will
cause the names of databases opened by D3MMDB to be output. 'FULL' monitoring will in
addition cause the details of all the data access routines which are called, and their input
and output arguments to be output to the default output device, together with all warning/
error conditions encountered.
Arguments
CD3MON
Input characters will be converted to upper case. Strings exceeding four characters will
be truncated. Any string other than 'SOME' or 'FULL' (after truncation) will be interpreted
as 'NONE'.
NONE
SOME
FULL
Errors/Warnings
No errors or warnings can result from the use of this routine.
5:63
12.0
5:64
12.0
Version Control
6.1
6.2
6.3
6:1
12.0
6:2
12.0
A.1
dar100
d3test.f
d3extras.f
d3lib.dll
d3lib.lib
d3test
executable file
d3test.log.base
f77_example1.f
f77_example2.f
f77_example3.f
compload.bat
c_example.c
cxx_example.cxx
ccompload.bat
cxxcompload.bat
A:1
12.0
d3libc.h
pdms.h
The directory dars will normally be a subdirectory of the PDMS release directory
%PDMSEXE% (e.g. pdms12.0/dars).
The DARs 12.0 library is released as a dynamic link library (.dll). This allows us to use C++
code inside PDMS, but still allows DARs applications to be linked with the Fortran compiler,
and reduces the size of the executables produced. Like other dlls, d3lib.dll will need to be
available at runtime, and this is controlled by the environment variable PATH.
The dos scripts can be used by the DARs programmer to compile, link and run his own
programs.
The source file d3extras.f is a library of subroutines that the DARs programmer may find
useful in his own programs. They are included in the DARS library for programmers to use,
or programmers may copy and modify them to suit their purposes. These routines are
briefly described in Auxiliary Subroutine Library.
This appendix covers machine-specific information in respect of FORTRAN libraries and
utilities. C/C++ Library deals with the C/C++ library interface and utilities.
A.2
File Handling
The PDMS DARs routines use CreateFile to allocate file units dynamically. The number of
file units required by PDMS DARs depends on the number of databases in the MDBs used
by the DARs application program.
A DARs application program can use two techniques, fixed and variable, to allocate
FORTRAN file units for its own use.
Using the fixed method, DARs programmers may use any logical unit (positive integers)
valid in FORTRAN.
Using the variable method, programmers request free units, as required, by calls to
D3UGTU. The variable method also provides a routine D3UCLU which returns units when
no longer required. D3UGTU simply allocates a FORTRAN unit in the valid range. The
working of this interface depends upon the programmer following the call to D3UGTU
immediately with a file opening statement.
Fixed or variable methods may be used together.
If the DARs application program allocates so many units that the DARs package runs out of
file units for its own purposes, the DARs routine affected will return an appropriate error
condition.
If D3UGTU is used, files may be accessed by FORTRAN 77 input/output statements such
as OPEN, READ, CLOSE, using fixed or allocated FORTRAN units.
A:2
12.0
EXTERNAL EX1
CALL D3IBEG(EX1,' ')
..
SUBROUTINE EX1
..
OPEN(5, .... )
A.3
A:3
12.0
A.4
The dynamic link library d3lib.dll could not be found in the specified path.
you need to ensure that PATH is set to include the location of d3lib.dll, which is normally
%PDMSEXE%\dars.
If an application program enters D3INIT successfully, program debugging can be assisted
by use of the FULL monitoring level. This can be switched on in D3INIT or by a later call to
D3UMON.
A.5
A:4
12.0
A.6
A:5
12.0
A:6
12.0
Running Examples
The basic principles for compiling, linking and running DARs applications programs have
been outlined in appendix DARs Library Details.
The example programs illustrated in Use of Data Access Routines are best implemented
using scripts similar to compload, which compiles and loads any DARs Fortran application
program. The name of the FORTRAN source file is entered as a command line argument
(e.g. compload f77_example1.f).
The released script will compile and link a PDMS DARs application.
B:1
12.0
B:2
12.0
0 - 99:
General
101 - 199:
Initialisation
201 - 299:
Navigation
301 - 399:
Retrieval
401 - 499:
Database
Success
No errors have occurred
Unknown error
An undocumented error has occurred. Please record the two numbers
that accompany this message and contact your PDMS support engineer.
C:1
12.0
10
11
12
Invalid date/time
The character string entered for date/time is not a valid text string.
13
101
102
Bad password
C:2
12.0
The specified password is not valid for the specified username in the
specified project.
103
Unknown username
The specified username is not defined in the specified project.
104
105
106
107
108
109
110
111
No databases to open
There are no current databases in the specified MDB. Alternatively, there
are no databases of the various types required for the specified default
database. For example, if the default database is type DESI and there are
no DESI, CATA or PROP databases in the MDB.
112
Corrupt databases
Database corruption has been detected.
113
Databases in use
Databases on the specified MDB are held busy by another user. This can
occur even though DARs access is read-only, because PDMS will allow
only one user for any database in an MDB.
114
C:3
12.0
115
Sitefile/Security error
Error returned by sitefile check. The nature of the error will be output to
the terminal in the same way as occurs for PDMS. Unlike PDMS, the
program will not stop, but will simply return this error.
116
117
118
120
121
122
123
124
Or,
Or,
125
126
127
C:4
12.0
D3MRST has been called with no previous matching call to D3MSAV. This
may be the result of unbalanced nesting of D3MSAV and D3MRST, due to
a program logic error.
201
202
No members
An attempt has been made to go to a member of the current element but it
has no members (though it can own them).
203
List exhausted
An attempt has been made to go beyond the end of the current list of
elements.
204
205
301
302
303
304
305
306
No date-stamp found
Databases in MDB do not have a date-stamp. MDB not used since project
created or reconfigured.
307
308
Attribute unset
C:5
12.0
If text, the requested attribute is unset (i.e. null '', as distinct from blank ' ').
If an array, all array elements are unset.
309
310
401
Dabacon error
A Dabacon system error has occurred. Please record the two numbers
that accompany this message and contact your PDMS support engineer.
402
Undefined name/reference
A name or reference number has been supplied which is not defined in a
database which is currently open, either to move to it, or as a coordinate
system.
403
404
405
C:6
12.0
D.1
Introduction
Accompanying a release of PDMS DARs is a library of auxiliary subroutines in source code
that the DARs programmer may find useful in a number of ways:
1. For calling from an application program
2. For examples of the use of data access routines
3. For forming a basis for the programmer's own routines
Aveva may add to this library or make changes to source code from time to time. However,
no undertaking is given that the auxiliary subroutines will be supported.
The conventions adopted in Subroutine Specifications have been adopted in this appendix
where appropriate.
All routines have a ID3DIS argument which can have the following values:
0:
1:
2:
They also have a ID3ERR return argument. If an error condition arises, ID3ERR will return
the appropriate error code (see Error Codes and Messages).
D:1
12.0
D.2
List of Subroutines
All Databases:
D3QMEM
D3QCMA
D3QUDV
Design Database:
D3QSIT
D3QZON
D3QPIP
D3QBRA
D3QBPA
D3QTEE
D3QELB
D3QCPA
D3QEQU
D3QNOZ
D3QBOX
Catalog Database
D3QCAT
D3QSEC
D3QCOM
D3QUNI
D3QUSE
D3QUDE
D3QMSE
D3QMTY
D3QATL
D3QSPW
D:2
12.0
D3QSPE
D3QSEL
D3QSPC
D3QCCT
D3QCOC
D3QTUB
D3QCMP
D3QCDA
D3QCON
Dictionary Database
D3QUDA
Additional Routine
D3XLEN
D.3
INTEGER
CHARACTER*(*)
CD3TYP(ID3NIN), CD3NAM(ID3NIN
Performs the equivalent of a Q MEMBERS for the current element. Element types and
names/references are returned in the output arrays, up to ID3NIN members.
Calls D3RNAM, D3RTYP, D3MREL, D3ERST, D3XLEN, D3MNAM
ID3DIS
Display flag
ID3NIN
CD3TYP
CD3NAM
ID3NOU
ID3ERR
Error code
D:3
12.0
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
Performs the equivalent of a Q ATT for the current element for the four common attributes
type, name, owner and lock.
Calls D3RTYP, D3RNAM, D3RLOG, D3XLEN, D3EMSG, D3ERST. Called by most other
auxiliary routines.
ID3DIS
Display flag
TYPE
Type NAMEName
OWNE
ID3ERR
Error code
INTEGER
ID3DIS, ID3ERR
Performs the equivalent of a Q ATT for all UDAs for the current element. Lists the UDAs,
their properties and values.
Calls D3RIA, D3RRA, D3RLA, D3RRFA, D3RTEX, D3XLEN, D3EMSG, D3RUDA, D3RUNI,
D3RPTX, D3RNAM, D3RTYP, D3ERST
ID3DIS
Display flag
ID3ERR
Error code
D:4
12.0
SUBROUTINE D3QSIT (ID3DIS, TYPE, NAME, OWNE, LOCK, POS, ORI, ID3ERR)
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
REAL
POS(3), ORI(3)
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
POS
Position
ORI
ID3ERR
Error code
Orientation
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
REAL
POS(3), ORI(3)
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
POS
Position
ORI
Orientation
PSPE
Pipe spec
ISPE
Insulation spec
TSPE
Tracing spec
ID3ERR
Error code
D:5
12.0
INTEGER
LOGICAL
CHARACTER*(*)
CHARACTER*(*)
REAL
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
BUIL
Built flag
SHOP
Shop flag
BORE
Pipe bore
TEMP
Temperature
PRES
Pressure
PSPE
Pipe spec
ISPE
Insulation spec
TSPE
Tracing spec
MATR
Material ref
FLUR
Fluid ref
CASR
CCEN
Cost centre
CCLA
Cost class
DUTY
Duty
LNTP
EREC
Erection
REV
Revision
DSCO
Design code
PTSP
Paint spec
INSC
Inspection schedule
SAFC
Safety class
ID3ERR
Error code
LHEA,
TEMP,
DUTY,
TPOS,
INTEGER
LOGICAL
D:6
12.0
CHARACTER*(*)
TYPE, NAME,
FLOW, MATR
OWNE,
LNTP,
HCON,
TCON,
CHARACTER*(*)
FLUR, CASR,
DSCO, PTSP
PSPE,
ISPE,
TSPE,
DUTY,
CHARACTER*(*)
REAL
REAL
TPOS(3), TDIR(3)
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
BUIL
Built flag
LHEA
Head flag
LTAI
Tail flag
DETA
Detailed flag
SHOP
Shop flag
LSTR
Stressed flag
LNTP
EREC
Erection
HBOR
Head bore
TBOR
Tail bore
HCON
TCON
TEMP
Temperature
PRES
Pressure
FLOW
Flow direction
MATR
Material ref
FLUR
Fluid ref
CASR
PSPE
Pipe spec
ISPE
Insulation spec
TSPE
Tracing spec
CCEN
Cost centre
CCLA
Cost class
DUTY
Duty
DSCO
Design code
PTSP
Paint spec
INSC
Inspection schedule
SAFC
Safety class
HSTU
HREF
Head ref
TREF
Tail ref
HPOS
Head position
HDIR
Head direction
TPOS
Tail position
TDIR
Tail direction
ID3ERR
Error code
D:7
12.0
INTEGER
LOGICAL
CHARACTER*(*)
TYPE, NAME,
MATR, FLUR
CHARACTER*(*)
REAL
TEMP, PRES
OWNE,
PSPE,
ISPE,
TSPE,
Performs the equivalent of a Q ATT for the current element for the attributes common to
branch and pipe.
Calls D3QCMA, D3RLOG, D3RREA, D3RNAM, D3RINT, D3RTEX, D3RWOR, D3XLEN,
D3EMSG
Called by D3QBRA, D3QPIP
Arguments: as defined in D3QBRA, D3QPIP
SUBROUTINE D3QTEE( ID3DIS, TYPE, NAME, OWNE, LOCK, POS, ORI, SPRE,
LSTU, CREF, ARRI, LEAV, ANGL, HEIG, RADI, BUIL, SHOP, ORIL, POSI,
LOFF, ISPE, TSPE, ID3ERR )
INTEGER
LOGICAL
CHARACTER*(*)
REAL
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
POS
Position
ORI
Orientation
SPRE
Spec ref
LSTU
Tube ref
CREF
Connection ref
ARRI
Arrive PPoint
LEAV
Leave PPoint
ANGL
Angle
HEIG
Height
RADI
Radius
BUIL
Built flag
SHOP
Shop flag
D:8
12.0
ORIL
Orientation flag
POSI
Position flag
LOFF
Offline flag
ISPE
Insulation spec
TSPE
Tracing spec
ID3ERR
Error code
SUBROUTINE D3QELB( ID3DIS, TYPE, NAME, OWNE, LOCK, POS, ORI, SPRE,
LSTU, CREF, ARRI, LEAV, ANGL, RADI, BUIL, SHOP, ORIL, POSI, ISPE,
TSPE, ID3ERR )
INTEGER
LOGICAL
CHARACTER*(*)
REAL
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
POS
Position
ORI
Orientation
SPRE
Spec ref
LSTU
Tube ref
CREF
Connection ref
ARRI
Arrive PPoint
LEAV
Leave PPoint
ANGL
Angle
RADI
Radius
BUIL
Built flag
SHOP
Shop flag
ORIL
Orientation flag
POSI
Position flag
ISPE
Insulation spec
TSPE
Tracing spec
ID3ERR
Error code
SUBROUTINE D3QCPA( ID3DIS, TYPE, NAME, OWNE, LOCK, POS, ORI, SPRE,
LSTU, ARRI, LEAV, BUIL, SHOP, ORIL, POSI, ISPE, TSPE, ID3ERR )
INTEGER
LOGICAL
CHARACTER*(*)
REAL
POS(3), ORI(3)
D:9
12.0
Performs the equivalent of a Q ATT for the current element for the attributes common to
piping components.
Calls D3QCMA, D3RRA, D3RNAM, D3RINT, D3RLOG, D3XLEN, D3EMSG, D3ERST
Called by D3QELB, D3QTEE
Arguments: as defined in D3QELB, D3QTEE
SUBROUTINE D3QEQU( ID3DIS, TYPE, NAME, OWNE, LOCK, FUNC, DSCO,
PTSP, INSC, POS, ORI, ISPE, ID3ERR )
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
REAL
POS(3), ORI(3)
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
FUNC
Function
DSCO
Design code
PTSP
Paint spec
INSC
Inspection schedule
POS
Position
ORI
Orientation
ISPE
Insulation schedule
ID3ERR
Error code
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
REAL
D:10
12.0
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
TEMP
Temperature
PRES
Pressure
POS
Position
ORI
Orientation
CREF
Connection ref
CATR
Catalogue ref
ANGL
Angle
HEIG
Height
RADI
Radius
DUTY
Duty
ISPE
Insulation spec
ID3ERR
Error code
INTEGER
LOGICAL
LOCK
CHARACTER*(*)
REAL
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
XLEN
X length
YLEN
Y length
ZLEN
Z length
POS
Position
ORI
Orientation
LEVE
Drawing level
OBST
Obstruction level
ID3ERR
Error code
INTEGER
LOGICAL
CHARACTER*(*)
ID3DIS, ID3ERR
LOCK
TYPE, NAME, OWNE
D:11
12.0
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
ID3ERR
Error code
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
ID3ERR
Error code
LOGICAL
LOCK
CHARACTER*(*)
CHARACTER*(*)
PARWOR(ID3NIN)
REAL
PARA(ID3NIN)
Display flag
ID3NIN
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
GTYP
Generic type
PTRE
GMRE
PARA
Parameters array
D:12
12.0
PARWOR
ID3NOU
ID3ERR
Error code
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
BUNI
Bore units
DUNI
Distance units
DFUN
Defined units
ID3ERR
Error code
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
ID3ERR
Error code
INTEGER
LOGICAL
LOCK
D:13
12.0
CHARACTER*(*)
REAL
ADEN, MULT
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
ABRE
Abbreviation
ADEN
Adend
MULT
Multiplier
SIGF
Significant figures
DECP
Decimal places
ID3ERR
Error code
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
ID3ERR
Error code
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
Display flag
TYPE
Type
NAME
D:14
Name
12.0
OWNE
Owner name/ref
LOCK
Lock flag
UREF
Units reference
ID3ERR
Error code
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
ATNA
Atname
ID3ERR
Error code
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
ID3ERR
Error code
INTEGER
LOGICAL
LOCK
CHARACTER*(*)
REAL
RATI. DEFA
D:15
12.0
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
QUAL
Quality
QUES
Question
DEFA
Default
TDEFA
Text default
MATR
Material ref
FLUR
Fluid ref
RATI
Pressure rating
LNTP
Line type
ID3ERR
Error code
INTEGER
LOGICAL
LOCK
CHARACTER*(*)
REAL
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
QUAL
Quality
QUES
Question
ANSW
Answer
TANSW
Text answer
MAXA
Maxan
DEFA
Default
TDEFA
Text default
ID3ERR
Error code
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
D:16
12.0
CHARACTER*(*)
CHARACTER*(*)
MATX
REAL
ANSW, MAXA
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
ANSW
Answer
MAXA
Maxan
TANSW
Text answer
CATR
Catalogue ref
CMPR
Component ref
BLTR
Bolt ref
DETR
MATX
ID3ERR
Error code
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
ID3ERR
Error code
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
D:17
12.0
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
CTYP
ID3ERR
Error code
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
REAL
REAL
REAL
UWEI, UIWE
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
OUTD
Outside diameter
ACBO
Actual bore
BTOL
Bore tolerance
WTOL
UWEI
UIWE
WDIA
SHAP
Shape modulus
RINE
Rotational inertia
SIF
PRFC
Pressure factor
SDTH
Saddle thickness
CORA
Corrosion thickness
EFAC
E-factor
PWAS
BFLE
MRKR
D:18
ID3ERR
Error code
12.0
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
REAL
REAL
REAL
DMFL(9), RMFL(6)
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
OUTD
Outside diameter
ACBO
Actual bore
BTOL
Bore tolerance
WTOL
CWEI
CIWE
WDIA
SHAP
Shape modulus
RINE
Rotational inertia
SIF
PRFC
Pressure factor
SDTH
Saddle thickness
CORA
Corrosion thickness
EFAC
E-factor
PWAS
BFLE
Displacement force
RMFL
Rotation moment
MRKR
DMFL
Displacement moment
ID3ERR
Error code
D:19
12.0
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
REAL
REAL
Performs the equivalent of a Q ATT for the attributes common to TUBD and CMPD.
Calls D3QCMA, D3RREA, D3RRA, D3RWOR, D3XLEN, D3EMSG, D3ERST
Called by D3QCMP D3QTUB
Arguments: as defined in D3QCMP, D3QTUB
SUBROUTINE D3QCON ( ID3DIS, TYPE, NAME, OWNE, LOCK, APPL, FORC,
MOME, DISP, ROTN, DLIM, RLIM, FLIM, MLIM, DFLF, RFLF, FCOE, CPUL,
CPUT, ID3ERR )
INTEGER
ID3DIS, ID3ERR
LOGICAL
LOCK
CHARACTER*(*)
REAL
REAL
REAL
Display flag
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
APPL
Application
FORC
Force
MOME
Moment
DISP
Displacement
ROTN
Rotation
DLIM
Displacement limits
RLIM
Rotation limits
FLIM
Force limits
D:20
12.0
MLIM
Moment limits
RFLF
FCOE
CPUT
DFLF
Friction coefficient
CPUL
Cold pull
Cold twist
ID3ERR
Error code
INTEGER
INTEGER
MAXR, OUTR
LOGICAL
LOCK
CHARACTER*(*)
CHARACTER*(*)
Display flag
MAXE
MAXR
TYPE
Type
NAME
Name
OWNE
Owner name/ref
LOCK
Lock flag
UKEY
UDA key
UDNA
ABLE
UTYP
UDA type
ULEN
DFLT
RPTX
REPORTER text
DESC
Description
UUNI
UNITs
ELEL
Element list
REFL
Reference list
OUTE
OUTR
ID3ERR
Error code
CHARACTER*(*)
CD3STR
D:21
12.0
Returns significant length of string. That is, length after removing trailing blanks. Returns
length of 1 for a blank string, ' '.
Identical to DARs routine D3ULEN, except for treatment of blank string.
For use in the construction STRING(:D3XLEN(STRING)) to avoid run-time error with some
compilers when using D3ULEN and a blank string.
Calls D3ULEN
Called by most other auxiliary routines.
CD3STR
Character string
D3XLEN
D:22
12.0
D3RNAM:
D3RTEX:
D3RPTX:
D3RPAT:
'&~'
FECS-OUT sequence :
'&'
These sequences were carefully selected and meet the following criteria:
It is possible to freely mix single-byte and multi-byte text in any text string. For example, the
text string 'abc&~4A;z & def' is interpreted as follows:
3 characters abc
2 byte pairs corresponding to '4A' and ';z' (meaning 'kanji')
4 characters ' def'
Genuine occurrences of '&~' are denoted by '&&~'; so that 'abc&&~&~4A;z & def' is
interpreted as:
5 characters 'abc&~'
E:1
12.0
PROGRAM FECSRD
C
C
EXTERNAL FECS
CHARACTER*50 STRING, FECS, STRIN2
C
100
CONTINUE
READ(*,'(A)') STRING
IF (STRING .EQ. ' ') GOTO 999
STRIN2 = FECS(STRING)
PRINT*, STRIN2
GOTO 100
999
CONTINUE
CALL EXIT
END
CHARACTER*(*) FUNCTION FECS(STRING)
(machine-specific in parts)
E:2
12.0
CHARACTER*(*) STRING
C
INTEGER IPOS, OPOS, ILEN, OLEN, IPAIR, IPOSM1,
IPOSP1
LOGICAL LFECS
C
CONTINUE
Consider first (next) character
IPOS = IPOS + 1
IF (IPOS .GT. ILEN) GOTO 999
E:3
12.0
IPAIR = 0
ENDIF
ENDIF
IF (LFECS) THEN
C
FECS-OUT found
LFECS = .FALSE.
IPOS = IPOS + 2
IF (IPOS .GT. ILEN) GOTO 999
ENDIF
ENDIF
Convert to ASCII,
convert back
add
128
to
ASCII
FECS(OPOS:OPOS)
CHAR(ICHAR(STRING(IPOS:IPOS)) + 128)
value,
=
ELSE
FECS(OPOS:OPOS) = STRING(IPOS:IPOS)
ENDIF
C
C
999
CONTINUE
E:4
12.0
RETURN
END
The following is a DARs example, reading FECs names and text from a FECs project.
Character function FECS is the same as that listed above.
C------------------PROGRAM FECDAR
C-------------------
CHARACTER*50
CHARACTER*120
TEXT
CHARACTER*1
CDUM
Optional declarations
INTEGER
IERR, IPOS
EXTERNAL
D3INIT, D3ERST,
D3RTEX, D3RNAM
D3MMDB,
D3MNAM,
EXTERNAL
D3EMSG, D3MNUM,
FECS, FECST
D3FIN,
D3FEND,
Project entry
CALL D3INIT( 'FEC', 'SYSTEM', 'XXXXXX', 'NONE', '
', IERR )
IF (IERR.NE.0) GOTO 9000
MDB Selection
CALL D3MMDB ( 'DES/|}~', ' ', IERR )
IF ( IERR .NE. 0 ) GOTO 9000
Go to zone
CALL D3MNAM('/ZONE1.EQUIP', IERR)
IF ( IERR .NE. 0 ) GOTO 9000
E:5
12.0
CONTINUE
IPOS = IPOS + 1
CALL D3MNUM('EQUIP', IPOS, IERR)
IF ( IERR .EQ. 203) THEN
CALL D3ERST
GOTO 200
ELSEIF ( IERR .NE. 0 ) THEN
GOTO 9000
ENDIF
CALL D3RNAM('NAME', NAME, IERR )
IF ( IERR .NE. 0 ) GOTO 9000
', CNAME
CONTINUE
C
C
E:6
12.0
C
C
Exit
9000
CONTINUE
IF (IERR .NE. 0) CALL D3EMSG(IERR, .TRUE., CDUM)
CALL D3FIN( IERR )
CALL D3FEND
END
C--------------------------SUBROUTINE FECST(NAME)
C--------------------------C
Subroutine
to
read,
translate
(possible) FECs attribute
and
C
CHARACTER*(*)
NAME
CHARACTER*12
CHARACTER*1
CDUM
INTEGER
D3ULEN, IERR
E:7
12.0
EXTERNAL
C
D3ULEN,
D3RTEX
FECS,
D3EMSG,
D3ERST,
RETURN
END
The output from the above program appears as follows. Since Aveva has no Kanji printer,
Kanji text in this example is indicated by '@' characters.
E:8
12.0
E:9
12.0
E:10
12.0
C/C++ Library
F.1
F.2
F.3
F.4
F:1
12.0
F.5
@echo off
Rem NT .bat file to compile and link a PDMS DARs application C
program.
Rem Argument[1] is the file to be compiled.
if not "%1"=="" goto GOTFILE
echo compload - no filename specified.
goto FINISH
:GOTFILE
Rem Compile and link
cl -Tc%1 -I%PDMSEXE%\dars %PDMSEXE%\dars\d3lib.lib
:FINISH
cxxcompload.bat
@echo off
Rem NT .bat file to compile and link a PDMS DARs application
C++ program.
Rem Argument[1] is the file to be compiled.
if not "%1"=="" goto GOTFILE
echo compload - no filename specified.
goto FINISH
:GOTFILE
Rem Compile and link
cl -Tp%1 -I%PDMSEXE%\dars %PDMSEXE%\dars\d3lib.lib
:FINISH
F.6
d3libc.h is the header file that defines the DARs routine 'C'
F:2
12.0
prototypes.
**
d3libc.h
**
**
**
**
**
**
Notes:
**
1.
**
**/
#ifndef D3LIBC_H
#define D3LIBC_H
/*
** DAR interface function/subroutine prototypes
*/
#ifdef __cplusplus
( char *cd3err ) ;
( void ) ;
( void ) ;
( int *id3err ) ;
F:3
12.0
( int *id3err ) ;
( int *id3err ) ;
( int *id3err ) ;
F:4
12.0
( int *id3uni ) ;
/*
** cd3bef and cd3aft MUST be declared same length as cd3str
*/
F:5
12.0
/*
** cd3bef and cd3aft MUST be declared same length as cd3str
*/
extern "C" int d3uctr
( int *id3uni ) ;
( int *ready ) ;
( char *cd3str ) ;
( char *cd3mon ) ;
void d3echk
( char *cd3err ) ;
void d3emsg
void d3erst
( void ) ;
void d3fend
( void ) ;
void d3fin
( int *id3err ) ;
void d3init
void d3mcdb
void d3mddb
void d3medb
void d3mmdb
F:6
12.0
void d3mnam
void d3mnum
void d3mown
( int *id3err ) ;
void d3mqdb
void d3mrel
void d3mrst
( int *id3err ) ;
void d3msav
( int *id3err ) ;
void d3rbdu
void d3rbox
void d3rdat
void d3ria
void d3rint
void d3rla
void d3rlog
void d3rnam
void d3rorl
void d3rpat
void d3rprj
void d3rprl
F:7
12.0
void d3rptx
void d3rra
void d3rrea
void d3rref
void d3rrfa
void d3rtex
void d3rtyp
void d3ruda
void d3runi
void d3rwa
void d3rwor
int d3uclu
( int *id3uni ) ;
/*
** cd3bef and cd3aft MUST be declared same length as cd3str
*/
int d3ucti
/*
** cd3bef and cd3aft MUST be declared same length as cd3str
*/
int d3uctr
F:8
12.0
void d3udeh
void d3udtm
int d3ugtu
( int *id3uni ) ;
void d3uini
( int *ready ) ;
int d3ulds
int d3ulen
( char *cd3str ) ;
void d3umon
( char *cd3mon ) ;
#endif /* __cplusplus */
#endif
pdms.h:
pdms.h is the header file that defines constants and variable types used and recommended
for use in Application programs.
/*
**
pdms.h
**
**
**
**
Notes:
**
**
**
**
*/
#ifndef PDMSH
#define PDMSH
F:9
12.0
/* Some constants */
#define
TRUE
#define
FALSE
#define
PDMSNAMELEN
#define
PDMSUDNANAMELEN
#define
PDMSWORDLEN
#define
PDMSTEXTLEN
1000
#define
PDMSRPTXTEXTLEN
20
#define
PDMSUUNITEXTLEN
20
#define
DARSMESSTEXTLEN
50
#define
DARSRDATTEXTLEN
20
#define
DARSCERRTEXTLEN
#define
PDMSDBNAMELEN
64
typedef
char
PDMSNAME
[ PDMSNAMELEN + 1 ] ;
typedef
char
PDMSWORD
[ PDMSWORDLEN + 1 ] ;
typedef
char
PDMSTEXT
[ PDMSTEXTLEN + 1 ] ;
typedef
char
PDMSRPTX
[ PDMSRPTXTEXTLEN + 1 ] ;
typedef
char
PDMSUDNA
[ PDMSUDNANAMELEN + 1 ] ;
typedef
char
PDMSUUNI
[ PDMSUUNITEXTLEN + 1 ] ;
typedef
char
DARSMESS
[ DARSMESSTEXTLEN + 1 ] ;
typedef
char
DARSRDAT
[ DARSRDATTEXTLEN + 1 ] ;
typedef
char
DARSCERR
[ DARSCERRTEXTLEN + 1 ] ;
typedef
char
PDMSDBNAME
[ PDMSDBNAMELEN + 1 ] ;
typedef
int
LOGICAL ;
0
50
13
#endif
F.7
F:10
12.0
#include <string.h>
#include "d3libc.h"
void main (int argc, char **argv)
{
/*
** Main c test program
*/
#define
PARAM_ARRAY_LEN
100
PDMS_NAME
spcref, catref ;
PDMS_WORD
cd3wor, words [ PARAM_ARRAY_LEN ] ;
LOGICAL
lval ;
DARS_MESS
cd3msg ;
PDMS_TEXT
cd3tex, cd3bef, cd3aft ;
DARS_CERR
cd3err ;
DARS_RDAT
cd3dat ;
float
params [ PARAM_ARRAY_LEN ] ;
int
id3err, id3nou, i, ival, ilen, id3dat[ 6 ], iparam ;
/* Project entry */
d3init ( "DAR", "SYSTEM", "XXXXXX", "FULL", " ", &id3err ) ;
if ( id3err != 0 ) goto finish ;
/* Get project details */
/* Use fprintf to check that writing to stdout works */
d3umon ( "NONE" ) ;
d3rprj ( "code", cd3tex, &id3err ) ;
fprintf ( stdout, "Project Code: %s\n", cd3tex ) ;
d3rprj ( "name", cd3tex, &id3err ) ;
fprintf ( stdout, "Project Name: %s\n", cd3tex ) ;
d3rprj ( "numb", cd3tex, &id3err ) ;
fprintf ( stdout, "Project Number: %s\n", cd3tex ) ;
d3rprj ( "mess", cd3tex, &id3err ) ;
fprintf ( stdout, "Project Message: %s\n", cd3tex ) ;
/* Return string length */
ilen = d3ulen ( cd3tex ) ;
printf ( "Length of %s -> %d\n", cd3tex, ilen ) ;
/* Get date */
d3udtm ( id3dat, cd3dat ) ;
printf ( "Date is: %s
or...", cd3dat ) ;
for ( i = 0; i < 6; i++ ) printf ( " %d", id3dat[ i ] ) ;
printf ( "\n" ) ;
/* Extract integer */
strcpy ( cd3tex, "abcd12345XYZ" ) ;
lval = d3ucti ( cd3tex, &ival, cd3bef, cd3aft, cd3err ) ;
if ( lval != 0 )
{
printf ( "For string: %s\n", cd3tex ) ;
printf ( "Returned integer %d\n", ival ) ;
}
else
{
printf ( "For string: %s", cd3tex ) ;
printf ( ", returned error %s\n", cd3err ) ;
if ( !strcmp ( cd3err, "ADD" ) )
{
printf ( "Returned integer %d\n", ival ) ;
F:11
12.0
/*
/*
/*
/*
/*
/*
/*
}
}
strcpy ( cd3tex, "abcdXYZ" ) ;
lval = d3ucti ( cd3tex, &ival, cd3bef, cd3aft, cd3err ) ;
if ( lval != 0 )
{
printf ( "For string: %s\n", cd3tex ) ;
printf ( "Returned integer %d\n", ival ) ;
}
else
{
printf ( "For string: %s", cd3tex ) ;
printf ( ", returned error %s\n", cd3err ) ;
if ( !strcmp ( cd3err, "ADD" ) )
{
printf ( "Returned integer %d\n", ival ) ;
printf ( "String before: %s\n", cd3bef ) ;
printf ( "String after: %s\n", cd3aft ) ;
}
}
Select MDB */
d3umon ( "FULL" ) ;
d3mmdb ( "DESIGN/PLANT", " ", &id3err ) ;
if ( id3err != 0 ) goto finish ;
Get datestamp */
d3rdat ( id3dat, cd3dat, &id3err ) ;
printf ( "Datestamp is: %s\nor...", cd3dat ) ;
for ( i = 0; i < 6; i++ ) printf ( " %d", id3dat[ i ] ) ;
printf ( "\n" ) ;
Move to a pipe component */
d3mnam ( "/100-B-1", &id3err ) ;
ival = 1 ;
d3mnum ( "BRAN", &ival, &id3err ) ;
d3mrel ( "LAST", "FLAN", &id3err ) ;
Get spec ref and goto it */
d3rnam ( "SPRE", spcref, &id3err ) ;
printf ( "spcref is: %s\n", spcref ) ;
d3mnam ( spcref, &id3err ) ;
Get cat ref and goto it */
d3rnam ( "CATR", catref, &id3err ) ;
d3mnam ( catref, &id3err ) ;
Get parameters of component and dehash conn types */
Cancel monitor and construct own PRINT statements */
d3umon ( "NONE" ) ;
puts ( "Getting elements with D3RRA" ) ;
ival = PARAM_ARRAY_LEN ;
d3rra ( "PARA", &ival, params, &id3nou, &id3err ) ;
printf ( "Number of elements found: %d\n", id3nou ) ;
for ( i = 0; i < id3nou; i++ )
{
strcpy ( cd3wor, "\0" ) ;
/* If possibly a word, dehash */
F:12
12.0
The expected output from this program is as follows. There may some differences in the
precision and format of variables. Some of the output is printed by the FORTRAN DARs
interface (with monitoring) and some is printed by the 'C' program.
AVEVA DARs C Interface Mk12.000 (WINDOWS-NT 5.2) (7 Sep 2007 : 23:36)
This version of PDMS was issued to <your company>
and will only operate on registered hardware
PDMS DARs Mk12.0.0.0 (WINDOWS-NT 5.2) (7 Sep 2007 : 23:36)
(c) Copyright 1974 to 2007 AVEVA Solutions Limited
Issued to <your company>
Entering subroutine D3INIT
Input arguments:
Project name
Username
Password
Monitoring level
DAR
SYSTEM
XXXXXX
FULL
F:13
12.0
Read/Write key
Exiting subroutine D3INIT
Output arguments:
Error code
0
Entering subroutine D3UMON
Input arguments:
Monitoring level
NONE
Exiting subroutine D3UMON
Entering subroutine D3MMDB
Input arguments:
MDB name
DESIGN/PLANT
Read/Write key
Exiting subroutine D3MMDB
Output arguments:
Error code
0
Entering subroutine D3RDAT
Exiting subroutine D3RDAT
Output arguments:
Date-stamp
04 Jul 2000 17:56:24
Year, Month, Day
2000 7 4
Hour, Minute, Second 17 56 24
Error code
0
Entering subroutine D3MNAM
Input arguments:
Element name/ref
/100-B-1
Exiting subroutine D3MNAM
Output arguments:
Error code
0
Entering subroutine D3MNUM
Input arguments:
Element type
BRAN
List position
1
Exiting subroutine D3MNUM
Output arguments:
Error code
0
Entering subroutine D3MREL
Input arguments:
Relative position
LAST
Element type
FLAN
Exiting subroutine D3MREL
Output arguments:
Error code
0
Entering subroutine D3RNAM
F:14
12.0
Input arguments:
Attribute required
SPRE
Exiting subroutine D3RNAM
Output arguments:
Name/Reference
/A3B/100F1
Error code
0
Entering subroutine D3MNAM
Input arguments:
Element name/ref
/A3B/100F1
Exiting subroutine D3MNAM
Output arguments:
Error code
0
Entering subroutine D3RNAM
Input arguments:
Attribute required
CATR
Exiting subroutine D3RNAM
Output arguments:
Name/Reference
/FUAAPAMM
Error code
0
Entering subroutine D3MNAM
Input arguments:
Element name/ref
/FUAAPAMM
Exiting subroutine D3MNAM
Output arguments:
Error code
0
Entering subroutine D3UMON
Input arguments:
Monitoring level
NONE
F.8
F:15
12.0
of these functions: the programmer doesn't have to remember which arguments are passed
by address and which are passed by value.
One of the effects of 'C/C++' string behaviour is that the DARs error code 5 (character string
output argument too short) cannot be returned if a DARs routine is called from a 'C/C++'
program. If the supplied string is too short, the returned string will overrun the declared
string and may corrupt other variables (or it may have no noticeable effect).
As an example, the cd3tex argument of d3rprj is defined as PDMS_TEXT. The interface
defines PDMS_TEXT_LEN as 120. The 'C/C++' program should therefore declare this
argument as PDMS_TEXT cd3tex. If instead it is defined, say, as char cd3tex[2], corruption
may occur. No problem would occur if the string is declared to be longer than necessary.
In the case of d3ucti and d3uctr, the two return arguments cd3bef and cd3aft must be
declared at least as long as the significant length of the input argument cd3str.
F:16
12.0
Index
A
Acceptance Test Program . . . . . . . A:4, F:1
Application Program Compilation . . A:3, F:1
Application Program Linking . . . . . . A:3, F:1
Application Programs
re-linking . . . . . . . . . . . . . . . . . . . . . . A:5
Auxiliary Subroutine Library . . . . . . . . . .D:1
F
File Handling . . . . . . . . . . . . . . . . . . . . . A:2
FORTRAN 77 . . . . . . . . . . . . . . . . . . . . . 2:1
D
DARs Library Details . . . . . . . . . . . . . . . . A:1
Data Access Routines
examples of use . . . . . . . . . . . . . . . . 4:1
Databases and DARs
Compatibility . . . . . . . . . . . . . . . . . . . 6:1
Declarations . . . . . . . . . . . . . . . . . . . . . . 2:1
Detailed Subroutine Specifications . . . . . 5:5
Dynamic Array Attributes . . . . . . . . . . . . 3:1
E
Error Codes . . . . . . . . . . . . . . . . . . . . . . .C:1
Error Handling . . . . . . . . . . . . . . . . . . . . . 2:3
I
Initialisation Routines . . . . . . . . . . . . . . . 5:1
M
Monitoring . . . . . . . . . . . . . . . . . . . . . . .
Multibyte Text . . . . . . . . . . . . . . . . . . . . .
Multibyte Text Handling . . . . . . . . . . . . .
Chinese characters . . . . . . . . . . . . .
Kanji characters . . . . . . . . . . . . . . . .
3:2
3:2
E:1
E:1
E:1
N
Navigation Routines . . . . . . . . . . . . . . . . 5:1
P
PDMS Data Access . . . . . . . . . . . . . . . .
PDMS Database Organisation . . . . . . . .
PDMS Database Security . . . . . . . . . . .
Program Debugging . . . . . . . . . . . . A:4,
Program Running . . . . . . . . . . . . . . A:4,
Index page 1
3:1
3:1
3:1
F:1
F:1
12.0
R
Read Routines . . . . . . . . . . . . . . . . . . . . 5:2
Running Examples . . . . . . . . . . . . . . . . . B:1
S
Site File . . . . . . . . . . . . . . . . . . . . . . . . . . 3:2
Software Issued with DARs . . . . . . . . . . A:1
Subroutine Outline Specifications . . . . . .D:3
Subroutine Specifications . . . . . . . . . . . . 5:1
Change Monitor Level . . . . . . . . . . 5:63
Character to Integer . . . . . . . . . . . . 5:54
Character to Real Number . . . . . . . 5:56
Clear File Unit . . . . . . . . . . . . . . . . . 5:53
Defer a Database in MDB . . . . . . . 5:12
Dehash a Hashed PDMS Word . . . 5:57
Exchange Databases in MDB . . . . 5:13
Exit System . . . . . . . . . . . . . . . . . . . 5:7
Finish . . . . . . . . . . . . . . . . . . . . . . . . 5:8
Get File Unit . . . . . . . . . . . . . . . . . . 5:59
Initialise . . . . . . . . . . . . . . . . . . . . . . 5:9
Length of Character String . . . . . . . 5:62
Make a Database Current in MDB . 5:11
Move Relative to the Current Position 5:20
Move to an Element by Name . . . . 5:16
Move to Element by Order Position 5:17
Move to Owner of Current Element 5:18
Query database in Current MDB . . 5:18
Query Initialisation . . . . . . . . . . . . . 5:60
Read a Logical Array Attribute . . . . 5:29
Read a Logical Attribute . . . . . . . . . 5:30
Read a Project Data Item . . . . . . . . 5:36
Read a Real Array Attribute . . . . . . 5:40
Read a Real Attribute . . . . . . . . . . . 5:41
Read a Reference Number Array Attribute
5:43
Read a Text Attribute . . . . . . . . . . . 5:45
Read a Type Attribute . . . . . . . . . . 5:47
Read a Word Array Attribute . . . . . 5:50
Read a Word Attribute . . . . . . . . . . 5:52
Read an Integer Array Attribute . . . 5:26
Read an Integer Attribute . . . . . . . . 5:28
Read Bore and Distance Units . . . . 5:22
Read Current System Date and Time 5:58
Read Element Name or a Name Attribute
5:31
Read Element RefNo or a Reference Attribute . . . . . . . . . . . . . . . . 5:42
Read Enclosing Box Co-ordinates . 5:23
Read Latest MDB Date-Stamp . . . . 5:24
Read Lists of UDA Names, Abbreviations
T
Termination Routines . . . . . . . . . . . . . . . 5:5
U
User-Defined Attributes . . . . . . . . . . . . . 3:1
Utility Routines . . . . . . . . . . . . . . . . . . . . 5:4
V
Version Control . . . . . . . . . . . . . . . . . . . 6:1
Version Number Determination . . . . . . . 6:1
Version Numbering of DARs . . . . . . . . . 6:1
Index page 2
12.0