Baidu Library Home
News
Hom ome e Baidu Libra Library ry
website
Cla lass ssif ific ica ati tion on Professiona Profes sionall Inform Information ation
posted it
know
Edu duccat atio ion n
music
Photos
Gift Gi ftss li libr brar aryy
Library Natural Natur al scienc science e Mathematics
Videos
Map
Pers Pe rson onal al
Wikipedia
Agencies
Feedback Feedb ack Downlo Download ad Client Baidu Home Login Register Register
library
Library
authentication
VIP
PML Training Slides (2 Evaluation)
|
1413 Read
|
College entrance exam notes
7 download
|
Report Documents
VPDVPDVPDVPDProgrammableMacroProgrammableMacroProgrammableM
Document cont
rgbcg Cont Co ntri rib b
Evaluation of do 2
Agenda t
Introductions
t
Objectives
t
Course Format Prerequisites
t
3
Introductions
4
Prerequisites
t
Who am I?
t
Who are you?
t
Text editor ʱ??Notepad ʱ??UltraEdit ʱ??Emacs
ʱ??Company ʱ??Job Description ʱ??Knowledge
t
PDMS Environment ʱ??PMLLIB
of PDMS
ʱ??Expectation of course
work area
ʱ??PDMS project
t
Knowledge of PDMS
t
PDMS 11.4 or above
5
Objectives
6
Course Format
t
Broad overview of the PML language
t
Overview of language syntax
t
t
Terminology
t
Basic coding practices and conventions How PML interacts with the Design model
t
t
How Forms and Menus work with PML
t
Examples Practical Exercises
1
PML Training Slides
Download
Baidu
1
0 download coupons
7
8
Course Contents t
Day 1 - PML Overview and Program Flow Control
t
Day 2 - PML2 Overview - Functions, Forms and Objects
t
Day 3 - Form Creation
t
Day 4 - More Form Creation and User Defined Objects
t
Day 5 - Collections and View Gadgets
PML Overview and Program Flow Control
L
9
PML Overview
t
Macros PML PML1 PML1 -
t
PML2 -
t t
t
Forms Forms
PML Programmable Macro Language
What macros are and how to use them Programmable Macro Language (two parts) First First versio version n of PML PML includ including ing loo loops, ps, if if statements, string handling, labels etc. Object Object orient orientated ated language language builds builds on PML1 and extends the facilities to be like other object based languages (VB, Smalltalk) Most Most appli applicat cation ions s are driven driven by forms forms and and menus. Most PML will be based on a form.
2 / 25
t t t t
PML2 is an Object Oriented Language share to:
t
PML2 is more like other modern languages languages
t
Typically, fewer lines of code needed with PML2
t
Designed to be easier to read and easier to write PML2 allows more powerful and sophisticated applications to be written
Macros are text files containing PDMS commands in sequence PML1 macros are text files containing program statements such as IF statements and DO loops Macros & PML1 Macros are run in PDMS by $ M / FILENAME Arguments may be passed to a macro on on the command command line: $ M / the BUILDBOX 100 200 300means 300means that the extra values after macro name are treated as arguments 1, 23and 3 These can be used within the macro to set PDMS attributes or to perform calculations
11
t
10
download
0 Download coupon
Join VIP, get more privileges 12
PML 2 Jargon P OO
T ME
Functions
DS HO
Rgr ou Rgr ps
Objects
Object Blocks l iab Var
b j mlo ʱp
es am Fr
PMLLIB eT
s y pe To o
ltips
.pmlfrm
c lf n pm ʱ
2
13
Features Of PML2 t
t t t t t t
2
14
PML1: A Simple Macro
Variable Types - STRING, REAL, BOOLEAN & ARRAY Built in methods for commonly used actions
??
ʱ
ʱ
'??
ʱ
Functions - accept arguments and return results User Defined Object Types PML Search Path (% PMLLIB%) Dynamic Loading of Forms, Functions and Objects New Aid objects for geometric modelling
Fifteen
PML1: A Simple Macro with Parameters
16
PML1: More on macros Macros may have up to 9 parameters separated by space $ M / FRED HELLO HOW ARE YOU 55 66 77 88 99 123456789 text strings may be entered as a single parameter using $
to enclose the string: $ M / FRED 5566778899 1 23456
t
ʱ
NEW EQUIP / NEW BOX XLEN YLEN NEW CYL DIA
t
ZLEN HEI
CONN P1 TO P2 OF PREV
act as delimiters and anything in between is interpreted as a single parameter
t
ʱ
17
PML1: Synonyms t
t
t t
Synonyms are abbreviations of longer commands they are created as follows: $ SXXX=NEW ELBO SELECT WITH STYP LR ORI P1 IS N Synonyms can be parameterised $ SYYY= NEW BOX XLEN $ S1YLEN $ S2ZLEN $ S3 To call this: YYY 100 300 2000 This would expand the command YYY to the new box command and interpret the three input values as parameters just like a macro
18
PML1: More on Synonyms t t
t t t
Synonyms may be recursive Example - To change parameter number 6 on a range of components: $ SXXX = PARAM N6 462 $ / NEXT $ / XXX NOTE: $ /ACTS AS A RETURN CHARACTER To kill a synonym $ SXXX = To kill all synonyms $ Sk- BEWARE: this will stop the AVEVA applications from working properly! To switch synonyms off and on $ S-and $ S +
3 3
19
20
PML1: Numbered Variables t
Numbered Variable types. ʱ??var
1 name
ʱ??var
2 'hello'
Before starting this exercise copy the pmllib
ʱ??var
3 (99)
directory identified by your trainer to your C: drive. Then edit the evars.bat file in the% pdmsexe% directory to include your c: \ pmllib directory in the % Pmllib% environment variable.
ʱ??var
ʱ??var
118 (name of owner of owner)
You can now enter PDMS
ʱ??var
119 'hello' + 'world' + 'how are you '
4 (99 * 3/6 + 0.5) ʱ??var 117 pos in site
twenty one
PML1 & PML2: Named Variables
t
twenty two
PML1: Setting Named Variables VAR! FRED NAME
Named variables
'??
ʱ
ʱ??! Variablenameor !! Variablename ʱ??single ʱ?? Means
a local variable
VAR! POS POS IN WORLD
ʱ??double ʱ??Means
t t t
a global variable variable names may be up to 16 characters long and the names can contain alpha and numeric characters
VAR! X 'NAME'
NEVER start a variable name with a number NEVER use '. '(Dot or period) In variable names ''
||
twenty three
PML1: Setting Named Variables (Cont 'd)
twenty four
PML2: Variable Data Types t
There are four basic variable data types:
VAR! Temp(23 * 1.8 + 32) ʱ??STRING
VAR! Listcollect all ELBOW for CE
ʱ??REAL ʱ??BOOLEAN ʱ?? ARRAY
ANY ALPHA NUMERIC CHARACTERS' ' ANY REAL NUMERIC VALUE TRUE or FALSE ANY COMBINATION OF THE ABOVE
Arrays in PML are sparsely populated and heterogeneous
4 4
25
26
PML1: Example of LOCAL -vs- GLOBAL Variables
PML2: Setting Variables To create a LOCAL ʱ?? STRING variable ! Name = 'Fred' To create a GLOBAL ʱ?? REAL variable: !! Answer = 42 To create a GLOBAL ʱ?? BOOLEAN variable:
Run this macro on the command line and see the effect: $ M / c: \ pmllib \ mac1
!! Flag = TRUE To create a LOCAL empty ARRAY ! Values = ARRAY () To create a LOCAL ARRAY with one entry ! Newarray.append ( 'xxx')
27
PML1 & PML2: Using Variables in PDMS Command Syntax
28
PML1 & PML2: Expressions t
To expand PML variables in a PDMS command you need to use a '$' infront of the variable name:
Expressions are calculations using PML variables
Using PML1: VAR! Z ( '$! X' + '$! Y')
! XLEN = 1000 ! YLEN =! XLEN + 100 ! ZLEN =! XLEN + 1000
NOTE: all PML1 variables are STRING data types
Using PML2:
NEW BOX XLEN ! XLEN YLEN ! YLEN ZLEN ! ZLEN
! Z =! X +! Y
29
PML2: Expression Examples t
Expression operators ʱ?? +-/* LT GT EQ NE LE GE ʱ?? NOT AND OR ʱ?? SIN COS TAN SQR POW NEGATE ASIN ACOS ʱ?? ATAN LOG ALOG ABS INT NINT
! S = 30 * sin (45) ! T = pow (20,2) - Raise 20 to the power of 2 ! F = (match (name of owner, 'LPX') gt 0)
30
PML1 & PML2: Operator Precedence ʱ?? ʱ??
+EQ NE GT LT GE LE NOT AND OR Example: (60 * 2/3 + 5) = 45
5 5
Reading has ended, if you download this article requires 0 Download coupon
I want to free download this?
Join VIP Now
download
Documents Free Download coupon download privileges Full stop paying document 20% from One thousand fine eBooks free look
空放贷款
拉卡拉代理商
轻松学理财
干洗技术培训
英国宫房价
电气焊学校
英纳格维修点
怎样开银饰店
招美甲学徒
Today Recommended Funny face big hit Super hilarious jo… Interesting and fu… 89 copies of the document Absolute classic f …
hesis Writing and d… Master's Thesis te… Computer Science… 80 copies of the document Thesis defense un…
2015 pupils winter o… Fun fifth grade la… Integrated Primar… 240 copies of the document Fourth-grade mat…
Your comment 写点评论支持下文档贡献者~ 240
Post a comment
User rating no comments
© 2015 Baidu Baidu before use Privacy Policy | Library Agreement | Site Map