Data Access Routines User Guide
Data Access Routines 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
12.0
Running Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .B:1 Error Codes and Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .C:1 Auxiliary Subroutine Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .D:1
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D:1 List of Subroutines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . D:2
ii
12.0
iii
12.0
iv
12.0
1
1.1
Introduction
Scope of Data Access Routines
The PDMS Data Access Routines are a set of FORTRAN 77 subroutines which may be incorporated into user-written software for the purposes of navigating and manipulating the data held within a PDMS project. The anticipated use of this facility will be the creation of interfaces to other software packages, e.g. material take-off, pipe stress, isometrics, etc. The data access routines provide the tools necessary for the user to extract attribute values from the PDMS model. This takes the form of a subroutine library which can be divided into the following functions: 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
2
2.1
Programming Techniques
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: Title: Programming in Standard Fortran 77 Authors: A. Balfour and D.H. Marwick Publisher: Heinemann Educational Books, 1982 Hardback: ISBN 0 435 77485 9 Paperback: ISBN 0 435 77486 7
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 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(*) CD3XYZ
CHARACTER*(*)
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:
The EXTERNAL declarations are optional. Some programmers adopt a rigid practice of declaring all variables and external functions and subroutines. Such a practice, whilst irksome to some, eliminates misspelling of variables within a program and prevents accidental omission of non-default declarations (e.g. INTEGER D3ULEN) which are difficult to identify in a 'misbehaving' program. Some compilers provide an option that forces the programmer to declare all variables and externals. If DARs programmers adopt the practice, it will help to reduce Aveva's support load. In this manual, including the example listed above, all coding examples include full declarations.
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 = 'ABC' CD3XYZ
will result in a character string 'ABC '; that is 'ABC' followed by seven blanks. This is true even if CD3XYZ previously contained more than three non-blank characters. Whilst the string 'ABC will not be. ' is interpreted the same as 'ABC', the string ' ABC'
2:2
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
CHARACTER*10 CD3XYZ
or
would print
ABC returned
rather than
ABC
returned
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
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
C C
Reset internal error flag if No Members or List Exhausted Return zero ID3ERR value IF ( ID3ERR .NE. 202 .AND. ID3ERR .NE. 203 ) GOTO 12345 CALL D3ERST ID3ERR = 0 GOTO 100 ENDIF
2:4
12.0
Check if reached end of User's arrays IF ( NMEMB .EQ. ID3NIN ) GOTO 100
Move to next member of current list CALL D3MREL( 'NEXT', 'ELEM', ID3ERR ) GOTO 20
C 100 . . 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
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
4.1
4.2
Example 1
The FORTRAN 77 code for the application program is as follows:
PROGRAM EXMPL1 C C Application main program Essential type declarations CHARACTER*50 C SPCREF, CATREF
Can declare CD3MSG CHAR*1 if not using it CHARACTER*1 CHARACTER*6 CD3MSG CD3WOR, WORDS(100)
4:1
12.0
EXTERNAL D3INIT, D3MMDB, D3MNAM, D3MNUM, D3MREL, D3RNAM EXTERNAL D3RRA, D3UMON, D3UDEH C D3RWA, D3EMSG, D3FIN, D3FEND,
C C Project entry CALL D3INIT( 'DAR', 'SYSTEM', 'XXXXXX', 'FULL', ' ', ID3ERR ) IF ( ID3ERR .NE. 0 ) GOTO 12345 C Select MDB CALL D3MMDB( 'DESIGN/PLANT', ' ', ID3ERR ) IF ( ID3ERR .NE. 0 ) GOTO 12345 C Move to a pipe component CALL D3MNAM( '/100-B-1', ID3ERR ) CALL D3MNUM( 'BRAN', 1, ID3ERR ) CALL D3MREL( 'LAST', 'FLAN', ID3ERR ) C Get spec ref and goto it CALL D3RNAM( 'SPRE', SPCREF, ID3ERR ) CALL D3MNAM( SPCREF, ID3ERR ) C Get cat ref and goto it CALL D3RNAM( 'CATR', CATREF, ID3ERR ) CALL D3MNAM( CATREF, ID3ERR ) C C Get parameters of component and dehash conn types Cancel monitor and construct own PRINT statements CALL D3UMON('NONE') PRINT*,'Getting elements with D3RRA' CALL D3RRA( 'PARA', 100, PARAMS, ID3NOU, ID3ERR ) PRINT*,'Number of elements found:',ID3NOU
4:2
12.0
DO 100 I=1, ID3NOU CD3WOR = ' ' C If possibly a word, dehash IF ( PARAMS(I) .GE. 531442. ) THEN CALL D3UDEH( INT(PARAMS(I)), CD3WOR ) ENDIF IF (CD3WOR.EQ.' ') THEN C Not a word; print real value PRINT*,'Element', I, PARAMS(I) ELSE C Valid word; print word PRINT*,'Element', I, ' ENDIF 100 C CONTINUE Alternatively, use D3RWA directly (non-words don't give error) PRINT*,'Getting elements with D3RWA' CALL D3RWA( 'WPAR', 100, WORDS, ID3NOU, ID3ERR ) DO 200 I=1, ID3NOU IF (WORDS(I).NE.' ') PRINT*, 'Element', I, ' ', WORDS(I) 200 C 12345 C CONTINUE Cancel monitor and output message CALL D3UMON('NONE') CALL D3EMSG( ID3ERR, .TRUE., CD3MSG ) C Exit project CALL D3FIN( ID3ERR ) C Exit DARs CONTINUE ', CD3WOR
4:3
12.0
<site data>
Entering subroutine D3INIT Input arguments: Project name Username Password Monitoring level Read/Write key Exiting subroutine D3INIT Output arguments: Error code Project not found Project not found
The first 'Project not found' message arises from monitor output from D3INIT. The second message is output by D3EMSG. With monitor set to 'NONE', the output is as follows:
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>
Entering subroutine D3INIT Input arguments: Project name Username Password Monitoring level Read/Write key Exiting subroutine D3INIT Output arguments: Error code 0 DAR SYSTEM XXXXXX FULL
Entering subroutine D3MMDB Input arguments: MDB name Read/Write key DESIGN/PLANT
Opening databases Mode ---Read Read Type ---DESI DESI Name ---STRUC/S
4:5
12.0
Read Read
DESI DICT
PIPE/DR PIPE/DR
Default database type: DESI Exiting subroutine D3MMDB Output arguments: Error code Entering subroutine D3MNAM Input arguments: Element name/ref Exiting subroutine D3MNAM Output arguments: Error code Entering subroutine D3MNUM Input arguments: Element type List position Exiting subroutine D3MNUM Output arguments: Error code Entering subroutine D3MREL Input arguments: Relative position Element type Exiting subroutine D3MREL Output arguments: Error code Entering subroutine D3RNAM Input arguments: Attribute required SPRE 0 LAST FLAN 0 BRAN 1 0 /100-B-1 0
4:6
12.0
Exiting subroutine D3RNAM Output arguments: Name/Reference Error code Entering subroutine D3MNAM Input arguments: Element name/ref Exiting subroutine D3MNAM Output arguments: Error code Entering subroutine D3RNAM Input arguments: Attribute required Exiting subroutine D3RNAM Output arguments: Name/Reference Error code Entering subroutine D3MNAM Input arguments: Element name/ref Exiting subroutine D3MNAM Output arguments: Error code Entering subroutine D3UMON Input arguments: Monitoring level Getting elements with D3RRA Number of elements found: Element Element 1 2 100.0000 254.0000 NONE 0 /FUAAPAMM /FUAAPAMM 0 CATR 0 /A3B/100F1 /A3B/100F1 0
4:7
12.0
3 4 5 6 7 8
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:
Optional declarations INTEGER EXTERNAL IFINDM PROJIN, MDBIN, DECCHK, D3FIN, D3FEND
IFINDM = 0 C Project entry IF ( .NOT. PROJIN() ) GOTO 12345 C MDB selection IF ( .NOT. MDBIN() ) GOTO 12345 C Design db test CALL DECCHK
4:8
12.0
Exit
PRINT*, 'Enter project' CALL D3INIT( 'DAR', 'SYSTEM', 'XXXXXX', 'NONE', ' ', IERR PROJIN = IERR.EQ.0 CALL D3EMSG( IERR, .TRUE., TEXT ) RETURN END
4:9
12.0
CALL D3MMDB( '/PLANT', ' ', IERR ) MDBIN = IERR.EQ.0 CALL D3EMSG( IERR, .TRUE., TEXT ) RETURN END
C---------------------SUBROUTINE DECCHK C---------------------CHARACTER*50 CHARACTER*6 LOGICAL LOGICAL CHARACTER*50 CHARACTER*50 CHARACTER*50 CHARACTER*120 INTEGER INTEGER INTEGER REAL REAL C TEXT, NAMES(100) TYPES(100), LNTP TYPE, HCON, TCON, FLOW,
LOCK, BUIL, LHEA, LTAI, DETA, SHOP, LSTR ORIL, POSI, LOFF NAME, OWNE, MATR FLUR, CASR, PSPE, ISPE, TSPE HSTU, HREF, TREF, SPRE, CATR, LSTU, CREF DUTY, DSCO, PTSP, INSC, FUNC REV , EREC, CCEN, CCLA, SAFC LEVE(2), OBST, ARRI D3XLEN HPOS(3), POS(9) HDIR(3), TPOS(3), TDIR(3),
ORI(3), ANGL
Optional declarations INTEGER REAL REAL EXTERNAL ISIZ, IERR, LEAV, IDISP XLEN, YLEN, ZLEN, HEIG, RADI BORE, HBOR, TBOR, TEMP, PRES D3MNAM, D3MNUM, D3MREL, D3RORL D3UMON, D3RPAT,
4:10
12.0
D3RPRL, D3EMSG D3QMEM, D3QSIT, D3QPIP, D3QBRA D3QTEE, D3QELB, D3QNOZ, D3MMDB D3XLEN, D3QEQU, D3QZON, D3QBOX,
PRINT*, ' ' PRINT*, 'Design Database Example' PRINT*, '-----------------------' PRINT*, ' ' IDISP 2 =
PRINT*, 'Select default db type' CALL D3MMDB( 'DESIGN/PLANT', ' ', IERR ) IF ( IERR .NE. 0 ) THEN PRINT*, 'Should have succeeded' PRINT*, 'Instead error is:' GOTO 12345 ENDIF C 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
IF ( IERR .NE. 0 ) GOTO 12345 PRINT*, ' ' IF ( NAME .NE. '/EQU' ) THEN PRINT*, 'Expecting name /EQU got ', NAME(:D3XLEN(NAME)) GOTO 12345 ENDIF C 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, + ISPE, TSPE, IERR )
IF ( IERR .NE. 0 ) GOTO 12345 PRINT*, ' ' IF ( NAME .NE. '/EQ3' ) THEN PRINT*, 'Expecting NAME(:D3XLEN(NAME)) 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, + BORE, TEMP, PRES, PSPE, ISPE, TSPE, MATR, name /EQU got ',
4:12
12.0
+ +
FLUR, CASR, CCEN, CCLA, DUTY, LNTP, EREC, REV, DSCO, PTSP, INSC, SAFC, IERR )
IF ( IERR .NE. 0 ) GOTO 12345 PRINT*, ' ' IF ( NAME .NE. '/250-B-5' ) THEN PRINT*,'Expecting name NAME(:D3XLEN(NAME)) 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, + + + + + LTAI, DETA, SHOP, LSTR, LNTP, EREC, HBOR, TBOR, HCON, TCON, TEMP, PRES, FLOW, MATR, FLUR, CASR, PSPE, ISPE, TSPE, CCEN, CCLA, DUTY, DSCO, PTSP, INSC, SAFC, HSTU, HREF, TREF, HPOS, HDIR, TPOS, TDIR, IERR ) /250-B-5 got ',
IF ( IERR .NE. 0 ) GOTO 12345 IF ( NAME .NE. '/250-B-5/1' ) THEN PRINT*,'Expecting name ',NAME(:D3XLEN(NAME)) GOTO 12345 ENDIF C Branch PPoints with Monitoring CALL D3UMON( 'FULL' ) CALL D3RPAT( 'PH', '/EQ3', POS(1), POS(4), BORE, HCON, IERR ) /250-B-5/1 got
4:13
12.0
IF ( IERR .NE. 0 ) GOTO 12345 CALL D3RPAT('ptail','worl',POS(1), POS(4), BORE, HCON, IERR ) IF ( IERR .NE. 0 ) GOTO 12345 CALL D3UMON( 'NONE' ) C Tee details CALL D3MREL( 'FIRS', 'TEE', IERR ) IF ( IERR .NE. 0 ) GOTO 12345 CALL D3QTEE( IDISP, TYPE, NAME, OWNE, LOCK, POS , ORI , + + + SPRE, LSTU, CREF, ARRI, LEAV, ANGL, HEIG, RADI, BUIL, SHOP, ORIL, POSI, LOFF, ISPE, TSPE, IERR )
IF ( IERR .NE. 0 ) GOTO 12345 PRINT*, ' ' C Elbow details CALL D3MREL( 'PREV', 'ELBOW', IERR ) IF ( IERR .NE. 0 ) GOTO 12345 CALL D3QELB( IDISP, TYPE, NAME, OWNE, LOCK, POS , ORI , + + SPRE, LSTU, CREF, ARRI, LEAV, ANGL, RADI, BUIL, SHOP, ORIL, POSI, ISPE, TSPE, IERR )
IF ( IERR .NE. 0 ) GOTO 12345 PRINT*, ' ' C Elbo PPoints with Monitoring CALL D3UMON( 'FULL' ) CALL D3RPAT( 'P1', 'WORL', POS(1), POS(4), BORE, HCON, IERR ) IF ( IERR .NE. 0 ) GOTO 12345 CALL D3RPAT( 'P2', 'WORL', POS(1), POS(4), BORE, HCON, IERR ) IF ( IERR .NE. 0 ) GOTO 12345 CALL D3UMON( 'NONE' )
4:14
12.0
PRINT*, ' ' C 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, + PTSP, INSC, POS, ORI, ISPE, IERR )
IF ( IERR .NE. 0 ) GOTO 12345 PRINT*, ' ' IF ( NAME .NE. '/1501B' ) THEN PRINT*, ' Expecting NAME(:D3XLEN(NAME)) GOTO 12345 ENDIF C Switch on Monitoring and check Pos and Ori CALL D3UMON( 'FULL' ) CALL D3RORL( 'owne', POS, IERR ) IF ( IERR .NE. 0 ) GOTO 12345 CALL D3RORL( 'WORL', POS, IERR ) IF ( IERR .NE. 0 ) GOTO 12345 CALL D3RPRL( 'ZONE', POS, IERR ) IF ( IERR .NE. 0 ) GOTO 12345 CALL D3RPRL( '/EQU', POS, IERR ) IF ( IERR .NE. 0 ) GOTO 12345 CALL D3UMON( 'NONE' ) PRINT*, ' ' C Box details CALL D3MREL( 'FIRS', 'BOX', IERR ) IF ( IERR .NE. 0 ) GOTO 12345 name /1501B got ',
4:15
12.0
CALL D3QBOX( IDISP, TYPE, NAME, OWNE, LOCK, XLEN, YLEN, + ZLEN, POS, ORI, LEVE, OBST, IERR )
IF ( IERR .NE. 0 ) GOTO 12345 PRINT*, ' ' C Box PPoints with Monitoring CALL D3UMON( 'FULL' ) CALL D3RPAT( 'P1', 'OWNE', POS(1), POS(4), BORE, HCON, IERR ) IF ( IERR .NE. 0 ) GOTO 12345 CALL D3RPAT( 'P2', 'WORL', POS(1), POS(4), BORE, HCON, IERR ) IF ( IERR .NE. 0 ) GOTO 12345 CALL D3UMON( 'NONE' ) PRINT*, ' ' C 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, CATR, ANGL, HEIG, RADI,
ISPE, IERR )
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 default db type Entering D3QMEM Members of WORL 1 2 3 4 5 6 7 8 9 10 SITE SITE SITE SITE SITE SITE SITE SITE SITE GPWL /* /NEGATIVE-SITE /DIMENSION-SITE /VOLCAL.SITE /EX1-SITE /HANG-SITE /CIVIL /INTEST-SITE /EQU /OBSTR /GW1
Exiting D3QMEM
Entering D3QMEM
4:17
12.0
Exiting D3QMEM
Entering D3QSIT Attributes of SITE Entering D3QCMA TYPE NAME OWNE LOCK SITE /EQU /* F /EQU
Exiting D3QCMA POS ORI 0.0000000E+0 0 0.0000000E+0 0 0.0000000E+00 0.0000000E+00 0.0000000E+ 00 0.0000000E+ 00
Exiting D3QSIT
/EQ3 /EQUIP-FALL /FALL /100-B-2 /50-W-3000 /50-WD-2400 /50-W1-3400 /80-S12-1400 /200-N12-1000 /50-N12-1800
4:18
12.0
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
PIPE PIPE PIPE PIPE PIPE PIPE PIPE PIPE PIPE PIPE PIPE PIPE PIPE PIPE PIPE PIPE
/150-W12-2000 /150-W12-2200 /100-C-12 /100-C-13 /150-A-57 /150-A-3 /40-B-10 /80-A-11 /80-B-14 /100-B-1 /80-B-7 /150-B-6 /100-B-8 /50-B-9 /200-B-4 /250-B-5
Exiting D3QMEM
Entering D3QZON Attributes of ZONE /EQ3 Entering D3QCMA TYPE NAME OWNE LOCK ZONE /EQ3 /EQU F
Exiting D3QCMA POS ORI PSPE 0.0000000E+0 0 0.0000000E+0 0 =0/0 0.0000000E+00 0.0000000E+00 100000.0 0.0000000E+ 00
4:19
12.0
ISPE TSPE
=0/0 =0/0
Exiting D3QZON
BRAN BRAN
Exiting D3QMEM
Entering D3QPIP Attributes of PIPE Entering D3QBPA Entering D3QCMA TYPE NAME OWNE LOCK PIPE /250-B-5 /EQ3 F /250-B-5
Exiting D3QCMA BUIL SHOP TEMP PRES PSPE ISPE TSPE MATR FLUR CASR CCEN F F -100000.0 0.0000000E+00 /A3B =0/0 =0/0 =0/0 =0/0 =0/0 0
4:20
12.0
CCLA DUTY LNTP EREC DSCO PTSP INSC SAFC Exiting D3QBPA BORE REV Exiting D3QPIP 0.0000000E+00 Unset Unset Unset Unset Unset
-1
/250-B-5/1 =8196/556 =8196/557 =8196/558 =8196/559 =8196/560 /250-B-5/1-T1 =8196/562 =8196/563 =8196/564 =8196/565 =8196/566
GASK FLAN ELBO ELBO REDU TEE REDU ELBO ELBO FLAN GASK
10 11
Exiting D3QMEM
4:21
12.0
Entering D3QBPA Entering D3QCMA TYPE NAME OWNE LOCK BRAN /250-B-5/1 /250-B-5 F
Exiting D3QCMA BUIL SHOP TEMP PRES PSPE ISPE TSPE MATR FLUR CASR CCEN CCLA DUTY LNTP EREC DSCO PTSP INSC SAFC Exiting D3QBPA LHEA LTAI DETA T T F Unset Unset Unset 0 Unset Unset 0 T T 466.0000 340.0000 /A3B =0/0 =0/0 =0/0 =0/0 =0/0 0 0
4:22
12.0
LSTR HBOR TBOR HCON TCON FLOW HSTU HREF TREF HPOS HDIR TPOS TDIR
F 200.0000 200.0000 FGD FGD Unset /A3B/200P /1301-S2 /1301-S3 -319150.0 0.0000000E+0 0 -319150.0 0.0000000E+0 0 297760.0 0.0000000E+00 302640.0 0.0000000E+00 2105.000 1.000000 2105.000 1.000000
Exiting D3QBRA
Exiting subroutine D3UMON Entering subroutine D3RPAT Input arguments: PPoint number Coordinate system Exiting subroutine D3RPAT Output arguments: Position E -319150 N 297760 N 0 U 1 U 2105 PH /EQ3
Direction unit vector E 0 Bore Connection type Error code Entering subroutine D3RPAT Input arguments: 200 FGD 0
4:23
12.0
PPoint number Coordinate system Exiting subroutine D3RPAT Output arguments: Position E -319150 Direction unit vector Bore Connection type Error code Entering subroutine D3UMON Input arguments: Monitoring level Entering D3QTEE Attributes of TEE Entering D3QCPA Entering D3QCMA TYPE NAME OWNE LOCK TEE /250-B-5/1-T1 /250-B-5/1 F
ptail worl
U 102105 U 1
NONE
/250-B-5/1-T1
Exiting D3QCMA POS ORI SPRE LSTU BUIL SHOP ORIFL POSFL ISPE -318315.3 0.0000000E+0 0 /A3B/250T =0/0 F F T T =0/0 300229.6 0.0000000E+00 3886.000 0.0000000E+ 00
4:24
12.0
TSPE
=0/0
Exiting D3QCPA CREF ANGL HEIG RADI LOFF /250-B-5/2 90.00000 0.0000000E+00 0.0000000E+00 F
Exiting D3QTEE
Entering D3QELB Attributes of ELBO =8196/559 Entering D3QCPA Entering D3QCMA TYPE NAME OWNE LOCK ELBO =8196/559 /250-B-5/1 F
Exiting D3QCMA POS ORI SPRE LSTU BUIL SHOP ORIFL POSFL ISPE TSPE -318315.3 180.0000 /A3B/200EL /A3B/200P F F T T =0/0 =0/0 297759.1 0.0000000E+00 3885.950 90.00000
4:25
12.0
ANGL RADI
90.00000 0.0000000E+00
Exiting D3QELB
Exiting subroutine D3UMON Entering subroutine D3RPAT Input arguments: PPoint number Coordinate system Exiting subroutine D3RPAT Output arguments: Position E -318620 Direction vector Bore Connection type Error code Entering subroutine D3RPAT Input arguments: PPoint number Coordinate system Exiting subroutine D3RPAT Output arguments: Position E -318315 Direction vector Bore Connection type Error code Entering subroutine D3UMON Input arguments: unit N 298064 E 0 200 BWD 0 N 1 U 0 U 103886 P2 WORL unit N 297759 E -1 200 BWD 0 N 0 U 0 U 103886 P1 WORL
4:26
12.0
Monitoring level
NONE
Exiting D3QMEM
Entering D3QEQU Attributes of EQUI Entering D3QCMA TYPE NAME OWNE LOCK EQUI /1501B /EQ2 F /1501B
Exiting D3QCMA FUNC DSCO PTSP INSC POS ORI ISPE Unset Unset Unset Unset -314490.0 0.0000000E+0 0 =0/0 303145.0 0.0000000E+00 340.0000 180.0000
Exiting D3QEQU
4:27
12.0
Exiting subroutine D3UMON Entering subroutine D3RORL Input arguments: Coordinate system Exiting subroutine D3RORL Output arguments: Orientation unit vectors X axis Y axis Z axis Error code Entering subroutine D3RORL Input arguments: Coordinate system Exiting subroutine D3RORL Output arguments: Orientation unit vectors X axis Y axis Z axis Error code Entering subroutine D3RPRL Input arguments: Coordinate system Exiting subroutine D3RPRL Output arguments: Position E -314490 Error code Entering subroutine D3RPRL Input arguments: N 303145 0 U 340 ZONE E -1 E 0 E 0 0 N 0 N -1 N 0 U 0 U 0 U 1 WORL E -1 E 0 E 0 0 N 0 N -1 N 0 U 0 U 0 U 1 owne
4:28
12.0
Coordinate system Exiting subroutine D3RPRL Output arguments: Position E -314490 Error code Entering subroutine D3UMON Input arguments: Monitoring level
/EQU
N 303145 0
U 100645
NONE
Entering D3QBOX Attributes of BOX Entering D3QCMA TYPE NAME OWNE LOCK BOX =8196/151 /1501B F =8196/151
Exiting D3QCMA XLEN YLEN ZLEN POS ORI LEVE OBST 510.0000 1390.000 110.0000 0.0000000E+0 0 0.0000000E+0 0 0 2 -676.0000 0.0000000E+00 10 -285.0000 0.0000000E+ 00
Exiting D3QBOX
4:29
12.0
PPoint number Coordinate system Exiting subroutine D3RPAT Output arguments: Position
P1 OWNE
E 255
N -676 N 0 U 0
U -285
Direction unit vector E 1 Bore Connection type Error code Entering subroutine D3RPAT Input arguments: PPoint number Coordinate system Exiting subroutine D3RPAT Output arguments: Position Direction unit vector Bore Connection type Error code Entering subroutine D3UMON Input arguments: Monitoring level NONE
0
P2 WORL
E -314490 100360 E 0 0 N -1
303126 U 0
Entering D3QNOZ Attributes of NOZZ Entering D3QCMA TYPE NAME OWNE NOZZ /1501B-SUCT /1501B /1501B-SUCT
4:30
12.0
LOCK
Exiting D3QCMA TEMP PRES POS ORI CREF CATR ANGL HEIG RADI DUTY ISPE -100000.0 0.0000000E+0 0 0.0000000E+0 0 0.0000000E+0 0 /100-B-8/1 /NFAAPAMM 90.00000 100.0000 0.0000000E+0 0 Unset =0/0 0.0000000E+00 0.0000000E+00 0.0000000E+ 00 180.0000
Exiting D3QNOZ
Success
4:31
12.0
4:32
12.0
5
5.1
5.1.1
Subroutine Specifications
Subroutine Summaries
Initialisation Routines, D3Ixxx
D3INIT - Initialise This routine initialises the system for the PDMS data access routines and sets the monitoring level. It validates the project name and the username and password nominated in that project, all of which may be entered as routine arguments or interactively. It opens the required database files and records the presence of the user in the PDMS system.
5.1.2
5:1
12.0
D3MNAM - Move to an Element by Name or Reference Number This routine navigates the hierarchy to an element specified by name or reference number. D3MNUM - Move to an Item by Order Position This routine navigates the hierarchy to an element by specified list order position. This mimics PDMS commands such as '1', 'BRAN 3', 'EQUIP 1'. The type of element may be a PDMS noun (e.g. BRANCH) or special keywords to move in the current list or to move to a member owned by the current element. D3MREL - Move Relative to the Current Position This routine navigates the hierarchy relative to the current database position, mimicking PDMS commands such as 'PREV', 'LAST MEMB', 'NEXT BOX'. D3MOWN - Move to the Owner of the Current Element This routine navigates to the owner of the current element. D3MSAV - Save Current Database Position 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. D3MRST - Restore Last Saved Database Position This routine restores the database position saved by the previous call to D3MSAV.
5.1.3
5:2
12.0
D3RREF - Read Element Reference Number or a Reference Number Attribute This routine reads the reference number of the current element or of a reference attribute of the current element. D3RINT - Read an Integer Attribute This routine reads a specified integer attribute of the current element. D3RIA - Read an Integer Array Attribute This routine reads a specified integer array attribute of the current element. D3RREA - Read a Real Attribute This routine reads a specified real attribute of the current element. D3RRA - Read a Real Array Attribute This routine reads a specified real array attribute of the current element. D3RLOG - Read a Logical Attribute This routine reads a specified logical attribute of the current element. D3RLA - Read a Logical Array Attribute This routine reads a specified logical array attribute of the current element. D3RRFA - Read a Reference Number Array Attribute This routine reads a specified reference number array attribute of the current element. D3RTEX - Read a Text Attribute This routine reads a specified text attribute of the current element. D3RWOR - Read a Word Attribute This routine reads a specified PDMS word attribute of the current element. D3RWA - Read a Word Array Attribute This routine reads a specified PDMS word array attribute of the current element. D3RPAT - Read PPOINT Attributes 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. The specified PPoint may be PH, PT, PA, PL, or P<n> (i.e. P1, P2 etc.) D3RUDA - Read Lists of UDA Names, Abbreviations and Types This routine reads, for a specified element type, parallel lists of UDA names, lengths of minimum valid abbreviations and attribute types. D3RUNI - Read Unit of Measurement for a Real or Integer UDA 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
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
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
D3ULDS - Test Latest MDB Date-Stamp This routine checks whether any database in the current MDB has been date-stamped later than a specified date/time. It is a utility routine built on routine D3RDAT. D3UINI - Query Initialisation This routine returns a true or false flag, depending on whether or not a PDMS project is currently initialised.
5.1.6
5.1.7
5.2
5:5
12.0
1. The subroutine (or function) statement. 2. The type declaration for each argument as it appears in the routine. 3. A description of the function of the routine. 4. A full definition of each argument. 5. A list of possible returned error codes. 6. Other possible errors and warnings.
CD3ERR
5:6
12.0
The routine will display the error message if requested. Arguments ID3ERR Error code for which the corresponding message is required. If the value is invalid, the message 'Unknown error' is returned. LD3DIS Display flag.
.TRUE. - display error message to the default device .FALSE. - display nothing
CD3MSG Error message corresponding to error code. Maximum length of text string is 50 characters. If the supplied character field is shorter than the returned message, the message will be truncated but no error condition will arise. If the field is too long, it will be padded with blanks. The returned (and printed) error message will be as listed in this section of the User Guide and in Error Codes and Messages. 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
5:8
12.0
Arguments ID3ERR Possible values are: Error code (not used; for possible future use) Any error code set prior to this routine is preserved and returned.
D3INIT - Initialise
Specification
SUBROUTINE D3INIT( CD3PRJ, CD3USR, CD3PAS, CD3MON, CD3RWK, ID3ERR ) CHARACTER*(*) INTEGER
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 PDMS project name (3 characters), e.g. 'XXX' Input characters will be converted to upper case. Strings exceeding three characters will be truncated.
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 PDMS Username (up to 32 characters), e.g. 'SMITH' or 'Jones' Input characters will be converted to upper case if an exact-case match is not found (i.e. the correct case must be used if the desired username does not consist entirely of upper-case alphabetic characters). Strings exceeding 32 characters will be truncated. If one or both of the CD3USR and CD3PAS arguments are blank, the routine will prompt interactively. The user will be allowed three attempts at entering a valid user/password combination. CD3PAS User password (up to 6 characters). Will differentiate between upper and lower case characters (PDMS password is 'case-sensitive'). Strings exceeding six characters will be truncated. If one or both of the CD3USR and CD3PAS arguments are blank, the routine will prompt interactively. The user will be allowed three attempts at entering a valid user/password combination. CD3MON Required monitor level (up to 4 characters). 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 - no monitoring. If required, D3EMSG can be called selectively to output messages. SOME - display names and types of databases opened by D3MMDB. FULL - as SOME plus display routine name and values of input and output arguments for all routines called and display all non-zero error messages. CD3RWK Read/write key (for future use) Enter as ' ' in this release. The argument will be ignored. ID3ERR Possible values are: 0 2 101 102 103 Success Internal error code set on entry Error opening Dabacon workfile Bad password Unknown username Error code.
5:10
12.0
Too many users in project Project currently locked Project is incompatible version Too many failed initialisations Project not found Error opening runfile data file Sitefile/Security error Invalid project name System database error
Other Error Conditions Only very few (and serious) error conditions result in immediate stop of the DARs application program during a call to D3INIT. In each case, a suitable error message will be output to the default output device.
5:11
12.0
Possible values are: 0 2 3 4 120 121 122 124 125 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Database not found Database not in current MDB Database already current Too many current databases Invalid database position
CD3NAM ID3ERR
5:12
12.0
Arguments CD3NAM ID3ERR Possible values are: 0 2 3 4 120 121 123 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Database not found Database not in current MDB Database not current The name of the database. Error code.
5:13
12.0
Arguments CD3NM1 CD3NM2 The name of the first database. The name of the second database. The order of the two databases is not important. ID3ERR Possible values are: 0 2 3 4 120 121 122 123 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Database not found Database not in current MDB Database already current (i.e. both are current) Database not current (i.e. both are deferred) Error code.
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 (up to 9 characters) & MDB Name (up to 32 characters, including the leading '/'), concatenated together. The default database is interpreted as the text string preceding the first '/' and it will be converted to upper case. If omitted (CD3MDB starts with a '/'), the default database will be the first database in the MDB. The following keywords are valid: Keyword DES/IGN CAT/ALOGUE PROP/ERTY PAD/DLE DIC/TIONARY Blank or null Default database Design (DESI) Catalogue (CATA) Properties (PROP) PADDLE (PADD) Dictionary (DICT) 1st database Other databases open CATA PROP DICT PROP DICT CATA DICT DESI CATA PROP DICT None 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 : Default database DESI, MDB /PLANT : Default database CATA, MDB /TEST : No default database (defaults to first), MDB /PLANT Read/write key (for future use) Enter as ' ' in this release. The argument will be ignored. ID3ERR Possible values are: 0 2 Success Internal error code set on entry Error code.
5:15
12.0
Routine D3INIT has not been called MDB not found No databases to open Corrupt databases Databases in use Error opening database file Invalid default database type No databases of default type in MDB
CD3NAM ID3ERR
5:16
12.0
9 402
ELEM/ENT MEMB/ER
ID3LIS
Move in the current list Move to a member owned by the current element Element's list position in the hierarchy, e.g. 1, 8 An entry greater than the highest available position will result in error code 203 (List exhausted). An illegal value (e.g. negative) will result in error code 10 (Argument has illegal value).
Error code.
Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called
5:17
12.0
Argument has illegal value Element has no list part No members List exhausted Cannot access this type of element
ID3ERR
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 The list order position of the database. The name of the database at this position. The database name can be up to 64 characters long. If this character string is declared shorter than the current database name length, the returned string will be truncated and no error will result. The name is of the form team/name (e.g. 'PIPE/ DESIGNA'). CD3TYP The type of the database. This is the four-character database type (e.g. DESI, CATA). If this character string is declared shorter than 4, the returned string will be truncated and no error will result. ID3STA Status of the database.
The returned status has a value between 1 and 3, as follows: 1: 2: 3: Current, Read Current, Closed Deferred
ID3STA will be returned as zero if the routine fails. ID3ERR Possible values are: 0 2 3 4 125 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Invalid database position Error code
5:19
12.0
first element last element next element previous element Type of element to be selected. This may be a special keyword or a PDMS noun, e.g. 'ELB/ OW', 'BOX', 'EQU/IPMENT'. Input characters will be converted to upper case. Abbreviations accepted in PDMS will be accepted by this routine (e.g. 'ELB', 'EQU' are accepted).
ELEM/ENT MEMB/ER
TID3ERR Possible values are: 0 2
Move in the current list Move to a member owned by the current element Error code
5:20
12.0
Routine D3INIT has not been called Routine D3MMDB has not been called Invalid position keyword Element has no list part No members List exhausted Cannot access this type of element
ID3ERR
5:21
12.0
ID3ERR
CD3BUN, CD3DUN
5:22
12.0
CD3DUN
Distance units, 'MM', 'INCH' or 'FINC' If the units are undefined or null, 'MM' will be returned. The maximum length of the returned text string is 4 characters. If the supplied character field is shorter than the returned units, the text will be truncated but no error condition will arise. If the field is too long, it will be padded with blanks.
Error code.
Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called
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':
QUERY BOX name/ref QUERY BOX LEAVE of name/ref QUERY BOX HEAD of name/ref
In the case of branches, the leave tube is interpreted as the branch head tube. The surrounding box is returned as a six element real array containing the x/y/z co-ordinates of opposite corners of the box. Array RD3BOX must be declared at least six elements. If an error occurs then an error code is returned as specified below and six elements of RD3BOX are returned as zero. Error 310 can only be returned if LD3TUB, the leave tube flag, is set to true.
5:23
12.0
Arguments LD3TUB Leave tube flag. Return box for leave tube (or branch head tube for branch) Return box for current element 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 Possible values are: 0 2 3 4 309 310 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Element not on spatial map Leave or head tube does not exist Error code.
.TRUE. .FALSE.
RD3BOX
5:24
12.0
Year (As a 4-digit number) Month (1 = January, 12 = December) Day (1 to 31) Hour (0 to 23) Minute (0 to 59) 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 Latest database date-stamp as a character string. The date/time format is of the form 'dd Mon yyyy hh:mm:ss', where: dd Mon yyyy is the date (e.g. 07 Dec 1997) hh:mm:ss is the time on that date (e.g. 09:07:56) dd is the day as two digits, first digit 0 if less than 10 Mon is the month (Jan, Feb etc.) yyyy is the year (e.g. 1997) hh, mm, ss are hour, minute, second as two digits, as dd
CD3DAT should be declared at least CHARACTER*20 for the complete date/time to be returned. The date/time will be truncated to fit the declared length of CD3DAT, but only as follows: 1-10: 11-16: 17-19: returns blank string returns dd Mon yy returns dd Mon yy hh:mm
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 Possible values are: 0 2 3 Success Internal error code set on entry Routine D3INIT has not been called Error code.
5:25
12.0
4 306
5:26
12.0
Arguments CD3ATT The name of the attribute required. This must be a PDMS attribute name, e.g. 'LEV/EL' or a UDA name. Input characters will be converted to upper case. In the case of PDMS attribute name, abbreviations accepted in PDMS will be accepted by this routine (e.g. 'LEV' is accepted). A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. ID3NIN Maximum number of array elements required. Array ID3IA must be dimensioned at least to this size. If the array is bigger, the elements outside the range 1 to ID3NIN will not be changed. ID3IA The array of integer values. If the attribute is user-defined, the units pertaining to the returned integer array may be obtained by calling routine D3RUNI. ID3NOU The number of values returned in ID3IA. If ID3NOU is less than ID3NIN, elements (ID3NOU+1) to ID3NIN will be returned as zero. ID3NOU will be returned as zero if the routine fails. If the number of values is genuinely zero (e.g. an unset UDA array), ID3NOU will be returned as zero and error code 308 will be returned in ID3ERR. ID3ERR Possible values are: 0 2 3 4 301 302 308 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Attribute not found Attribute of wrong type Attribute unset Error code.
5:27
12.0
5:28
12.0
SUBROUTINE D3RLA( CD3ATT, ID3NIN, LD3LA, ID3NOU, ID3ERR ) CHARACTER*(*) INTEGER LOGICAL
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 The name of the attribute required. This must be a PDMS attribute name or a UDA name. Input characters will be converted to upper case. In the case of PDMS attribute name, abbreviations accepted in PDMS will be accepted by this routine. A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. ID3NIN Maximum number of array elements required. Array LD3LA must be dimensioned at least to this size. If the array is bigger, the elements outside the range 1 to ID3NIN will not be changed. LD3LA ID3NOU The array of logical values. The number of values returned in LD3LA. If ID3NOU is less than ID3NIN, elements (ID3NOU+1) to ID3NIN will be returned as zero. ID3NOU will be returned as zero if the routine fails. If the number of values is genuinely zero (e.g. an unset UDA array), ID3NOU will be returned as zero and error code 308 will be returned in ID3ERR.
5:29
12.0
Error code.
Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Attribute not found Attribute of wrong type Attribute unset
5:30
12.0
0 2 3 4 301 302
Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Attribute not found Attribute of wrong type
5:31
12.0
It is the programmer's responsibility to ensure that CD3NAM is declared large enough. Truncated strings are not returned. Error code 5 will indicate that the declared string is too short. If an error occurs, CD3NAM is returned as blank. If CD3ATT is 'NAM/E' and the element is not named, then CD3NAM will return the reference number (if the declared string is large enough). ID3ERR Possible values are: 0 2 3 4 5 301 302 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Character output string parameter too short Attribute not found Attribute of wrong type Error code.
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 Orientation array of three unit vectors. The orientation is returned as a nine element real array containing the three unit vectors. The nine elements have the following arrangement: X axis unit vector - E (element 1), N (element 2), U (element 3) Y axis unit vector - E (element 4), N (element 5), U (element 6) Z axis unit vector - E (element 7), N (element 8), U (element 9) Array RD3ORI must be declared at least nine elements. ID3ERR Possible values are: 0 2 3 4 7 9 205 402 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Invalid co-ordinate system keyword Bad name/reference argument Cannot access this type of element Undefined name/reference Error code.
5:33
12.0
SUBROUTINE D3RPAT( CD3POI, CD3CRD, RD3POS, RD3DIR, RD3BOR, CD3CON, ID3ERR ) CHARACTER*(*) INTEGER 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 The required PPOINT. i.e. 'PH/EAD', 'PT/AIL', 'PA/RRIVE', 'PL/EAVE', or 'P<n>', where n is an integer ('P1', 'P2', etc.). The input string will be converted to upper case. CD3CRD The requested co-ordinate system. This may be the keyword 'OWN/ER' or a PDMS noun (e.g. 'ZON/E', 'WORL/D'), or a PDMS name (e.g. '/DATUM'), or a PDMS reference number. For branch and piping component PPoints the co-ordinate system 'OWNER' is interpreted as 'ZONE' since 'BRANCH' and 'PIPE' are not meaningful co-ordinate systems. 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).
5:34
12.0
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. RD3POS The PPoint 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. RD3DIR The PPoint direction. The direction is returned as a three element real array containing the unit vector in E, N, U order. Array RD3DIR must be declared at least three elements. RD3BOR CD3CON The PPoint bore. The PPoint connection type It is the programmer's responsibility to ensure that CD3CON is declared large enough (usually CHARACTER*4). Truncated strings are not returned. Error code 5 will indicate that the declared string is too short. If an error occurs, CD3CON is returned as blank. ID3ERR Error code.
Possible values are: 0 2 3 4 5 7 8 9 205 303 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Character output string parameter too short Invalid co-ordinate system keyword Invalid PPoint keyword Bad name/reference argument Cannot access this type of element Element does not have PPoints
5:35
12.0
304 402
project code project number project name project description 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 The returned text. 3 characters will be returned for project code, up to 16 characters for project number and up to 119 characters for the other three items. If the data item is unset, a blank string will be returned, but no error condition will arise.
5:36
12.0
It is the programmer's responsibility to ensure that CD3TEX is declared large enough. Truncated strings are not returned. Error code 5 will indicate that the declared string is too short. If an error occurs, CD3TEX is returned as blank. ID3ERR Possible values are: 0 2 3 5 11 Success Internal error code set on entry Routine D3INIT has not been called Character output string parameter too short Invalid project data keyword Error code.
5:37
12.0
Arguments CD3CRD The requested co-ordinate system. This may be the keyword 'OWN/ER' or a PDMS noun (e.g. 'ZON/E', 'WORL/D'), or a PDMS name (e.g. '/DATUM'), or a PDMS reference number. 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. 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 Possible values are: 0 2 3 4 7 9 205 402 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Invalid co-ordinate system keyword Bad name/reference argument Cannot access this type of element Undefined name/reference Error code.
5:38
12.0
Specification
5:39
12.0
SUBROUTINE D3RRA( CD3ATT, ID3NIN, RD3RA, ID3NOU, ID3ERR ) CHARACTER*(*) INTEGER REAL
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 The name of the attribute required. This must be a PDMS attribute name, e.g. 'POS/ITION', 'PARA/ METERS', 'HDI/RECTION' or a UDA name. Input characters will be converted to upper case. In the case of PDMS attribute name, abbreviations accepted in PDMS will be accepted by this routine (e.g. 'HDI', 'POS' are accepted). A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. ID3NIN Maximum number of array elements required. Array RD3RA must be dimensioned at least to this size. If the array is bigger, the elements outside the range 1 to ID3NIN will not be changed. RD3RA The array of real values. If the attribute is user-defined, the units pertaining to the returned real array may be obtained by calling routine D3RUNI.
5:40
12.0
ID3NOU
The number of values returned in RD3RA. If ID3NOU is less than ID3NIN, elements (ID3NOU+1) to ID3NIN will be returned as zero. ID3NOU will be returned as zero if the routine fails. If the number of values is genuinely zero (e.g. an unset UDA array), ID3NOU will be returned as zero and error code 308 will be returned in ID3ERR.
Error code.
Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Attribute not found Attribute of wrong type Attribute unset
5:41
12.0
Arguments CD3ATT The name of the attribute required. This must be a PDMS attribute name, e.g. 'BOR/E', 'TEM/ PERATURE', 'XLE/NGTH' or a UDA name. Input characters will be converted to upper case. In the case of PDMS attribute name, abbreviations accepted in PDMS will be accepted by this routine (e.g. 'TEM', 'XLE' are accepted). A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. RD3REA The value of the real attribute. If the attribute is user-defined, the units pertaining to the returned real value may be obtained by calling routine D3RUNI. ID3ERR Possible values are: 0 2 3 4 301 302 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Attribute not found Attribute of wrong type Error code.
5:42
12.0
Arguments CD3ATT The name of the attribute required. This must be a PDMS attribute name, e.g. 'CREF/ERENCE', 'HREF/ERENCE', HEAD or a UDA name. Input characters will be converted to upper case. In the case of PDMS attribute name, abbreviations accepted in PDMS will be accepted by this routine (e.g. 'CREF', 'HREF' are accepted). A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. CD3REF The value of the reference number attribute. The reference number will include the '=' and '/' characters. It is the programmer's responsibility to ensure that CD3REF is declared large enough. Truncated strings are not returned. Error code 5 will indicate that the declared string is too short. If an error occurs, CD3NAM is returned as blank. ID3ERR Possible values are: 0 2 3 4 5 301 302 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Character output string parameter too short Attribute not found Attribute of wrong type Error code.
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 The name of the attribute required. This must be a PDMS attribute name, e.g. 'CRF/A' or a UDA name. Input characters will be converted to upper case. In the case of PDMS attribute name, abbreviations accepted in PDMS will be accepted by this routine (e.g. 'CRF' is accepted). A UDA name must include the leading ':' character. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. ID3NIN Maximum number of array elements required. Array CD3RFA must be dimensioned at least to this size. If the array is bigger, the elements outside the range 1 to ID3NIN will not be changed. CD3RFA The array of reference numbers. The reference numbers will include the '=' and '/' characters. It is the programmer's responsibility to ensure that the elements of CD3RFA are declared large enough. Truncated strings are not returned. Error code 5 will indicate that one or more elements of the declared string is too short. Those elements are returned as blanks and the remainder are returned normally. Otherwise, if an error occurs, all array elements are returned as blank. ID3NOU The number of values returned in CD3RFA. If ID3NOU is less than ID3NIN, elements (ID3NOU+1) to ID3NIN will be returned as zero. ID3NOU will be returned as zero if the routine fails with an error code other than 5. If the number of values is genuinely zero (e.g. an unset UDA array), ID3NOU will be returned as zero and error code 308 will be returned in ID3ERR. ID3ERR Possible values are: 0 2 3 4 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Error code.
5:44
12.0
Character output string parameter too short Attribute not found Attribute of wrong type Attribute unset
5:45
12.0
Arguments CD3ATT The name of the attribute required. This must be a PDMS attribute name, e.g. 'STEX/T', 'DUT/Y', 'PTSP/ECIFICATION' or a UDA name. Input characters will be converted to upper case. In the case of PDMS attribute name, abbreviations accepted in PDMS will be accepted by this routine (e.g. 'STEX', 'DUT' are accepted). A UDA name must include the leading ':' character and may be a word or a text UDA. The number of characters following the ':' must be greater than or equal to the minimum abbreviation. CD3TEX The value of the text attribute. It is the programmer's responsibility to ensure that CD3TEX is declared large enough. The maximum length of a text string is 120 characters. Truncated strings are not returned. Error code 5 will indicate that the declared string is too short. Error code 308 will indicate a null (unset) string. PDMS treats blank strings ' ' and null strings '' differently. A null string signifies 'unset'; a blank string signifies a deliberate setting to 'blank'. If an error occurs or if no text is defined for the attribute, CD3TEX is returned as blank. ID3ERR Possible values are: 0 2 3 4 5 301 302 308 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Character output string parameter too short Attribute not found Attribute of wrong type Attribute unset Error code.
5:46
12.0
CD3TYP ID3ERR
SUBROUTINE D3RUDA( CD3TYP, ID3MAX, CD3NMS, ID3ABV, CD3ATP, ID3NUM, ID3ERR ) CHARACTER*(*) 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 The type of element for which the UDAs are to be read. This must be a PDMS noun e.g. 'ELB/OW', 'BOX', 'EQU/IPMENT'. Input characters will be converted to upper case. Abbreviations accepted in PDMS will be accepted by this routine (e.g. 'ELB', 'EQU' are accepted). ID3MAX The maximum number of UDA definitions expected for the specified element type. This must be equal to the size of the arrays declared for CD3NMS, ID3ABV and CD3ATP. CD3NMS Array containing a list of UDA names valid for the specified element type. This array variable should be declared to at least CHARACTER*13. If declared less than this, some or all of the returned array positions may contain truncated names. No warning will be given if truncation occurs. The names include the leading ':' character. ID3ABV Array containing a list of the lengths of minimum valid abbreviations. The lengths exclude the leading ':' character. CD3ATP Array containing a list of the UDA types. Possible UDA types are: : Real : Integer : Reference : Text : Word : 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
The actual number of attributes returned. When an element type has no UDAs defined or if the element type is invalid, the value returned will be zero. In neither case will an error condition arise.
Error code.
Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called
5:49
12.0
Arguments CD3ATT The name of the attribute for which UNIT is to be found. The attribute string will be checked for a leading colon. If one does not exist the routine will insert one. Valid abbreviations will be accepted. For example, valid attribute strings for a UDA called :CONTROLLER would include:
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).
CALL D3RRA( PARA, 100, PARA, ID3NOU, ID3ERR ) IF ( ID3ERR .NE. 0 ) THEN DO 100 I = 1, ID3NOU PARWOR( I ) = IF ( PARA( I ) .GT. 531442.0 ) THEN CALL D3UDEH( INT( PARA( I ) ), PARWOR(I ) ) ENDIF 100 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 The name of the attribute required. This must be a PDMS attribute name, e.g. 'CTYP/E'. Input characters will be converted to upper case. Abbreviations accepted in PDMS will be accepted by this routine (e.g. CTYP will be accepted). ID3NIN Maximum number of array elements required. Array CD3WA must be dimensioned at least to this size. If the array is bigger, the elements outside the range 1 to ID3NIN will not be changed.
CONTINUE
5:51
12.0
CD3WA
The array of words. It is the programmer's responsibility to ensure that the elements of CD3WA are declared large enough (usually CHARACTER*6). Truncated strings are not returned. Error code 5 will indicate that one or more elements of the declared string is too short. Those elements are returned as blanks and the remainder are returned normally. Otherwise, if an error occurs, all array elements are returned as blank. If any integer value does not translate into a word, that element of CD3WA is returned as blank.
ID3NOU
The number of values returned in CD3WA. If ID3NOU is less than ID3NIN, elements (ID3NOU+1) to ID3NIN will be returned as zero. ID3NOU will be returned as zero if the routine fails with an error code other than 5. If the number of values is genuinely zero, ID3NOU will be returned as zero and error code 308 will be returned in ID3ERR.
ID3ERR
Error code.
Possible values are: 0 2 3 4 5 301 302 308 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Character output string parameter too short Attribute not found Attribute of wrong type Attribute unset
5:52
12.0
Arguments CD3ATT The name of the attribute required. This must be a PDMS attribute name, e.g. 'HCO/NN', 'BUNI/TS', 'FLOW/DIRECTION'. Input characters will be converted to upper case. Abbreviations accepted in PDMS will be accepted by this routine (e.g. 'HCO', 'FLOW' are accepted). CD3WOR The value of the word attribute. It is the programmer's responsibility to ensure that CD3WOR is declared large enough (usually CHARACTER*6). Truncated strings are not returned. Error code 5 will indicate that the declared string is too short. If an error occurs or if the integer value does not translate into a word, CD3WOR is returned as blank. ID3ERR Possible values are: 0 2 3 4 5 301 302 Success Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Character output string parameter too short Attribute not found Attribute of wrong type Error code.
ID3UNI
5:53
12.0
Arguments ID3UNI Function Value D3UCLU .TRUE. if file unit number accepted. .FALSE. if unit invalid. FORTRAN file unit number.
LOGICAL FUNCTION D3UCTI( CD3STR, ID3INT, CD3BEF, CD3AFT, CD3ERR ) CHARACTER*(*) INTEGER
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 Character string to be analysed for presence of an integer. There is no limit to the length of the string. ID3INT CD3BEF Extracted integer, if found. String preceding extracted integer. Any leading blanks in CD3STR are included in this string. If the supplied string is shorter than the found string, the string will be truncated. No error condition will arise as a result. If the programmer wishes to make use of this functionality, it is recommended that this variable is declared the same size as CD3STR. CD3AFT String following extracted integer. If the supplied string is shorter than the found string, the string will be truncated. No error condition will arise as a result. If the programmer wishes to make use of this functionality, it is recommended that this variable is declared the same size as CD3STR. CD3ERR Error code, if function returned .FALSE.
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. .FALSE.
LOGICAL FUNCTION D3UCTR( CD3STR, RD3VAL, CD3BEF, CD3AFT, CD3ERR ) CHARACTER*(*) REAL
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 Character string to be analysed for presence of a real number. There is no limit to the length of the string. RD3VAL CD3BEF Extracted value, if found. String preceding extracted real number. Any leading blanks in CD3STR are included in this string. If the supplied string is shorter than the found string, the string will be truncated. No error condition will arise as a result. If the programmer wishes to make use of this functionality, it is recommended that this variable is declared the same size as CD3STR.
5:56
12.0
CD3AFT
String following extracted real number. If the supplied string is shorter than the found string, the string will be truncated. No error condition will arise as a result. If the programmer wishes to make use of this functionality, it is recommended that this variable is declared the same size as CD3STR.
CD3ERR
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
if real number found without additional data. if no real number. if real number found with additional data.
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 Hashed integer number. This must be an integer number (e.g. 534552), derived from 'hashing' of a PDMS word by PDMS. In the context of PDMS DARs, it will be an integer number returned by a data access routine (e.g. some elements of an integer array attribute may be hashed words). CD3WOR The word resulting from dehashing the integer number, e.g. 534552 will return 'FGD' It is the programmer's responsibility to ensure that CD3WOR is declared large enough (usually CHARACTER*6, or less if word has trailing blanks). If the declared string is too short, CD3WOR is returned as blank. A zero or negative integer number results in the string 'NUL'. Otherwise, if the integer number is outside the valid range or the decoded word is illegal, CD3WOR is returned as blank. 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 ID3DAT(6)
5:58
12.0
The date/time is represented as six integers: ID3DAT(1): ID3DAT(2): ID3DAT(3): ID3DAT(4): ID3DAT(5): ID3DAT(6): Year (As a 4-digit number) Month (1 = January, 12 = December) Day (1 to 31) Hour (0 to 23) Minute (0 to 59) 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 Current system date/time as a character string. The date/time format is of the form 'dd Mon yyyy hh:mm:ss', where: dd Mon yyyy is the date (e.g. 07 Dec 1997) hh:mm:ss is the time on that date (e.g. 09:07:56) dd is the day as two digits, first digit 0 if less than 10 Mon is the month (Jan, Feb etc.) yyyy is the year (e.g. 1997) hh, mm, ss are hour, minute, second as two digits, as dd
CD3DAT should be declared at least CHARACTER*20 for the complete date/time to be returned. The date/time will be truncated to fit the declared length of CD3DAT, but only as follows: 1-10: 11-16: 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. returns blank string returns dd Mon yy returns dd Mon yy hh:mm
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
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 FORTRAN file unit number.
.TRUE. .FALSE.
5:60
12.0
Arguments LD3INI
.TRUE. .FALSE.
CD3DAT ID3ERR
5:61
12.0
Internal error code set on entry Routine D3INIT has not been called Routine D3MMDB has not been called Invalid date/time Entered date/time later than current
.TRUE. .FALSE.
if any db date-stamp later than CD3DAT if no db date-stamp later than CD3DAT, or error. In circumstances where error code 306 would be returned by D3RDAT, this routine returns FALSE and does not return an error.
CD3STR
5:62
12.0
Arguments CD3STR String for which significant length is required. There is no limit to the length of the string. Function Value D3ULEN Significant length of string. Zero for blank string ' '. Equivalent to LEN(CD3STR) for undefined string.
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 no monitoring. If required, D3EMSG can be called selectively to output messages. display names and types of databases opened by D3MMDB. as SOME plus display routine name and values of input and output arguments for all routines called and display all non-zero error messages.
Errors/Warnings No errors or warnings can result from the use of this routine.
5:63
12.0
5:64
12.0
6
6.1
Version Control
DARs Version Numbering
PDMS Data Access Routines have a version number corresponding to the version of PDMS whose FORTRAN routines they include. For example, PDMS DARs Mk11.6.0 would be the first release of Mk11.6, based upon library routines from PDMS Mk11.6.0. In line with PDMS version control, any minor release of PDMS DARs Mk11.6 would be compatible with any minor release of PDMS Mk11.6 (e.g. PDMS DARs Mk11.6.0.2 would be compatible with PDMS Mk11.6.0.3 and with PDMS Mk11.6.0.7). Compatibility may exist across major releases, depending on the nature of the changes introduced with such a release. This will be confirmed with each new release. As an example, PDMS DARs Mk11.4 was compatible with PDMS Mk11.3. Compatibility will definitely not exist across DDL changes. For example, PDMS DARs Mk11.6 is not compatible with any release of PDMS Mk10.
6.2
6.3
6:1
12.0
6:2
12.0
A.1
A:1
12.0
d3libc.h pdms.h
C header file to include in any C/C++ source program C header file included in d3libc.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.
LOGICAL D3UGTU, D3UCLU, OK INTEGER FUNIT IF (.NOT. D3UGTU( FUNIT )) GOTO 999 OPEN( FUNIT, .... )
A:2
12.0
A.3
A:3
12.0
# Tells the linker to search for unresolved references in a multithreaded # run-time library. /threads # Tells the compiler that all routines should be compiled for possible recursive execution. /recursive /Op # Double indecision REAL but NOT DOUBLEs /real-size:64
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
2. Set the DARs library environment variable: e.g. set DARSLIBDIR=%PDMSEXE%\dars 3. Create a work directory and copy f77_example1.f, d3test.f, d3test and d3test.log.base into the work directory from the DARs release directory %DARSLIBDIR%. 4. Change directory to the work directory and enter %DARSLIBDIR%\d3test > d3test.log at the terminal. Compare d3test.log and d3test.log.base; any significant differences? 5. Enter %DARSLIBDIR%\compload d3test 6. Enter d3test >d3test.log Compare d3test.log and d3test.log.base; any significant differences? 7. Enter %DARSLIBDIR%\compload f77_example1 8. Enter f77_example1 Does the output appear to be the same the output in Example 1 (allowing for minor differences of precision)?
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.
rem @echo off Rem $Id: compload.bat,v 1.1 1998/09/30 14:40:33 pne Exp $ Rem NT .bat file to compile and link a PDMS DARs application 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 IFORT /c %1.f Rem and link link %1.obj /subsystem:console/entry:mainCRTStartup %PDMSEXE% \dars\d3lib.lib :FINISH
B:1
12.0
B:2
12.0
The error codes and their corresponding interpretations are as follows : 0 Success No errors have occurred 1 Unknown error An undocumented error has occurred. Please record the two numbers that accompany this message and contact your PDMS support engineer. 2 Internal error code set on entry An error has occurred during a previous call to a data access routine. No further actions can be can be carried out by data access routines until the internal error code is reset with a call to routine D3ERST. 3 Routine D3INIT has not been called A successful call to routine D3INIT must precede all use of data access navigation and attribute retrieval routines in each project.
C:1
12.0
Routine D3MMDB has not been called A successful call to routine D3MMDB must precede all use of data access navigation and attribute retrieval routines in each project.
Character string output argument too short The character string supplied by the programmer to take an output argument is too short. A truncated string will not be returned.
Invalid position keyword A position keyword other than 'FIRS', 'LAST', 'NEXT' or 'PREV' has been supplied.
Invalid coordinate system keyword A coordinate system not recognisable as a PDMS name, reference number, noun or the keyword 'OWNE' has been supplied.
Invalid PPoint keyword The character string entered for PPoint is not a valid option. Valid keywords are 'PH/EAD', 'PT/AIL', 'PA/RRIVE', 'PL/EAVE' and 'Pval', where val is an integer.
Bad name/reference argument A name has been supplied without a leading / character, or a reference number without = and / characters.
10
Argument has illegal value The value of the argument is invalid. For example, a negative value may have been entered where a positive value is required.
11
Invalid project data keyword The character string entered for project data item is not a valid option. Valid keywords are: NUM/BER, NAM/E, DES/CRIPTION, MES/SAGE, COD/E.
12
Invalid date/time The character string entered for date/time is not a valid text string.
13
Entered date/time later than current The date/time argument is later than the current date/time and is therefore invalid.
101
Error opening Dabacon workfile This should not normally occur. It can occur if the user does not have access to the PDMS work area or if he attempts to run a DARs program within PDMS using the SYSCOM command (both programs try to open the same workfile).
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 Too many users in project The number of users in the project has exceeded the maximum allowed. 105 Project currently locked The specified project is locked and access is denied. 106 Project is incompatible version An attempt has been made to open a database belonging to an incompatible version of PDMS. The current versions of the project and of PDMS DARs are incompatible. 107 Too many failed initialisations The application program has called D3INIT three times (or more) in succession, each failing to initialise DARs. 108 Project not found The directory corresponding to the specified project could not be found, or if found does not contain a PDMS project. 109 Error opening runfile data file This should not occur. Ensure the user has access to the PDMS project. 110 MDB not found The specified MDB is not defined in the specified project. 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 Error opening database file This error can occur if a required database file does not exist or if it cannot be accessed for any reason.
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
Invalid project name The entered project name (after truncation to three characters) is not a valid name. A valid name consists of three alphabetic characters.
117
Invalid default database type Invalid keyword string entered for default database type. It must be one of the valid options or a valid abbreviation.
118
No databases of default type in MDB The specified MDB does not contain a database of the default type. The program cannot open the system database. The nature of the error will be output to the terminal in the same way as occurs for PDMS (e.g. PNS Privileges not sufficient). Unlike PDMS, the program will not stop, but will simply return this error.
120
121
Database not in current MDB Named database not present in current MDB.
122
Database already current Database cannot be made current because it already is current. databases cannot be exchanged because both are current. Or,
123
Database not current Database cannot be deferred because it already is deferred. databases cannot be exchanged because both are deferred. Or,
124
Too many current databases Database cannot be made current because the maximum number of databases is already current.
125
Invalid database position Specified database position is less than 1 or is greater than maximum number of databases
126
Too many saved database levels Nesting of D3MSAV and D3MRST exceeds a depth of 10.
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 Element has no list part An attempt has been made to go to a member of the current element but it cannot own elements. 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 Current element has no owner An attempt has been made to go to the owner of the current element when it has no owner. This only applies to the world. 205 Cannot access this type of element A PDMS noun of unrecognised type has been supplied, either as element type or coordinate system. 301 Attribute not found The current element does not have the requested attribute. 302 Attribute of wrong type The requested attribute is of a different data type to that retrieved by the this routine. 303 Element does not have PPoints The current element does not have PPoints. 304 Illegal PPoint number The current element does not have a PPoint with this number. 305 Wrong element type Attempt to read an attribute specific to a particular element type, when the current element is of an inappropriate type. Not applicable at present. 306 No date-stamp found Databases in MDB do not have a date-stamp. MDB not used since project created or reconfigured. 307 UDA not found The current element does not have the requested user-defined attribute. 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 Element not on spatial map The database spatial map is not up-to-date. Use the MAP command in DESIGN to rebuild the spatial map. 310 Leave or head tube does not exist The surrounding box for an element's leave tube, or branch head tube, has been requested and there is no such leave or head tube. 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 Reference to database not open The element referenced is not in a database that is current on the selected MDB. 404 File write error This should not occur. Ensure the user has access to the PDMS work area and to the PDMS project. 405 File read error This should not occur. Ensure the user has access to the PDMS work area and to the PDMS project.
C:6
12.0
D
D.1
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 Query Attributes for a CATALOG Query Attributes for a SECTION Query Attributes for a SCOMP Query Attributes for a UNIT Query Attributes for a USEC Query Attributes for a UDEF Query Attributes for a MSET Query Attributes for a MTYP Query Attributes for a ATLI Query Attributes for a SPWL Query Attributes for a SITE Query Attributes for a ZONE Query Attributes for a PIPE Query Attributes for a BRANCH Query Attributes Common to PIPE/BRANCH (called by D3QPIP and D3QBRA) Query Attributes for a TEE Query Attributes for an ELBOW Query Attributes Common to Piping Components (called by D3QTEE and D3QELB) Query Attributes for an EQUIPMENT Query Attributes for a NOZZLE Query Attributes for a BOX Query Members for Current Element Query Attributes Common to all Element Types (TYPE, NAME, OWNEr, LOCK) Query UDAs and UDA Values for Current Element
D:2
12.0
Query Attributes for a SPEC Query Attributes for a SELE Query Attributes for a SPCO Query Attributes for a CCTA Query Attributes for a COCO Properties Database Query Attributes for a TUBD Query Attributes for a CMPD Query Attributes Common to TUBD and CMPD (called by D3QTUB and D3QCMP) Query Attributes for a CONS
Additional Routine D3XLEN Integer Function returning Significant Length of a String or 1 for a Blank String (variant of D3ULEN)
D.3
INTEGER CHARACTER*(*)
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 ID3NIN CD3TYP CD3NAM ID3NOU ID3ERR Display flag Max number of array elements required Array of element types (allow four characters per element) Array of element names (allow 50 characters per element) Number of elements returned for each of above two arrays Error code
D:3
12.0
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 TYPE OWNE ID3ERR Display flag Type NAMEName Owner name/ref LOCKLock flag 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 ID3ERR Display flag Error code
The following are displayed but not returned: For the element type: UDA names & minimum abbreviations UDA type Reporter text For the element, for each UDA: UDA value and units (if any) A value of 0 for ID3DIS does not suppress the output.
D:4
12.0
SUBROUTINE D3QSIT (ID3DIS, TYPE, NAME, OWNE, LOCK, POS, ORI, ID3ERR)
Performs the equivalent of a Q ATT for a SITE. Calls D3RNAM, D3XLEN, D3QCMA, D3RRA, D3EMSG ID3DIS TYPE OWNE POS ID3ERR Display flag Type Owner name/ref Position Error code NAME LOCK ORI Name Lock flag Orientation
SUBROUTINE D3QZON( ID3DIS, TYPE, NAME, OWNE, LOCK, POS, ORI, PSPE,ISPE, TSPE, ID3ERR )
ID3DIS, ID3ERR LOCK TYPE, NAME, OWNE, PSPE, ISPE, TSPE POS(3), ORI(3)
Performs the equivalent of a Q ATT for a ZONE. Calls D3RNAM, D3XLEN, D3QCMA, D3RRA, D3EMSG, D3ERST ID3DIS TYPE OWNE POS PSPE TSPE Display flag Type Owner name/ref Position Pipe spec Tracing spec NAME LOCK ORI ISPE ID3ERR Name Lock flag Orientation Insulation spec Error code
D:5
12.0
SUBROUTINE D3QPIP( ID3DIS, TYPE, NAME, OWNE, LOCK, BUIL, SHOP, BORE,TEMP, PRES, PSPE, ISPE, TSPE, MATR, FLUR, CASR,CCEN, CCLA, DUTY, LNTP, EREC, REV, DSCO, PTSP,INSC, SAFC, ID3ERR )
ID3DIS, CCEN, CCLA, EREC, REV, SAFC, ID3ERR LOCK, BUIL, SHOP TYPE, NAME, OWNE, PSPE, ISPE, TSPE, MATR FLUR, CASR, DUTY, LNTP, DSCO, PTSP, INSC BORE, TEMP, PRES
Performs the equivalent of a Q ATT for a pipe. Calls D3RNAM, D3XLEN, D3QBPA, D3RREA, D3RINT, D3EMSG ID3DIS TYPE OWNE BUIL BORE PRES ISPE MATR CASR CCLA LNTP REV PTSP SAFC Display flag Type Owner name/ref Built flag Pipe bore Pressure Insulation spec Material ref List of cases ref Cost class Line type identifier Revision Paint spec Safety class NAME LOCK SHOP TEMP PSPE TSPE FLUR CCEN DUTY EREC DSCO INSC ID3ERR Name Lock flag Shop flag Temperature Pipe spec Tracing spec Fluid ref Cost centre Duty Erection Design code Inspection schedule Error code LHEA, TEMP, DUTY, TPOS,
SUBROUTINE D3QBRA( ID3DIS, TYPE, NAME, OWNE, LOCK, BUIL, LTAI,DETA, SHOP, LSTR, LNTP, EREC, HBOR, TBOR, HCON,TCON, PRES, FLOW, MATR, FLUR, CASR, PSPE,ISPE, TSPE, CCEN, CCLA, DSCO, PTSP, INSC,SAFC, HSTU, HREF, TREF, HPOS, HDIR, TDIR,ID3ERR )
INTEGER LOGICAL
ID3DIS, EREC, CCEN, CCLA, SAFC, ID3ERR LOCK, BUIL, LHEA, LTAI, DETA, SHOP, LSTR
D:6
12.0
OWNE, PSPE,
LNTP, ISPE,
HCON, TSPE,
TCON, DUTY,
INSC, HSTU, HREF, TREF HBOR, TBOR, TEMP, PRES, HPOS(3), HDIR(3) TPOS(3), TDIR(3)
Performs the equivalent of a Q ATT for a branch. Calls D3RNAM, D3XLEN, D3QBPA, D3RLOG, D3RREA, D3RWOR, D3RRA, D3EMSG, D3ERST. ID3DIS TYPE OWNE BUIL LTAI SHOP LNTP HBOR HCON TEMP FLOW FLUR PSPE TSPE CCLA DSCO INSC HSTU HREF TREF HDIR TDIR Display flag Type Owner name/ref Built flag Tail flag Shop flag Line type identifier Head bore Head connection type Temperature Flow direction Fluid ref Pipe spec Tracing spec Cost class Design code Inspection schedule Tube spec ref Head ref Tail ref Head direction Tail direction HPOS TPOS ID3ERR Head position Tail position Error code NAME LOCK LHEA DETA LSTR EREC TBOR TCON PRES MATR CASR ISPE CCEN DUTY PTSP SAFC Name Lock flag Head flag Detailed flag Stressed flag Erection Tail bore Tail connection type Pressure Material ref List of cases ref Insulation spec Cost centre Duty Paint spec Safety class
D:7
12.0
SUBROUTINE D3QBPA( ID3DIS, TYPE, NAME, OWNE, LOCK, BUIL, SHOP, TEMP,PRES, PSPE, ISPE, TSPE, MATR, FLUR, CASR, CCEN,CCLA, DUTY, LNTP, EREC, DSCO, PTSP, INSC, SAFC,ID3ERR )
ID3DIS, CCEN, CCLA, EREC, SAFC, ID3ERR LOCK, BUIL, SHOP TYPE, NAME, MATR, FLUR 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 )
ID3DIS, ARRI, LEAV, ID3ERR LOCK, SHOP, BUIL, ORIL, POSI, LOFF TYPE, NAME, OWNE, SPRE, LSTU, CREF, ISPE, TSPE POS(3), ORI(3), HEIG, RADI, ANGL
Performs the equivalent of a Q ATT for a TEE. Calls D3RNAM, D3XLEN, D3QCPA, D3RREA, D3RLOG, D3EMSG, D3ERST ID3DIS TYPE OWNE POS SPRE CREF LEAV HEIG BUIL Display flag Type Owner name/ref Position Spec ref Connection ref Leave PPoint Height Built flag NAME LOCK ORI LSTU ARRI ANGL RADI SHOP Name Lock flag Orientation Tube ref Arrive PPoint Angle Radius Shop flag
D:8
12.0
SUBROUTINE D3QELB( ID3DIS, TYPE, NAME, OWNE, LOCK, POS, ORI, SPRE, LSTU, CREF, ARRI, LEAV, ANGL, RADI, BUIL, SHOP, ORIL, POSI, ISPE, TSPE, ID3ERR )
ID3DIS, ARRI, LEAV, ID3ERR LOCK, SHOP, BUIL, ORIL, POSI TYPE, NAME, OWNE, SPRE, LSTU, CREF, ISPE, TSPE POS(3), ORI(3), RADI, ANGL
Performs the equivalent of a Q ATT for an ELBO. Calls D3RNAM, D3XLEN, D3QCPA, D3RREA, D3EMSG, D3ERST ID3DIS TYPE OWNE POS SPRE CREF LEAV RADI SHOP POSI TSPE Display flag Type Owner name/ref Position Spec ref Connection ref Leave PPoint Radius Shop flag Position flag Tracing spec NAME LOCK ORI LSTU ARRI ANGL BUIL ORIL ISPE ID3ERR Name Lock flag Orientation Tube ref Arrive PPoint Angle Built flag Orientation flag Insulation spec Error code
SUBROUTINE D3QCPA( ID3DIS, TYPE, NAME, OWNE, LOCK, POS, ORI, SPRE, LSTU, ARRI, LEAV, BUIL, SHOP, ORIL, POSI, ISPE, TSPE, ID3ERR )
ID3DIS, ARRI, LEAV, ID3ERR LOCK, BUIL, SHOP, ORIL, POSI TYPE, NAME, OWNE, SPRE, LSTU, ISPE, TSPE 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 )
ID3DIS, ID3ERR LOCK TYPE, NAME, OWNE, FUNC, DSCO, PTSP, INSC, ISPE POS(3), ORI(3)
Performs the equivalent of a Q ATT for an EQUI. Calls D3RNAM, D3XLEN, D3QCMA, D3RTEX, D3RRA, D3EMSG ID3DIS TYPE OWNE FUNC PTSP POS ISPE ID3ERR Display flag Type Owner name/ref Function Paint spec Position Insulation schedule Error code NAME LOCK DSCO INSC ORI Name Lock flag Design code Inspection schedule Orientation
SUBROUTINE D3QNOZ( ID3DIS, TYPE, NAME, OWNE, LOCK, TEMP, PRES, POS, ORI, CREF, CATR, ANGL, HEIG, RADI, DUTY, ISPE, ID3ERR )
ID3DIS, ID3ERR LOCK TYPE, NAME, OWNE, CREF, CATR, DUTY, ISPE POS(3), ORI(3), TEMP, PRES, HEIG, ANGL, RADI
D:10
12.0
Calls D3RNAM, D3XLEN, D3QCMA, D3RREA, D3RRA, D3RTEX, D3EMSG ID3DIS TYPE OWNE TEMP POS CREF ANGL RADI ISPE Display flag Type Owner name/ref Temperature Position Connection ref Angle Radius Insulation spec NAME LOCK PRES ORI CATR HEIG DUTY ID3ERR Name Lock flag Pressure Orientation Catalogue ref Height Duty Error code
SUBROUTINE D3QBOX( ID3DIS, TYPE, NAME, OWNE, LOCK, XLEN, YLEN, ZLEN, POS, ORI, LEVE, OBST, ID3ERR )
ID3DIS, LEVE(2), OBST, ID3ERR LOCK TYPE, NAME, OWNE POS(3), ORI(3), XLEN, YLEN, ZLEN
Performs the equivalent of a Q ATT for a BOX. Calls D3RNAM, D3XLEN, D3QCMA, D3RREA, D3RRA, D3RIA, D3RINT, D3EMSG ID3DIS TYPE OWNE XLEN ZLEN ORI OBST Display flag Type Owner name/ref X length Z length Orientation Obstruction level NAME LOCK YLEN POS LEVE ID3ERR Name Lock flag Y length Position Drawing level Error code
D:11
12.0
Calls D3RNAM, D3XLEN, D3QCMA, D3EMSG ID3DIS TYPE OWNE ID3ERR Display flag Type Owner name/ref Error code NAME LOCK Name Lock flag
Performs the equivalent of a Q ATT for an SECT. Calls D3RNAM, D3XLEN, D3QCMA, D3EMSG ID3DIS TYPE OWNE ID3ERR Display flag Type Owner name/ref Error code NAME LOCK Name Lock flag
SUBROUTINE D3QCOM( ID3DIS, TYPE, NAME, OWNE, LOCK, GTYP, PTRE, GMRE, ID3NIN, PARA, PARWOR, ID3NOU, ID3ERR ) INTEGER ID3DIS, ID3NIN, ID3NOU, ID3ERR
Performs the equivalent of a Q ATT for a SCOMP Calls D3RNAM, D3XLEN, D3QCMA, D3RWOR, D3RRA, D3UDEH, D3EMSG, D3ERST ID3DIS ID3NIN TYPE OWNE GTYP GMRE Display flag Max number of elements for PARA array Type Owner name/ref Generic type Geometry set ref NAME LOCK PTRE PARA Name Lock flag Point set ref Parameters array
D:12
12.0
Array of dehashed word parameters Number of elements returned in PARA array Error code
SUBROUTINE D3QUNI( ID3DIS, TYPE, NAME, OWNE, LOCK, BUNI, DUNI, DFUN, ID3ERR )
Performs the equivalent of a Q ATT for a UNIT. Calls D3RNAM, D3XLEN, D3QCMA, D3RWOR, D3EMSG, D3ERST ID3DIS TYPE OWNE BUNI DFUN Display flag Type Owner name/ref Bore units Defined units NAME LOCK DUNI ID3ERR Name Lock flag Distance units Error code
Performs the equivalent of a Q ATT for an USEC. Calls D3RNAM, D3XLEN, D3QCMA, D3EMSG ID3DIS TYPE OWNE ID3ERR Display flag Type Owner name/ref Error code NAME LOCK Name Lock flag
SUBROUTINE D3QUDE( ID3DIS, TYPE, NAME, OWNE, LOCK, ABRE, ADEN, MULT, SIGF, DECP, ID3ERR )
INTEGER LOGICAL
D:13
12.0
Performs the equivalent of a Q ATT for a UDEF. Calls D3RNAM, D3XLEN, D3QCMA, D3RTEX, D3RREA, D3RINT, D3EMSG ID3DIS TYPE OWNE ABRE MULT DECP Display flag Type Owner name/ref Abbreviation Multiplier Decimal places NAME LOCK ADEN SIGF ID3ERR Name Lock flag Adend Significant figures Error code
Performs the equivalent of a Q ATT for an MSET. Calls D3RNAM, D3XLEN, D3QCMA, D3EMSG ID3DIS TYPE OWNE ID3ERR Display flag Type Owner name/ref Error code NAME LOCK Name Lock flag
Performs the equivalent of a Q ATT for an MTYP. Calls D3RNAM, D3XLEN, D3QCMA, D3EMSG, D3ERST ID3DIS TYPE Display flag Type NAME Name
D:14
12.0
OWNE UREF
LOCK ID3ERR
Performs the equivalent of a Q ATT for an ATLI. Calls D3RNAM, D3XLEN, D3QCMA, D3RWOR, D3EMSG, D3ERST D3DIS TYPE OWNE ATNA Display flag Type Owner name/ref Atname NAME LOCK ID3ERR Name Lock flag Error code
Performs the equivalent of a Q ATT for an SPWL. Calls D3RNAM, D3XLEN, D3QCMA, D3EMSG ID3DIS TYPE OWNE ID3ERR Display flag Type Owner name/ref Error code NAME LOCK Name Lock flag
SUBROUTINE D3QSPE( ID3DIS, TYPE, NAME, OWNE, LOCK, QUAL, QUES, DEFA, TDEFA, MATR, FLUR, RATI, LNTP, ID3ERR )
ID3DIS, QUAL, ID3ERR LOCK TYPE, NAME, OWNE, QUES, TDEFA, MATR, FLUR, LNTP
D:15
12.0
Performs the equivalent of a Q ATT for a SPEC. Calls D3RNAM, D3XLEN, D3QCMA, D3RINT, D3RWOR, D3RREA, D3EMSG, D3ERST, D3RTEX ID3DIS TYPE OWNE QUAL DEFA MATR RATI ID3ERR Display flag Type Owner name/ref Quality Default Material ref Pressure rating Error code NAME LOCK QUES TDEFA FLUR LNTP Name Lock flag Question Text default Fluid ref Line type
SUBROUTINE D3QSEL( ID3DIS, TYPE, NAME, OWNE, LOCK, QUAL, QUES, ANSW, TANSW, MAXA, DEFA, TDEFA, ID3ERR )
ID3DIS, QUAL, ID3ERR LOCK TYPE, NAME, OWNE, QUES, TANSW, TDEFA ANSW, MAXA, DEFA
Performs the equivalent of a Q ATT for a SELE. Calls D3RNAM, D3XLEN, D3QCMA, D3RINT, D3RWOR, D3EMSG, D3RREA, D3ERST, D3RTEX ID3DIS TYPE OWNE QUAL ANSW MAXA TDEFA Display flag Type Owner name/ref Quality Answer Maxan Text default NAME LOCK QUES TANSW DEFA ID3ERR Name Lock flag Question Text answer Default Error code
SUBROUTINE D3QSPC( ID3DIS, TYPE, NAME, OWNE, LOCK, ANSW, MAXA, TANSW, CATR, CMPR, BLTR, DETR, MATX, ID3ERR )
INTEGER LOGICAL
D:16
12.0
TYPE, NAME, OWNE, TANSW, CATR, CMPR, BLTR, DETR MATX ANSW, MAXA
Performs the equivalent of a Q ATT for a SPCO. Calls D3RNAM, D3XLEN, D3QCMA, D3RREA, D3EMSG, D3ERST, D3RTEX ID3DIS TYPE OWNE ANSW TANSW CMPR DETR ID3ERR Display flag Type Owner name/ref Answer Text answer Component ref Detail text ref Error code NAME LOCK MAXA CATR BLTR MATX Name Lock flag Maxan Catalogue ref Bolt ref Material text ref
Performs the equivalent of a Q ATT for a CCTA. Calls D3RNAM, D3XLEN, D3QCMA, D3EMSG ID3DIS TYPE OWNE ID3ERR Display flag Type Owner name/ref Error code NAME LOCK Name Lock flag
D:17
12.0
Calls D3RNAM, D3XLEN, D3QCMA, D3RWA, D3EMSG ID3DIS TYPE OWNE CTYP Display flag Type Owner name/ref Connection type array NAME LOCK ID3ERR Name Lock flag Error code
SUBROUTINE D3QTUB( ID3DIS, TYPE, NAME, OWNE, LOCK, OUTD, ACBO, BTOL, WTOL, UWEI, UIWE, WDIA, SHAP, RINE, SIF, PRFC, SDTH, CORA, EFAC, PWAS, BFLE, MRKR, ID3ERR )
ID3DIS, ID3ERR LOCK TYPE, NAME, OWNE, MRKR OUTD, ACBO, BTOL, WTOL, WDIA, SHAP, RINE(3) SIF(3), PRFC, SDTH(3), CORA, EFAC, PWAS, BFLE UWEI, UIWE
Performs the equivalent of a Q ATT for a TUBD. Calls D3RNAM, D3XLEN, D3QCDA, D3RREA, D3EMSG ID3DIS TYPE OWNE OUTD BTOL UWEI WDIA RINE PRFC CORA PWAS BFLE MRKR Display flag Type Owner name/ref Outside diameter Bore tolerance Unit pipe weight Wind diameter modulus Rotational inertia Pressure factor Corrosion thickness Percentage waste factor Out of plane flexibility factor for bends 3 way component marker ID3ERR Error code NAME LOCK ACBO WTOL UIWE SHAP SIF SDTH EFAC Name Lock flag Actual bore Wall thickness tolerance Unit insulation weight Shape modulus Stress intensity factor Saddle thickness E-factor
D:18
12.0
SUBROUTINE D3QCMP( ID3DIS, TYPE, NAME, OWNE, LOCK, OUTD, ACBO, BTOL, WTOL, CWEI, CIWE, WDIA, SHAP, RINE, SIF, PRFC, SDTH, CORA, EFAC, PWAS, BFLE, DFFL, DMFL, RMFL, MRKR, ID3ERR )
ID3DIS, ID3ERR LOCK TYPE, NAME, OWNE, MRKR OUTD, ACBO, BTOL, WTOL, WDIA, SHAP, RINE(3), SIF(3), PRFC SDTH(3), CORA, EFAC, PWAS, BFLE, CWEI, CIWE, DFFL(6) DMFL(9), RMFL(6)
Performs the equivalent of a Q ATT for a CMPD. Calls D3RNAM, D3XLEN, D3QCDA, D3RREA, D3RRA, D3EMSG ID3DIS TYPE OWNE OUTD BTOL CWEI WDIA RINE PRFC CORA PWAS BFLE Display flag Type Owner name/ref Outside diameter Bore tolerance Total component weight Wind diameter modulus Rotational inertia Pressure factor Corrosion thickness Percentage waste factor Out of plane flexibility factor for bends NAME LOCK ACBO WTOL CIWE SHAP SIF SDTH EFAC Name Lock flag Actual bore Wall thickness tolerance Total insulation weight Shape modulus Stress intensity factor Saddle thickness E-factor
Next three are parts of flexibility matrix for component DFFL RMFL MRKR Displacement force Rotation moment 3 way component marker ID3ERR Error code DMFL Displacement moment
D:19
12.0
SUBROUTINE D3QCDA( ID3DIS, TYPE, NAME, OWNE, LOCK, OUTD, ACBO, BTOL, WTOL, WDIA, SHAP, RINE, SIF, PRFC, SDTH, CORA, EFAC, PWAS, BFLE, MRKR, ID3ERR )
ID3DIS, ID3ERR LOCK TYPE, NAME, OWNE, MRKR OUTD, ACBO, BTOL, WTOL, WDIA, SHAP, RINE(3) SIF(3), PRFC, SDTH(3), CORA, EFAC, PWAS, BFLE
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 )
ID3DIS, ID3ERR LOCK TYPE, NAME, OWNE, APPL FORC(3), MOME(3), DISP(3), ROTN(3), DLIM(6) RLIM(6), FLIM(3), MLIM(3), DFLF(3), RFLF(3) FCOE(3), CPUL(3), CPUT(3)
Performs the equivalent of a Q ATT for a CONS. Calls D3RNAM, D3XLEN, D3QCMA, D3RTEX, D3RRA, D3EMSG ID3DIS TYPE OWNE APPL MOME ROTN RLIM Display flag Type Owner name/ref Application Moment Rotation Rotation limits NAME LOCK FORC DISP DLIM FLIM Name Lock flag Force Displacement Displacement limits Force limits
D:20
12.0
DFLF
CPUL ID3ERR
SUBROUTINE D3QUDA( ID3DIS, TYPE, NAME, OWNE, LOCK, UKEY, UDNA, ABLE, UTYP, ULEN, DFLT, RPTX, DESC, UUNI, ELEL, MAXE, OUTE, REFL, MAXR, OUTR, ID3ERR )
ID3DIS, ID3ERR, UKEY, ABLE, ULEN, MAXE, OUTE MAXR, OUTR LOCK TYPE, NAME, OWNE, UDNA, UTYP, DFLT, RPTX, DESC UUNI, ELEL(MAXE), REFL(MAXR)
Performs the equivalent of a Q ATT for a UDA in the dictionary database. Calls D3RNAM, D3XLEN, D3QCMA, D3RINT, D3EMSG, D3RTEX, D3RWOR, D3RWA, D3ERST ID3DIS MAXR TYPE OWNE UKEY ABLE ULEN DFLT DESC ELEL OUTE OUTR ID3ERR Display flag Size of REFL array Type Owner name/ref UDA key Min. abbrev. of UDNA NAME LOCK UDNA UTYP Name Lock flag UDA name (without :) UDA type MAXE Size of ELEL array
No. of values if an array or maximum length if TEXT or WORD Default value as text Description Element list No. of elements returned in ELEL No. of elements returned in REFL Error code RPTX UUNI REFL REPORTER text UNITs Reference list
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 D3XLEN Character string Significant length of CD3STR (min 1)
D:22
12.0
Within DARs, multibyte text is input or returned as byte-pairs delimited by 'escape sequences'. These are the 'FECS-IN' and 'FECS-OUT' sequences: FECS-IN sequence : FECS-OUT sequence : '&~' '&' (ISO 2/6, ISO 7/14) '(ISO 2/0, ISO 2/6)
These sequences were carefully selected and meet the following criteria: The FECS-IN sequence does not occur frequently in non-FECs usage The FECS-OUT sequence does not exist as a byte-pair
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
2 byte pairs corresponding to '4A' and ';z' (meaning 'kanji') 4 characters ' def' It is possible for the byte-pair '&~' to occur within a FECs string. Thus, 'abc&~&~4A;z & def' is interpreted as: 3 characters 'abc' 3 byte pairs corresponding to '&~', '4A' and ';z' 4 characters ' def' Using these simple rules, Far Eastern DARs programmers should be able to convert output FECs strings from PDMS format to the format corresponding to their host computer and its peripherals (e.g. for output to a Kanji terminal or printer). It is not necessary for programmers or DARs users to know the layout of the ISO-IR 87 tabulation. The following example program may assist programmers. It is a stand-alone program, using no DARs routines. The user is prompted to enter text strings containing FECS-IN and FECS-OUT sequences. The statement converting single-byte to multibyte is machinespecific.
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) C C C Function to translate FECs string (machine-specific in parts) Program to read, translate and print FECs text
E:2
12.0
CHARACTER*(*) STRING C INTEGER IPOS, OPOS, ILEN, OLEN, IPAIR, IPOSM1, IPOSP1 LOGICAL LFECS C INTRINSIC MIN, MAX, LEN, CHAR, ICHAR ILEN = LEN(STRING) OLEN = LEN(FECS) IPOS = 0 OPOS = 0 FECS = ' ' LFECS = .FALSE. 100 C CONTINUE Consider first (next) character IPOS = IPOS + 1 IF (IPOS .GT. ILEN) GOTO 999 C Skip if remainder is blank (to save time) IF (STRING(IPOS:) .EQ. ' ') GOTO 999 OPOS = OPOS + 1 IF (OPOS .GT. OLEN) GOTO 999 IF (.NOT. LFECS) THEN C C Not already multibyte Test for FECS-IN IPOSM1 = MAX(IPOS-1, 1) IPOSP1 = MIN(IPOS+1, ILEN) IF (STRING(IPOS:IPOSP1) .EQ. '&~' + C .AND. STRING(IPOSM1:IPOS) .NE. '&&') THEN FECS-IN found LFECS = .TRUE. IPOS = IPOS + 2 IF (IPOS .GT. ILEN) GOTO 999
E:3
12.0
IPAIR = 0 ENDIF ENDIF IF (LFECS) THEN C Multibyte portion of text string IPAIR = IPAIR + 1 C If IPAIR is odd (first of a byte-pair), test for FECS-OUT IPOSP1 = MIN(IPOS+1, ILEN) IF (2*(IPAIR/2) .NE. IPAIR + C .AND. STRING(IPOS:IPOSP1) .EQ. ' &') THEN FECS-OUT found LFECS = .FALSE. IPOS = IPOS + 2 IF (IPOS .GT. ILEN) GOTO 999 ENDIF ENDIF C Copy input string to output string IF (LFECS) THEN C C Multibyte portion of text string and not FECOUT Convert to ASCII, convert back add 128 to ASCII value, =
FECS(OPOS:OPOS) CHAR(ICHAR(STRING(IPOS:IPOS)) + 128) ELSE FECS(OPOS:OPOS) = STRING(IPOS:IPOS) ENDIF C Look at next character GOTO 100 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.
Optional declarations INTEGER EXTERNAL EXTERNAL IERR, IPOS D3INIT, D3ERST, D3RTEX, D3RNAM D3EMSG, D3MNUM, FECS, FECST D3MMDB, D3FIN, D3MNAM, 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
Goto each equipment item and read names PRINT*,'Equipment in zone /ZONE1.EQUIP:' IPOS = 0
E:5
12.0
NAME3 = ' ' 100 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 C Convert any FECs in name CNAME = FECS(NAME) PRINT*, ' C ', CNAME
Remember 3rd equipment name IF (IPOS .EQ. 3) THEN NAME3 = NAME CNAME3 = CNAME ENDIF GOTO 100 200 CONTINUE
C C Get attributes of last equipment PRINT*,'Text attributes of ', CNAME CALL FECST('DSCODE') CALL FECST('FUNCTION') CALL FECST('PTSPEC') CALL FECST('INSCHED') C
E:6
12.0
Go to 3rd equipment, by name - then attributes IF (NAME3 .NE. ' ') THEN CALL D3MNAM(NAME3, IERR) IF ( IERR .NE. 0 ) THEN PRINT*, NAME3 GOTO 9000 ENDIF CNAME = CNAME3 NAME3 = ' ' GOTO 200 ENDIF IERR = 0
C C 9000 Exit 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 print
C CHARACTER*(*) CHARACTER*12 CHARACTER*1 INTEGER NAME 0 TEXT, FECS, CTEXT CDUM D3ULEN, IERR
E:7
12.0
EXTERNAL C C
D3ULEN, D3RTEX
FECS,
D3EMSG,
D3ERST,
CALL D3RTEX(NAME, TEXT, IERR) Convert any FECs in name CTEXT = FECS(TEXT) IF (IERR .NE. 0) THEN CTEXT = '??????' CALL D3EMSG(IERR, .TRUE., CDUM) CALL D3ERST ENDIF IF (CTEXT .EQ. ' ') CTEXT = '**unset**' PRINT*, ' RETURN END ', NAME, ': ', CTEXT(:D3ULEN(CTEXT))
The output from the above program appears as follows. Since Aveva has no Kanji printer, Kanji text in this example is indicated by '@' characters.
Equipment in zone /ZONE1.EQUIP: /VESS1 /VESS2 /@@@@@@pump /@@@@@@@@@@@@ /@@@@@@ /@@@@@@111 Text attributes of /@@@@@@111 DSCODE: @@@@ Japan FUNCTION: @@@@@@@@ PTSPEC: Grade 1 @@@@@@ 2 coats INSCHED: @@@@@@ is beautiful Text attributes of /@@@@@@pump DSCODE: **unset** FUNCTION: **unset**
E:8
12.0
E:9
12.0
E:10
12.0
F
F.1
C/C++ Library
Software Issued with DARs C/C++ Library
The DARs C/C++ library is included in with the DARs. The files provided with a PDMS DARs C/C++ library are listed in DARs Library Details
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. ** ** ** ** ** ** ** ** ** **/ Notes: 1. arguments are passed by address. header file for DARS C to FORTRAN interface. The DAR routines are written in FORTRAN but here is the user C/C++ interface d3libc.h
#ifdef __cplusplus
extern "C" void d3erst extern "C" void d3fend extern "C" void d3fin
F:3
12.0
( char *cd3prj, char *cd3usr, char *cd3pas, char *cd3mon, char *cd3wrk, int *id3err ) ; ( char *cd3nam, int *id3pos, int *id3err ) ; ( char *cd3nam, int *id3err ) ; ( char *cd3nm1, char *cd3nm2, int *id3err ) ; ( char *cd3mdb, char *cd3wrk, int *id3err ) ; ( char *cd3nam, int *id3err ) ; ( char *cd3typ, int *id3lis, int *id3err ) ; ( int *id3err ) ; ( int *id3pos, PDMS_DBNAME cd3nam, PDMS_WORD cd3typ, int *id3sta, int *id3err ) ; ( char *cd3pos, char *cd3typ, int *id3err ) ; ( int *id3err ) ; ( int *id3err ) ; ( PDMS_WORD cd3bun, PDMS_WORD cd3dun, int *id3err ) ; ( int *ld3tub, float *rd3box, int *id3err ) ; ( int *id3dat, DARS_RDAT cd3dat, int *id3err ) ; ( char *cd3att, int *id3nin, int *id3ia, int *id3nou, int *id3err ) ; ( char *cd3att, int *id3int, int *id3err ) ; ( char *cd3att, int *id3nin, int *ld3la, int *id3nou, int *id3err ) ; ( char *cd3att, int *ld3log, int *id3err ) ; ( char *cd3att, PDMS_NAME cd3nam, int *id3err ) ;
extern "C" void d3mcdb extern "C" void d3mddb extern "C" void d3medb extern "C" void d3mmdb extern "C" void d3mnam extern "C" void d3mnum extern "C" void d3mown extern "C" void d3mqdb
extern "C" void d3mrel extern "C" void d3mrst extern "C" void d3msav extern "C" void d3rbdu extern "C" void d3rbox extern "C" void d3rdat extern "C" void d3ria
F:4
12.0
( char *cd3crd, float *rd3ori, int *id3err ) ; ( char *cd3poi, char *cd3crd, float *rd3pos, float *rd3dir, float *rd3bor, PDMS_WORD cd3con, int *id3err ) ; ( char *cd3nam, PDMS_TEXT cd3tex, int *id3err ) ; ( char *cd3crd, float *rd3pos, int *id3err ) ; ( char *cd3att, PDMS_RPTX cd3rpt, int *id3err ) ; ( char *cd3att, int *id3nin, float *rd3ra, int *id3nou, int *id3err ) ; ( char *cd3att, float *rd3rea, int *id3err ) ; ( char *cd3att, PDMS_NAME cd3ref, int *id3err ) ; ( char *cd3att, int *id3nin, PDMS_NAME cd3rfa[], int *id3nou, int *id3err ) ; ( char *cd3att, PDMS_TEXT cd3tex, int *id3err ) ; ( PDMS_WORD cd3typ, int *id3err ) ; ( char *cd3typ, int *id3max, PDMS_UDNA cd3nms[], int *id3abv, PDMS_WORD cd3atp[], int *id3num, int *id3err ) ; ( char *cd3att, PDMS_UUNI cd3unt, int *id3err ) ; ( char *cd3att, int *id3nin, PDMS_WORD cd3wa[], int *id3nou, int *id3err ) ; ( char *cd3att, PDMS_WORD cd3wor, int *id3err ) ; ( int *id3uni ) ;
extern "C" void d3rprj extern "C" void d3rprl extern "C" void d3rptx extern "C" void d3rra
extern "C" void d3rrea extern "C" void d3rref extern "C" void d3rrfa
extern "C" void d3rtex extern "C" void d3rtyp extern "C" void d3ruda
F:5
12.0
( char *cd3str, int *id3int, char *cd3bef, char *cd3aft, DARS_CERR cd3err ) ;
/* ** cd3bef and cd3aft MUST be declared same length as cd3str */ extern "C" int d3uctr ( char *cd3str, float *rd3val, char *cd3bef, char *cd3aft, DARS_CERR cd3err ) ; ( int *id3int, PDMS_WORD cd3wor ) ; ( int *id3dat, DARS_RDAT cd3dat ) ; ( int *id3uni ) ; ( int *ready ) ; ( char *cd3dat, int *id3err ) ; ( char *cd3str ) ; ( char *cd3mon ) ;
extern "C" void d3udeh extern "C" void d3udtm extern "C" int d3ugtu extern "C" void d3uini extern "C" int d3ulds extern "C" int d3ulen extern "C" void d3umon
void d3echk void d3emsg void d3erst void d3fend void d3fin void d3init
( char *cd3err ) ; ( int *id3err, int *ld3dis, DARS_MESS cd3msg ) ; ( void ) ; ( void ) ; ( int *id3err ) ; ( char *cd3prj, char *cd3usr, char *cd3pas, char *cd3mon, char *cd3wrk, int *id3err ) ; ( char *cd3nam, int *id3pos, int *id3err ) ; ( char *cd3nam, int *id3err ) ; ( char *cd3nm1, char *cd3nm2, int *id3err ) ; ( char *cd3mdb, char *cd3wrk, int *id3err ) ;
F:6
12.0
( char *cd3nam, int *id3err ) ; ( char *cd3typ, int *id3lis, int *id3err ) ; ( int *id3err ) ; ( int *id3pos, PDMS_DBNAME cd3nam, PDMS_WORD cd3typ, int *id3sta, int *id3err ) ; ( char *cd3pos, char *cd3typ, int *id3err ) ; ( int *id3err ) ; ( int *id3err ) ; ( PDMS_WORD cd3bun, PDMS_WORD cd3dun, int *id3err ) ; ( int *ld3tub, float *rd3box, int *id3err ) ; ( int *id3dat, DARS_RDAT cd3dat, int *id3err ) ; ( char *cd3att, int *id3nin, int *id3ia, int *id3nou, int *id3err ) ; ( char *cd3att, int *id3int, int *id3err ) ; ( char *cd3att, int *id3nin, int *ld3la, int *id3nou, int *id3err ) ; ( char *cd3att, int *ld3log, int *id3err ) ; ( char *cd3att, PDMS_NAME cd3nam, int *id3err ) ; ( char *cd3crd, float *rd3ori, int *id3err ) ; ( char *cd3poi, char *cd3crd, float *rd3pos, float *rd3dir, float *rd3bor, PDMS_WORD cd3con, int *id3err ) ; ( char *cd3nam, PDMS_TEXT cd3tex, int *id3err ) ; ( char *cd3crd, float *rd3pos, int *id3err ) ;
void d3mrel void d3mrst void d3msav void d3rbdu void d3rbox void d3rdat void d3ria
F:7
12.0
( char *cd3att, PDMS_RPTX cd3rpt, int *id3err ) ; ( char *cd3att, int *id3nin, float *rd3ra, int *id3nou, int *id3err ) ; ( char *cd3att, float *rd3rea, int *id3err ) ; ( char *cd3att, PDMS_NAME cd3ref, int *id3err ) ; ( char *cd3att, int *id3nin, PDMS_NAME cd3rfa[], int *id3nou, int *id3err ) ; ( char *cd3att, PDMS_TEXT cd3tex, int *id3err ) ; ( PDMS_WORD cd3typ, int *id3err ) ; ( char *cd3typ, int *id3max, PDMS_UDNA cd3nms[], int *id3abv, PDMS_WORD cd3atp[], int *id3num, int *id3err ) ; ( char *cd3att, PDMS_UUNI cd3unt, int *id3err ) ; ( char *cd3att, int *id3nin, PDMS_WORD cd3wa[], int *id3nou, int *id3err ) ; ( char *cd3att, PDMS_WORD cd3wor, int *id3err ) ; ( int *id3uni ) ;
** cd3bef and cd3aft MUST be declared same length as cd3str */ int d3ucti ( char *cd3str, int *id3int, char *cd3bef, char *cd3aft, DARS_CERR cd3err ) ;
/* ** cd3bef and cd3aft MUST be declared same length as cd3str */ int d3uctr ( char *cd3str, float *rd3val, char *cd3bef, char *cd3aft, DARS_CERR cd3err ) ;
F:8
12.0
void d3udeh void d3udtm int d3ugtu void d3uini int d3ulds int d3ulen void d3umon
( int *id3int, PDMS_WORD cd3wor ) ; ( int *id3dat, DARS_RDAT cd3dat ) ; ( int *id3uni ) ; ( int *ready ) ; ( char *cd3dat, int *id3err ) ; ( char *cd3str ) ; ( 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.
/* ** ** ** ** ** ** ** ** ** */ 1. Strings are defined as being 1 more than in FORTRAN to account for the C string terminator '\0'. Notes: Header file to define some system constants. pdms.h
#ifndef PDMSH
#define PDMSH
F:9
12.0
/* Some constants */ #define #define #define #define #define #define #define #define #define #define #define #define typedef typedef typedef typedef typedef typedef typedef typedef typedef typedef typedef #endif TRUE FALSE PDMSNAMELEN PDMSUDNANAMELEN PDMSWORDLEN PDMSTEXTLEN PDMSRPTXTEXTLEN PDMSUUNITEXTLEN DARSMESSTEXTLEN DARSRDATTEXTLEN DARSCERRTEXTLEN PDMSDBNAMELEN char char char char char char char char char char int PDMSNAME PDMSWORD PDMSTEXT PDMSRPTX PDMSUDNA PDMSUUNI DARSMESS DARSRDAT DARSCERR PDMSDBNAME LOGICAL ; 64 [ PDMSNAMELEN + 1 ] ; [ PDMSWORDLEN + 1 ] ; [ PDMSTEXTLEN + 1 ] ; [ PDMSRPTXTEXTLEN + 1 ] ; [ PDMSUDNANAMELEN + 1 ] ; [ PDMSUUNITEXTLEN + 1 ] ; [ DARSMESSTEXTLEN + 1 ] ; [ DARSRDATTEXTLEN + 1 ] ; [ DARSCERRTEXTLEN + 1 ] ; [ PDMSDBNAMELEN + 1 ] ; 6 1000 20 20 50 20 3 50 13 1 0
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
printf ( "String before: %s\n", cd3bef ) ; printf ( "String after: %s\n", cd3aft ) ; } } 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
if ( params [ i ] >= 531442.0 ) { iparam = params[ i ] ; d3udeh ( &iparam, cd3wor ) ; } if ( strlen ( cd3wor ) == 0 ) /* Not a word; print real value */ printf ( "Element %d: %f\n", i+1, params [ i ] ) ; else /* Valid word; print word */ printf ( "Element %d: %s\n", i+1, cd3wor ) ; } /* Alternatively, use D3RWA directly (non-words don"t give error) */ puts ( "Getting elements with D3RWA" ) ; ival = PARAM_ARRAY_LEN ; d3rwa ( "WPAR", &ival, words, &id3nou, &id3err ) ; for ( i = 0; i < id3nou; i++ ) { if ( strlen ( words [ i ] ) != 0 ) printf ( "Element %d: %s\n", i+1, words [ i ] ) ; } finish: ; /* Cancel monitor and output message */ d3umon ( "NONE" ) ; lval = FALSE ; d3emsg ( &id3err, &lval, cd3msg ) ; printf ( "%s\n", cd3msg ) ; /* Exit project */ d3fin ( &id3err ) ; /* Exit DARs */ d3fend ( ) ; return ; }
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:
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
C
C Program example . . . . . . . . . . . . . . . . . . . . . F:10 C/C++ Header Files . . . . . . . . . . . . . . . . F:2 C/C++ Interface Principles . . . . . . . . . . F:15 C/C++ Library . . . . . . . . . . . . . . . . . . . . . F:1 Character Handling . . . . . . . . . . . . . . . . . 2:2 Compilation and Linking Script . . . . . . . . F:2 Current Element . . . . . . . . . . . . . . . . . . . 3:1
G
General Utility Routines . . . . . . . . . . . . . 5:5
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
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
N
Navigation Routines . . . . . . . . . . . . . . . . 5:1
P
PDMS Data Access . . . . . . . . . . . . . . . . PDMS Database Organisation . . . . . . . . PDMS Database Security . . . . . . . . . . . Program Debugging . . . . . . . . . . . . A:4, Program Running . . . . . . . . . . . . . . A:4, 3:1 3:1 3:1 F:1 F:1
E
Error Codes . . . . . . . . . . . . . . . . . . . . . . .C:1 Error Handling . . . . . . . . . . . . . . . . . . . . . 2:3
Index page 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
and Types . . . . . . . . . . . . . 5:47 Read Orientation of the Current Element 5:32 Read Position of the Current Element 5:37 Read PPOINT Attributes . . . . . . . . 5:34 Read REPORTER Text for a UDA 5:38 Read Unit of Measurement for a Real or Integer UDA . . . . . . . . . . . . . 5:49 Reset Internal Error Flag . . . . . . . . . 5:7 Restore Last Saved Database Position 5:21 Return Error Message . . . . . . . . . . . 5:6 Save Current Database Position . . 5:22 Select MDB . . . . . . . . . . . . . . . . . . 5:14 Switch Error Handling ON and OFF 5:6 Test Latest MDB Date-Stamp . . . . 5:61 Subroutines listing . . . . . . . . . . . . . . . . . . . . . . . . D:2
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