Manual Upgrade PDMS 12.0 para 12.1
Manual Upgrade PDMS 12.0 para 12.1
Manual Upgrade PDMS 12.0 para 12.1
1 Upgrade
AVEVA Solutions Limited
Disclaimer
1.1 AVEVA does not warrant that the use of the AVEVA software will be uninterrupted, error-free or free from viruses.
1.2 AVEVA shall not be liable for: loss of profits; loss of business; depletion of goodwill and/or similar losses; loss of
anticipated savings; loss of goods; loss of contract; loss of use; loss or corruption of data or information; any special,
indirect, consequential or pure economic loss, costs, damages, charges or expenses which may be suffered by the user,
including any loss suffered by the user resulting from the inaccuracy or invalidity of any data created by the AVEVA
software, irrespective of whether such losses are suffered directly or indirectly, or arise in contract, tort (including
negligence) or otherwise.
1.3 AVEVA shall have no liability in contract, tort (including negligence), or otherwise, arising in connection with the
performance of the AVEVA software where the faulty performance of the AVEVA software results from a user's
modification of the AVEVA software. User's rights to modify the AVEVA software are strictly limited to those set out in the
Customisation Manual.
1.4 AVEVA shall not be liable for any breach or infringement of a third party's intellectual property rights where such
breach results from a user's modification of the AVEVA software or associated documentation.
1.5 AVEVA's total liability in contract, tort (including negligence), or otherwise, arising in connection with the performance
of the AVEVA software shall be limited to 100% of the licence fees paid in the year in which the user's claim is brought.
1.6 Clauses 1.1 to 1.5 shall apply to the fullest extent permissible at law.
1.7. In the event of any conflict between the above clauses and the analogous clauses in the software licence under which
the AVEVA software was purchased, the clauses in the software licence shall take precedence.
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, or is validly licensed by, AVEVA Solutions Limited or its subsidiaries.
All rights are reserved to AVEVA Solutions Limited 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 Limited. Where such permission is granted, it expressly requires that this copyright
notice, and the above disclaimer, 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 Limited. Subject to the user's rights, as set out in the
customisation manuals to amend PML software files contained in the PDMSUI and PDMSLIB folders and any
configuration files, the user may not reverse engineer, decompile, copy, or adapt the software. Neither the whole, nor part
of the software described in this publication may be incorporated into any third-party software, product, machine, or
system without the prior written permission of AVEVA Solutions Limited, save as permitted by law. Any such unauthorised
action is strictly prohibited, and may give rise to civil liabilities and criminal prosecution.
The AVEVA software described in this guide is to be installed and operated strictly in accordance with the terms and
conditions of the respective software licences, and in accordance with the relevant User Documentation. Unauthorised or
unlicensed use of the software is strictly prohibited.
© Copyright 1974 to current year. AVEVA Solutions Limited and its subsidiaries. All rights reserved. AVEVA shall not be
liable for any breach or infringement of a third party's intellectual property rights where such breach results from a user's
modification of the AVEVA software or associated documentation.
AVEVA Solutions Limited, High Cross, Madingley Road, Cambridge, CB3 0HB, United Kingdom.
Trademarks
AVEVA and Tribon are registered trademarks of AVEVA Solutions Limited or its subsidiaries. Unauthorised use of the
AVEVA or Tribon trademarks is strictly forbidden.
AVEVA product/software names are trademarks or registered trademarks of AVEVA Solutions Limited or its subsidiaries,
registered in the UK, Europe and other countries (worldwide).
Revision Sheet
Contents Page
Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:1
Core Units (PDMS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:2
Dimensions of Standard Stored and Derived Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:3
Dimensions and their Database Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:7
Units in Project Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:9
Units in Pre-existing Attributes of Physical Quantity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:9
Attributes Stored as Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:13
Units in Catalogue and Design Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:16
Units in Catalogue and Design Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:17
Derived Attributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:18
Units in Datal and Output Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:20
Units in Specon and Spec Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:20
Units and Appware. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:20
A Very Brief Introduction to Units by Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:20
Current Working Units and FORMAT Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:22
What to look out for in PML Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:22
Units Qualifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:24
Testing for Metric or Imperial Distance and Bore Units . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:24
Save and Restore Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:25
Units Conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:26
Remove Units from a REAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:28
Units Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:28
Text Boxes on Forms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:28
Dimension and Units of REAL Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:29
Other Units Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:29
Display Units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:30
New and Modified Units PML Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:31
Units in Schematic Model Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:35
Dimension Support in Schematic Model Manager Prior to 12.1. . . . . . . . . . . . . . . . . . . . . 2:35
Upgrade of Dimensioned Data for Schematic Model Manager in 12.1 . . . . . . . . . . . . . . . 2:36
Units and UDAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2:36
1 Introduction
To prepare a 12.0 project for 12.1 use, a database upgrade is required. To perform the
upgrade the user must do the following:
• Start ADMIN.
• Lock the project.
• Invoke the upgrade process. Refer to Upgrade Commands.
• Unlock the project.
Note: It is not a requirement that Catalogue Projects need to be upgraded. These can
remain at version 12.0.
• Have a method of determining whether or not they have been applied, not relying on
the upgrade number
• This to be available to the user
It will not be possible to backtrack to pre-upgrade sessions.
1.2.2 Global
Each DB must be entirely in either an upgraded or non-upgraded state for PDMS software
to operate. Therefore it is necessary that all extracts of a DB are processed during an
upgrade.
The granularity of an upgrade will be a Project, excluding Foreign DBs.
Q UPGRADE STATUS
This command lists the current upgrade version of all databases in the project and the
upgrade version that the software works on. If databases are on a lower upgrade version
than the software, then the "upgrade required" text accompanies the database.
Q UPGRADE LIST
This command lists all the part upgrades ("item:" in the response) organized per upgrade
version. I.e. a part upgrade belongs to a particular upgrade version. An upgrade version is
the increment we do database upgrades in. The upgrade version is a 8-digit number. So to
upgrade a database to a specific upgrade version, the user can give the command
DBUP DB MYTEAM/MYDB TO 12010103
This command will upgrade the database MYTEAM/MYDB to upgrade version 12010103
including the versions 12010100, 12010101, 12010102. I.e. upgrades versions are applied
sequentially, and it is not possible to skip any intermediate versions.
Global Projects
In Global projects, databases must be upgraded at their primary location. The upgrade must
be run separately at each project location, since any secondary databases will be ignored.
All descendant extracts must be primary at the same location as their master database,
otherwise the database hierarchy will not be upgraded. Such databases can be identified
using the ISEXCP attribute. If a database is primary (ISPRIM TRUE), but not all its extracts
are primary (ISEXCP FALSE), then it will be omitted from a project upgrade.
Additional syntax is available in Global projects to allow for centrally administered system
databases. These cannot be upgraded at the administered location, but must be upgraded
at their primary location:
DBUP SYSTEM FOR locnam TO LATEST
DBUP ALLSYSTEM TO LATEST
Where locnam defines the LOCID, name or reference (gid) of a Location element in a
Global project. This syntax will be available in ADMIN.
The ALLSYSTEM option in a Global project allows all primary system databases to be
upgraded.
Individual satellite system databases may be upgraded using the 'SYSTEM FOR locnam'
syntax provided they are primary. If the Global daemon is running, the upgrade will issue
Global commands to send such administered system databases back to the administered
locations.
It is the responsibility of the System administrator to make sure that updates are run to send
all modified databases to satellites; and to relocate extract databases as required back to
their original primary locations.
In a Global project, the UPGRADE STATUS query (see below) will also show the status of
secondary databases and extract hierarchies. This will help administrators to identify which
extracts will need relocating.
1.5.3 Unicode
At 12.1 new Dabacon databases will, by default, store text in a Unicode encoding; these
may be termed Unicode encoded Databases.
Databases created prior to Unicode enabled PDMS 12.1 to store names, text attributes and
other text strings using an encoding determined by the project settings, which determines
the range of characters that may be present. These may be termed Locally encoded or
Legacy databases since the project settings are set to match a specific locale (Russian,
Chinese etc). By default, the encoding is Ascii ISO8859-1 ("Latin 1").
Such locally encoded databases do not need to be modified or upgraded to be used in 12.1.
They may be opened and read from (for example as Foreign Databases) without restriction,
since the Unicode standard encompasses all existing local encodings. They may also be
written to, with the restriction that character data may only contain characters in the project-
defined encoding. An attempt to write an invalid character (for example a name containing a
Chinese character into a Russian database) will be rejected with an error.
It is important that any project containing locally encoded databases (either directly or as
foreign dbs) has its project settings set explicitly and correctly to make sure that character
data is interpreted correctly.
Unicode encoded databases cannot be opened (for reading or writing) with pre-Unicode
versions of PDMS. However, it is possible to specifically create locally encoded databases if
it is required that they should be accessible by previous versions of PDMS.
In cases where it is required to extend the range of characters that may be used in existing
locally encoded databases, RECONFIGURE may be used to convert it to a Unicode
encoded database.
In the following example legacy DICT dbs (used to hold UDA and UDET names) are
reconfigured to be Unicode encoded. Using a Unicode Executable (12.1) for db MASTER/
DICT (In ADMIN):
FROM DB MASTER/DICT
TO FILE /c:\DICT1 /c:\DICT2
RCFCOPY ALL
RECONFIG SESSIONS
FROM FILE /c:\DICT1 /c:\DICT2
TO DB MASTER/DICT
RECONFIG
Doing it this way means that no deletion and recreation (or copy) is required for the DB, and
therefore no re-adding to the MDB structures is required either. Using RECONFIG
SESSIONS in the FROM phase of the reconfigure operation will preserve both the sessions
and references.
In Summary:
Locally Encoded (Legacy) Databases:
• can be opened for read access in both Unicode and non-Unicode versions of PDMS
• can be opened for write access in both Unicode and non-Unicode versions of PDMS,
but the range of characters which may be used is restricted to the set defined by the
project settings
• require that the project settings are correct so that characters can be interpreted
correctly
• can be reconfigured to a Unicode encoded database
Unicode Encoded Databases:
• cannot be opened for read or write access in pre-Unicode versions of PDMS
• can store the full range of Unicode characters available in Unicode versions of PDMS
Unicode in Plant
All Plant and Schematics code will handle Unicode strings. Administrators may have chosen
to convert all DBs to Unicode as part of their upgrade process, or may decide for each DB
whether and when to upgrade manually, and perform this upgrade using Reconfigure as in
the example above.
2 Units
In earlier versions of PDMS and other Dabacon-based AVEVA products the only physical
dimension which was recognised in the storage of quantities was Length. Length is used for
attributes of type DISTance and BORE, and the derived SQDI (squared length) and CUDI
(cubic length) set via the UNIT field of an Attribute.
Most other Dabacon products had similar restrictions, except for Schematic data imported
via Schematic Model Manager (refer to Units in Schematic Model Manager).
For lengths the values are stored in the database in millimetres. Users can choose which
length units are used in the GUI, from a predetermined set.
Separately for each of the dimensions listed in Angles: - Unit Weights (per distance)
(UMAS) the administrator needs to determine
If all quantities have been stored in the new Database Units
• Set the UUNIT for any UDAs
• Any UDAs used to store the Unit values are no longer required and can be deleted
• Any user appware managing unit conversion or display can be removed or replaced by
standard functions.
If all quantities have been stored in the same unit (which is not the new Database Unit)
• Set the UUNIT for any UDAs
• Output a datal file with the dimensions being set to numeric
UNITS NUMERIC TEMPERATURE
• Read the datal file back in with the current units set appropriately so that unqualified
values are assumed to be in those units:
UNITS DEGF TEMPERATURE
• Any UDAs used to store the Unit values are no longer required and can be deleted
• Any user appware managing unit conversion or display can be removed or replaced by
standard functions
If quantities have been stored in mixed units with a UDA recording the unit for each
• Set the UUNIT for any UDAs
• Set the dimensions to numeric
UNITS NUMERIC TEMPERATURE
• Output a file with the attribute values, with the value from the unit UDA appended
• Check the format of the value plus unit conforms to new input format rules
• If necessary edit the file with a text editor or script to achieve this
• Read the file back in
• Set current units as preferred
UNITS DEGF TEMPERATURE
• Any UDAs used to store the Unit values are no longer required and can be deleted
• Any user appware managing unit conversion or display can be removed or replaced by
standard functions
If quantities have been stored in mixed units with 'custom and practice' being the only record
of the unit
• It is hoped very few users are in this situation
• For the short-term set the dimensions to numeric
• Plan to move to more rigorous use of units, probably employing a combination of the
techniques above.
All attributes that have the UNIT field set for the first time, were until now stored as values
with no specified unit. The units that were associated with their values in the past were
determined by use and convention; and these could change from application to application,
and project to project. This flexibility cannot be supported henceforth and a 'unit of storage'
must be defined. AVEVA are setting the database units to those thought to be most
commonly used in practice, but this will not be universally compatible. Hence the UNITS
NUMERIC command is introduced to disable dimension conversion for selected
dimensions.
If the 12.1 database unit does not agree with values stored in existing project databases,
such data must be converted, or the units of measure of that physical dimension must be set
to NUMERIC to disable dimension conversion for this dimension. Disabling a specific
dimension in this way means that no advantages will be gained from the introduction of that
dimension when working on the projects.
UNITS NUM/ERIC <dimension>
is used to suspend all default unit conversions on input and output for attributes of the
nominated dimension.
• no conversion from the stored value will be made on output
• no unit qualifying strings will be appended to output values
• Input values with no qualifying unit strings will be stored without conversion in the
database
• If input values have a unit qualifying string, then a conversion factor will be applied.
This is of particular value to users who wish to continue storing and using attribute values as
now, and especially when the values stored are assumed by their system to be in units that
are DIFFERENT to those now being assumed by the PDMS or Dabacon system.
For the upgrade to 12.1 users will need to:-
Review all use of dimensions from the table below other than length
• In particular they will need to review their use of density and mass
For each dimension which has been used
• Are all stored quantities in the database unit?
• If not
• Either set UNITS NUMERIC <dimension>
• Or write a script to convert from their stored unit to database units and apply to all
extracts of each DB used by the project. This will need to include Foreign DBs.
Angles:
These attributes are assumed to stored be in Degrees
Bores (BORE)
These attributes are assumed to stored be in mm. As in 12.0
Volumes (CUDI)
These attributes are assumed to stored be in mm3. As in 12.0 most of these are derived
attributes
Currents (CURR)
These attributes are assumed to stored be in Amps
CURRENT
Densities (DENS)
These attributes are assumed to stored be in kg/m3
Voltages (EMF)
These attributes are assumed to stored be in Volts
VOLTAC VOLTDC
Forces (FORC)
These attributes are assumed to stored be in Newtons
EFORFLIMFORCSFOR
Pressures (_PRES)
These attributes are assumed to stored be in Pascals
INPIND PINDEN
Areas (SQDI)
These attributes are assumed to stored be in mm2. As in 12.0, most of these are derived
attributes
XAREA
Temperatures (TEMP)
These attributes are assumed to stored be in degC
TMMI
TGRA
UIWE UWEI
UMIN
OPAR PARA
UDAS
UDAs have their database storage units determined by their UUNIT value which can be any
of the dimension/(also known as UNIT) codes listed above (for example DIST, BORE etc.).
UUNIT can also be a qualified unit value of the required dimension such as 1kg/m3 for
density.
Densities
Densities are particularly important as the system has always assumed that the value is in
kg/m3 and made internal conversions to make sure mass calculations of steelwork from its
computed geometric volume where returned as kg. Some users may have taken advantage
of this and stored densities in lb/m3 to make sure masses were returned in imperial pounds.
Specific and very common examples of this are the many attributes in the geometrical
section of the catalogue which are stored as expressions that resolve to distances (heights,
radii, diameters etc.)
This is not (in 12.1), and never has been, a problem generally as such expressions in the
catalogue are ALWAYS EVALUATED WITH CURRENT UNITS SUSPENDED, and
unqualified values are therefore assumed to be in database units mm. This is not the case in
the properties database.
A list of attributes stored as expressions with new or modified physical dimensions are:
Attributes that have the physical quantity of their values defined by another attribute
(normally PTYPE) are:
If the user has made extensive use of design properties and other typed expressions, such
as in associations, or in the property database, or in the catalogue he should check that they
are dimensionally robust.
In 12.1 this is no longer necessary. If the user enters parameters with a unit qualifier then
this determines the physical dimension of that parameter. Such parameters are always
stored in database units of their physical dimension. The physical dimension persists until
redefined, and impacts any expressions in which the parameter is used.
For such parameters the pseudo attributes that return word and current distance values of
parameters are obsolete and unnecessary as the parameter is known to be a distance or a
word.
However the existing behaviour of un-dimensioned parameters persists in 12.1 and there is
no immediate need to upgrade existing data.
Users' appware, however may need to be reviewed for dimensional robustness once
dimensioned parameters appear in a project.
Stored parameters maintaining this behaviour are:
Some already had the correct dimension, most distances and bores, and many volumes
and areas.
!m = 1kg
Q VAR !m
<REAL> 1kg
Q VAR !m.string()
<STRING> '1kg'
$P $!m
1kg
Q VAR !m.units()
<UNIT> kilogram
Q VAR !m.dimension()
<MEASURE> Mass
-- Now look at the value 1 kg with current working MASS units
set to Pounds
!unitObject = object unit('pound')
!massObject.setunits(!unitObject)
!p = 1kg
Q VAR !p
<REAL> 2.20462262184878lb
Q VAR !p.string()
<STRING> '2.20462262184878lb'
Q VAR !p.units()
<UNIT> pound
Go to a BOX element in the database to see area and volume units being derived from PML
calculations:
q var !!ce.xlen
<REAL> 510mm
!area = !!ce.xlen * !!ce.ylen
!volume = !area * !!ce.zlen
q var !area !volume
<REAL> 102000mm2
<REAL> 23460000mm3
q var !!ce.gvol
<REAL> 23460000mm3
Q VAR !area.units() !area.dimension()
<UNIT> mm2
<MEASURE> Area
Go to a SCTN element with a MATREF set to see a compound unit derived from mass and
distance:
UNITS METRE DIST
q var !!ce.gweight
<REAL> 17.794kg
q var !!ce.cutlength
<REAL> 0.774996172710133metre
!unitWeight = !!ce.gweight / !!ce.cutlength
q var !unitWeight
<REAL> 22.959536446628kg/m
Q VAR !unitWeight.units() !unitWeight.dimension()
<UNIT> kg/m
<MEASURE> UnitMass
Distance Units
PML code has evolved to solve problems with existing distance units in PDMS. Most of this
code has been implemented to allow PDMS to present itself correctly in metric and imperial
distance units. The techniques used by PML developers to present data in the correct units
are varied, so it is difficult to describe every case where code may need to be changed to
work well in 12.1.
There are a few PDMS functions that require all values to be specified in millimetres (the
database storage unit for distance). PML code has to protect users working with imperial
distances from these functions by switching units to MM, executing the function with values
in mm, and then switching back to saved working units. Old techniques used for switching
units do not work with new distance units.
Most PML code assumes that the only metric measure of distance is millimetres. Now the
current distance units can be set to other metric units such as centimetres or metres, and
imperial distance units can be set to decimal feet or yards. So, it is now necessary for PML
code to protect users working in centimetres or metres from functions and data that work
only in millimetres.
New Dimensions
New issues and new opportunities arise with real values stored in PDMS databases that
previously had no physical dimension associated with them. This includes angle, mass,
pressure, density, temperature and the electrical quantities added at PDMS 12.0 for the
cabling application.
The system assumes that all values stored in database attributes that were previously
undimensioned are stored in database units, for example Degrees Centigrade for
temperature, Pascal for pressure, kg for mass. However, there was nothing preventing
users from storing these properties in other units. Some users have stored temperature in
Fahrenheit and mass in pounds, and worse still, they might have stored mixed unit values
for the same dimension in the same Project (for example some temperatures in Fahrenheit
and others in Celsius).
As a PML developer, you need to know that values retrieved from temperature, pressure,
mass, density and angle fields in the database will be assumed to have been stored in
database units and will be converted automatically into the current working units for that
dimension.
For example, a value 212 stored in a temperature attribute before 12.1 will be interpreted as
212degC or 413.6degF when it is retrieved from the database.
Angles
The database unit for angle properties is degrees. No other current angle working angle unit
can be used, but using FORMAT objects it is possible to input and output angles in radians,
grads etc.
Rounding Values
Occasionally values are rounded up, down or to the nearest integer value in PML code. For
imperial distances, there may be the requirement to round values to the nearest 1/32nd
inch. This has been achieved in various ways, for example using int() and nint() functions,
using FORMAT objects with the .DP property set to 0 or .DENOMINATOR property set to
32, or by using the Real object .string('D0') function. This is dangerous where the code
incorrectly assumes that the current value is in MM.
The following code would probably have an undesired result.
UNITS METRES DIST
!distance = 123.45678mm
!displayedDistance = !distance.string('D0') or
!displayedDistance = !distance.int().string()
The result would be <STRING> '0'
Not 123mm or 0.123 metres
$P $!d 12 12mm
Command output (DATAL) files now have unit qualifiers on all united values, which mean
that there are fewer problems to resolve when loading into an imperial units project a DATAL
file that was produced in a project with mm distance units.
The PML writer needs to be aware that pre-12.1 code as follows will need to be changed:
!dist = 12mm
!value = !dist.string() + 'mm'
Q var !value
Before 12.1 the result would be:
<STRING> '12mm'
At 12.1 the result will be:
<STRING> '12mmmm'
At 12.1, the required result is achieved with the simpler
expression:
!value = !dist.string()
This technique will not work in 12.1 for any current distance units other than mm or inch.
Code that tests for imperial or metric units must be replaced by the new !!isImperialLength
PML function or by a PML UNITS object method.
An example of testing a real variable using the new PML Units object:
!metric = !realVariable.dimension().currentUnits().isMetric()
--reset units
$!units
If the current distance unit is Metres or Centimetres, this code will not revert back to the
original distance units. The command $!units will execute the command MM DIST MM
BORE leaving current distance units as MM.
Old PML save and restore units code must be replaced by the new PML COMUNITS object
or the new core UNITS SUSPEND functions.
An alternative method of saving and restoring units is to use the following methods on the
MEASURE object, which are described in the Software Customisation Reference manual:
.suspend()
.unSuspend()
.reinstate()
Or use the equivalent UNITS command:
UNITS SUSPEND
…..
UNITS UNSUSPEND, or UNITS REINSTATE
All current units of ALL DIMENSIONS simultaneously can be suspended and operation
reverts to purely database units (i.e. mm, kg, degC etc.) using the commands UNITS
SUSPEND, UNITS UNSUSPEND (by a single previous suspend), or UNITS REINSTATE to
pop all previous suspends.
Or by PML methods on a measure object:
!measure.suspend(),
!measure.unsuspend(),
!measure.reinstate()
This can avoid the need to save previous units entirely.
However, note that if any current units are set during a suspension, then this setting will be
ignored until the unsuspension, at which point the change will become active.
This means that the width of some input fields on forms must be increased to allow for the
unit qualifier.
ISOU text boxes normally found on old PML 1 forms will be parsed, and in 12.1 all forms of
distance will be accepted (there was only limited parsing of ISOU text boxes prior to 12.1).
Some old forms in the standard product used ISOU text fields for values that were not
distances. This was an error, but it usually went unnoticed. At 12.1 an error is issued if an
ISOU field is used incorrectly. Note that ISOU text gadgets are deprecated and
documentation of how to create them has been removed, but the functionality has not been
removed from the product.
Files written for output and for configuration will have units appended (mainly because the
.string() method and $! and var ! commands will all generate strings with units attached. If
this is not wanted then .value() must be used first remove the unit entirely by making the
number purely numeric.
Q DIMWORD (2 * pi * power(100mm,2))
SQDI
Or
!pos = object POSITION('E' & !x & 'N' & !y & 'U' & !z & 'WRT WORLD')
These expressions will generate an error because the strings would have evaluated to
E100N200U300WRT WORLD before 12.1 - This is valid syntax.
But at 12.1 the string evaluates to
E100mmN200mmU300mmWRT WORLD - which is not valid syntax.
Make sure that there is a space between the real value and the next command word.
Physical Dimension of Quantity PTYPE UNIT field value Global Format Object
Distance (Length) DIST !!distanceFmt
Bore (Length) BORE !!boreFmt
Area SQDI !!areaFmt
Volume CUDI !!volumeFmt
Linear Density PDIS NONE
Surface Density PSQD NONE
Content Density PCUD NONE
Angle ANGL !!angleFmt
Mass MASS !!massFmt
Unit Weight (mass per unit length) UMAS !!unitMassFmt
Density (in PROP db) DENS !!densityFmt
Density (in MANU db) MAND NONE
Temperature gradient (temperature TPDI !!temperatureFmt
per unit length)
Pressure PRES !!pressureFmt
Current CURR !!currentFmt
Physical Dimension of Quantity PTYPE UNIT field value Global Format Object
EMF (i.e. Voltage) EMF !!emfFmt
Impedance IMPE !!impedanceFmt
Time TIME !!timeFmt
Force FORC !!forceFmt
Energy ENER !!energyFmt
Power POWE !!powerFmt
!!COMFORMATS does not support user defined formats for any dimension other than
distance and bore.
All of the new global format objects except for ANGLE track the current working units, so the
display units are tied to the working units, but this may change in future.
Object COMUNITS
Description Handles current working units for PML code.
Methods
The units of a dimensioned value can be converted using the method .convertUnits():
Attribute Mappings are used during the import of diagrams to Schematic Model Manager to
map data in the diagram files to attributes, including provided and custom UDAs, on
schematic elements. Dimensioned attributes had mappings which include an Attribute Type
which would correspond to a mandatory Unit UDA. During the import process the attribute
mappings were used to determine which attributes were populated with data from the
diagram file. If the attribute was dimensioned the unit for that attribute in the diagram file
(which could be specific to the attribute value or set across the whole diagram) was used to
convert the value to the correct value for the units specified in Schematic Model Manager.