描述
以下内容描述了针对TIA Portal Opeess V14 SP1的改动,这可能会影响已有的应用。
API常规修改
变更了TIA Portal Opeess V14 SP1和API的安装路径,所以必须更新V14 SP1 API(Siemens.Engineering, Siemens.Engineering.Hmi)的参考路径。当然,补丁包必须先安装好。
Enabler文件和Usage文件
V14 SP1和更高版本不再需要导入XML文件所必须的 Enabler 文件和 Usage文件 。
文件系统
更改了文件系统访问。尤其涉及到打开文件和导入/导出对象时,要使用 "System.IO.FileInfo"或者"System.IO.DirectoryInfo“。
例如:
V14: Siemens.Engineering.TiaPortal.Projects.Open(System.String)
V14 SP1: Siemens.Engineering.TiaPortal.Projects.Open(System.IO.FileInfo)
对象替换
以下对象被替换为:
- Siemens.Engineering.HW.ISoftwareContainer => Siemens.Engineering.HW.Features.SoftwareContainer
- Siemens.Engineering.HW.SoftwareBase =>Siemens.Engineering.HW.Software
- Siemens.Engineering.HW.IDeviceItem => Siemens.Engineering.HW.DeviceItem
- Siemens.Engineering.HW.IDevice => Siemens.Engineering.HW.Device
- Siemens.Engineering.HW.IHardwareObject => Siemens.Engineering.HW.HardwareObject
- Siemens.Engineering.Library.MasterCopies.IMasterCopyFolder => Siemens.Engineering.Library.MasterCopies.MasterCopyFolder
- Siemens.Engineering.Library.Types.ILibraryTypeFolder => Siemens.Engineering.Library.Types.LibraryTypeFolder
- Siemens.Engineering.Compare.ITargetComparable => Siemens.Engineering.SW.ISoftwareCompareTarget
- Siemens.Engineering.Library.GlobalLibrary => Siemens.Engineering.Library.GlobalLibrary, Siemens.Engineering.Library.UserGlobalLibrary, Siemens.Engineering.Library.CorporateGlobalLibrary, Siemens.Engineering.Library.SystemGlobalLibrary
- Siemens.Engineering.SW.Tags.PlcConstant => Siemens.Engineering.SW.Tags.PlcConstant, Siemens.Engineering.SW.Tags.PlcUserConstant, Siemens.Engineering.SW.Tags.PlcSystemConstant
实例化
更改了库类型的实例化以及从库中复制主模板。
例如:
V14: Siemens.Engineering.Library.Types.LibraryTypeVersion.Instantiate(…)
Siemens.Engineering.Library.MasterCopies.MasterCopy.CopyTo(…)
V14 SP1: CreateFrom(…)方法,例如: Siemens.Engineering.SW.Blocks.PlcBlockComposition.CreateFrom(…)
增加了CreateFrom(...) 函数,去掉 "Siemens.Engineering.Library.MasterCopies.MasterCopyMode"参数 . 功能与"Siemens.Engineering.Library.MasterCopies.MasterCopyMode.Rename" (V14)相同。
产生外部源文件
更改了产生外部源文件函数
例如:
V14: Siemens.Engineering.SW.Types.PlcTypeSystemGroup.GenerateSourceFromTypes(…)
V14 SP1: Siemens.Engineering.SW.ExternalSources.PlcExternalSourceSystemGroup.GenerateSource(…)
对象变化
更改了对象"Siemens.Engineering.Compare.CompareResultElement" 。
类型变化:
- 删除了参数 "PathInformation"
更改了"Siemens.Engineering.Library.GlobalLibrary"对象 。有3个不同库类型继承于全局库。
- User library (Siemens.Engineering.Library.UserGlobalLibrary)
- Corporate library (Siemens.Engineering.Library.CorporateGlobalLibrary)
- System library (Siemens.Engineering.Library.SystemGlobalLibrary)
更多关于全局库的更改:
- 函数 Close() 移到类UserGlobalLibrary中。
- 更改了 "Path"参数。
例如:
V14: String Siemens.Engineering.Library.GlobalLibrary.PathV14 SP1: FileInfo Siemens.Engineering.Library.GlobalLibrary.Path
- 函数更改:
- Siemens.Engineering.Library.Types.LibraryType.UpdateLibrary(…)
- Siemens.Engineering.Library.Types.LibraryType.UpdateProject(…)
- 删除参数:
- Siemens.Engineering.Library.Types.UpdatePathsMode.
行为与 "Siemens.Engineering.Library.Types.UpdatePathsMode.KeepExistingPathsInTarget" (V14)一样。 - Siemens.Engineering.Library.Types.DeleteUnusedVersionsMode.
行为与 "Siemens.Engineering.Library.Types.DeleteUnusedVersionsMode.DoNotDelete" (V14)一样。
创建/更新 TIA博途项目
- Siemens.Engineering.ProjectComposition.Create(...)
- Siemens.Engineering.ProjectComposition.OpenWithUpgrade(...)
创建/打开TIA博途库
- Siemens.Engineering.Library.GlobalLibraryComposition.Create<T>(...)
函数 Open() 被拆分为:
- Siemens.Engineering.Library.GlobalLibraryComposition.Open
(Siemens.Engineering.Library.GlobalLibraryInfo)- Siemens.Engineering.Library.GlobalLibraryComposition.Open
(System.IO.FileInfo, Siemens.Engineering.OpenMode)
建立工艺对象
- Siemens.Engineering.SW.TechnologicalObjects.TechnologicalInstanceDBComposition.Create(...)
建立硬件组态
- Siemens.Engineering.HW.DeviceComposition.CreateWithItem(...)
标准命名空间
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;using Siemens.Engineering;
using Siemens.Engineering.Cax;
using Siemens.Engineering.Compare;
using Siemens.Engineering.Compiler;
using Siemens.Engineering.Hmi;
using Siemens.Engineering.Hmi.Communication;
using Siemens.Engineering.Hmi.Cycle;
using Siemens.Engineering.Hmi.Globalization;
using Siemens.Engineering.Hmi.RuntimeScripting;
using Siemens.Engineering.Hmi.Screen;
using Siemens.Engineering.Hmi.Tag;
using Siemens.Engineering.Hmi.TextGraphicList;
using Siemens.Engineering.HW;
using Siemens.Engineering.HW.Features;
using Siemens.Engineering.HW.Utilities;
using Siemens.Engineering.Library;
using Siemens.Engineering.Library.MasterCopies;
using Siemens.Engineering.Library.Types;
using Siemens.Engineering.Online;
using Siemens.Engineering.SW;
using Siemens.Engineering.SW.Blocks;
using Siemens.Engineering.SW.ExternalSources;
using Siemens.Engineering.SW.Tags;
using Siemens.Engineering.SW.TechnologicalObjects;
using Siemens.Engineering.SW.TechnologicalObjects.Motion;
using Siemens.Engineering.SW.Types;
更多信息
扩展了对象模型
关于 Opeess V14 SP1 的对象模型信息参考在线帮助。
原创文章,作者:ximenziask,如若转载,请注明出处:https://www.zhaoplc.com/plc342278.html