PDMS学习笔记材料.docx
《PDMS学习笔记材料.docx》由会员分享,可在线阅读,更多相关《PDMS学习笔记材料.docx(6页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、一、PDMS 安装:pdms win71、setup2、win7 miPDMSI2SP6.253、Project Sample4、Username Sample5、Password sample6、MDB SAMPLE7 Module Design8、ok二、PDMS常用命令:1、命令行清屏Alpha request clear2、记录Fl志Alpha log /C:/log3、输出详细命令$r102/$r4、查询命令Q var5、自动移动到屏幕中央Auto CE6、添加/移除Add/remove CE7、执行宏程序$m C:log.lxt8、显示关联Add all bran within v
2、olume ce9、PML窗口开发位置说明:xmin - xmaxyminIymax10、将字母转换成大写! str. U Pease三、PDMS命令事例:1、AID CYLinder NUM 5 ATE 13113N 8972 D 1150 ORI Z IS UP DIA 400 HEI 200 FILL ON 画出一个圆柱AID CLEAR CYLinder 5删除圆柱详见代码总结附录:PDMS文档翻译:一、导论:a) PMLAVEVA Programmable Macro Language二、变量对象函数方法:a) PML Variables:PML 里,Variables 是个Obje
3、ctb) Object 类型:i. StringReal (no separate integer type)Hi. Booleaniv. Array(hold many values of any type)c) Members and Attributes :d) User-defined Object Types:i. define an object:define object FACTORYmember .Name is STRINGmember. Workers is REALmember .Output is REAL endobjectdefine another object
4、: define object PRODUCT member .Code is STRING member .Total is REAL member.Site is FACTORY endobjectIt is a good idea to use upper case(大 写)for object-type namesObject type definitions should normally he stored in a file with a .pmlohj suffix(后缀)in a directory specified(指定的)in the PMLL1B seavch-pat
5、h(路径) e) Creating Variables (Objects):i. Local and Global Variable(变量)Names:! Surface Area(local variable)!Are a(global variable)字母和数字组合,字母开头,最大16位,同意使用dot(.),但是现在strongly discourage(强烈反对)Notes on Naming C(mventions(约定):you are res pons ible for a voiding name-clashes(命名冲突)give it a meaningful namel
6、imit your use of global variablespossible use PML Functions rather than macros (make use of function return values and output cwguments to return results)Hi. Creating a Variable with a Build-in(内置)Type:!Answer = 42a Global Real variable (因为赋值为 42 是实数,所以系统会识别出Answer是Real型变量,下同)!Natne = Freda Local St
7、ring variable!Ghd = TRUEa Local Boolean variable以下是没有初始化的情况:!Answer = REAL Warne = STRING /Grid = BOOLEAN /Lengths = ARRAY iv. Creating Other Type of Variable : /NewPlant = object FACTORYv. Using the Member Values of an Object: Use the dot notation (符号) /NewPlant = object FACTORY !NewPlanl.Name = Pr
8、ocessA !NewPlant. Workers = 451 !NewP!ant. Output = 2022 /People = INewPlant. Workers f) PML Functions and Methods:函数和方法可以带有参数,可以是内置变量,内置对象,用户自定义对象或者ANY 类型i.定义了一个函数,返回值是REAL,参数是两个REALdefine function !Area( /Length is REAL, /Width is REAL) is REAL ii.函数内部define fund ion !Area( Length is REAL, /Width
9、is REAL) is REAL/Area = /Length x !Width return /Areaendfunction函数调用前,参数必须存在 m.参数可以是一个常数define function !LengthOJName( /Name is STRING) is REALUldyName = !Name, trim return /TidyName. Length endfuriction 调用函数 /Length = !LengthOJNanie( FRED) 修改程序 define function !LenthOfName( /Name is STRING, /Length
10、 is REAL) is REAL/Name = ! Name, trim! Length = !Name.Length endfunction 调用函数 /Name = FRED Length = REAL!LengthAndTrim( FRED !Length)函数中Length会发生变化,函数外的Length也跟着变化,以下调用方法是不 对的,因为函数不能修改常量HLengthAndTrimt FRED 4) $x WRONG当一个PML函数运行时,不能跳到别的PDMS模块:如果函数无法成功结束, 你可以用EXIT退出iv. Storing and Loading PML Functio
11、ns夕卜部文件必须小写,后缀.pmlfnc。调用!ARE A or Harea or !Area都对应area.pmlfnCoThe define function必须在文件的第一行,并且函数名和文件名一致。v. PML程序不返回结果的PML函数define function !Area(! Length is REAL, /Width is REAL, /Result is REAL)/Result = /Length x /Widthendfunction使用方法!SurfaceArea = REAL/PariLength = 7!Part Width = 6call !Area(!Par
12、iLength, /PartWidth, SurfaceArea)因为程序没有返回值,所以不能直接赋值,使用方法/Answer = !SurfaceArea()是必须的,即使没有参数define function UhutialiseHbtaI Weight = 0! MaxWeight = 0endfunctioncall initialise关键字call是可选的,但是推举使用注意:cal/也可以调用Fimctkm,但是在这种情况下,Function的返回值将丧 失。g) A rguments of type A NY:可以指定ANY类型为参数或者返回值类型使用ANY启用了参数类型检查-P
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- PDMS 学习 笔记 材料
限制150内