导图社区 TIA Openss
这是一篇关于TIA Openss的思维导图,主要内容包括:设备组合Devices,设备项DeviceItems[],设备组Devices[],设备项合DeviceItems,补充PlcBlockSystemGroup,plcTag.cs,plcTagTable.cs,DeviceItem.cs,DeviceModel.cs,AutoLogoff.cs。
编辑于2024-07-04 14:05:48TIA Openss
AccessLevel.cs
属性
string Name
“Full access(no protection)”/"Full access incl.fail-safe(no protection)"/.......
string Tag
“FullAccess”/"FullAccessIncludingFailsafe"/"ReadAccess"/"HMIAccess".......
AutoLogoff.cs
属性
string Name
string Tag
示例
Name="Disable",Tag="Disabled"/Name="1 minute",Tag="Value1Minute"/Name="2 minutes",Tag="Value2Minutes".......
Catalog.cs
属性
List<Device> DeviceItemComposition
PlcBlockSystemGroup
Device.cs
属性
string Station
例如:S7-1500/ET200MP station
string TemplateName
例如:CPU 1516-3 - V1.8
string DeviceName
例如:PLC
string FirmwareVersion
例如:V1.8
bool IncludeFailsafe
例如:0
string Name => DeviceName
设备组合Devices
属性
Read
int Count item数量统计
设备组Devices[]
公共父类
创建方法
CreateWithItem(DeviceItemTypeId, DeviceItemName,DeviceName) 头模块信息参数
DeviceItemTypeId:设备项类型标识符("OrderNumber:" + OrderNumber + "/" + FirmwareVersion)
DeviceItemName:设备项名称(Station Name)
DeviceName:设备名(Name)
DeviceComposition devices = ...; Device device = devices.CreateWithItem("OrderNumber:6ES7 510-1DJ01-0AB0/V2.0", "PLC_1","NewDevice"); Device gsdDevice = devices.CreateWithItem("GSD:SIEM8139.GSD/M/4 ", "GSD Module","NewGsdDevice");
属性
ReadWrite
string Name 设备名
Read
Boolean IsGsd
是否GSD
string TypeIdentifier
例如: System:Device.S71500;HMI为空
Siemens.Engineering.HW.DeviceItemAssociation Items
子类为CPU或者分站
属性
ReadWrite
string Author 作者
Read
string TypeName
例如:S7-1500 station
设备项合DeviceItems
属性
Read
int Count item数量统计
设备项DeviceItems[]
设备操作方法
模块新建移动复制方法(注意需要在对应的导轨或者机架容器下,TypeName为Rack)
创建和插入设备项
Boolean CanPlugNew(String typeIdentifier, String name, Int32 positionNumber)
通过使用操作 CanPlugNew(string typeIdentifier, string name, int positionNumber), 您可以确定是否可以执行创建和插入操作。 如果不能执行, 则操作会返回 false。
如果方法返回“真”,该操作仍然可能会因以下意外原因而失败。
位置编号已由另一个设备项使用
当前设备项无法插入相应位置(尽管该位置空闲)
容器不提供位置编号
设备项的名称已由同一容器中的现有设备项所使用
设备项无法插入到容器
设备在线
HardwareObject PlugNew(String typeIdentifier, String name, Int32 positionNumber)
创建新的设备项并将其插入现有硬件对象中
创建新的子设备项(例如,子模块)并将其插入某一设备项中
将设备项移到另一插槽中
Boolean CanPlugMove(DeviceItem deviceItem, int positionNumber)
用于确定是否可以进行移动。 如果不能进行移动,则 CanPlugMove 将返回“假”。
如果方法返回“真”,该操作仍然可能会因以下意外原因而失败。
位置编号已由另一个设备项使用
当前设备项无法插入相应位置(尽管该位置空闲)
容器不提供位置编号
设备项的名称已由同一容器中的现有设备项所使用
设备项无法插入到容器
设备项无法插入设备项
设备项无法移除设备项
设备在线
HardwareObject PlugMove(DeviceItem deviceItem, int positionNumber)
操作可用于移动现有设备项并将其插入现有硬件对象中
PlugMove 方法在 UI 中模块无法插入的位置插入设备项。 PlugMove 操作完成时会出现编译错误。
复制设备项
Boolean CanPlugCopy(DeviceItem deviceItem, int positionNumber)
操作确定是否可以进行复制。 当无法执行复制操作时, CanPlugCopy 将返回“假”。
如果方法返回“真”,该操作仍然可能会因以下意外原因而失败。
HardwareObject PlugCopy(DeviceItem deviceItem, int positionNumber)
操作将项目中的设备复制并插入现有的硬件
如果无法在 UI 中插入模块,则只有在极少数情况下PlugCopy 方法才能起作用。
当 PlugCopy 成功时, 将返回设备项对象的副本,否则,会出现可恢复的异常情况。
模块更改同类型
Void ChangeType (String typeIdentifier)
仅更改同系列同类型的模块,如ET200SP 8DI更换为16DI,不能更换为其他系列或同系列DO等其他类型模块
删除设备项
Project project = ...; var device = project.UngroupedDevicesGroup.Devices.Find("......"); var deviceItem = device.DeviceItems.First(); // 删除设备项 deviceItem.Delete();
枚举设备项
枚举硬件对象的设备项
private static void EnumerateDeviceItems(HardwareObject hardwareObject) { foreach (DeviceItem deviceItem in hardwareObject.Items) { // add code here } }
通过组合层级进行枚举
private static void EnumerateDeviceItems(Device device) { DeviceItemComposition deviceItemComposition = device.DeviceItems; foreach (DeviceItem deviceItem in deviceItemComposition) { // add code here } }
使用关联枚举设备项
private static void EnumerateDeviceItemsWithAssociation(Device device) { DeviceItemAssociation deviceItemAssociation = device.Items; foreach (DeviceItem deviceItem in deviceItemAssociation) { // add code here } }
访问设备项
访问设备项
public static DeviceItem AccessDeviceItemFromDevice(Device device) { DeviceItem deviceItem = device.DeviceItems[0]; return deviceItem; }
访问设备项的设备项
public static DeviceItem AccessDeviceItemFromDeviceItem(DeviceItem deviceItem) { DeviceItem subDeviceItem = deviceItem.DeviceItems[0]; return subDeviceItem; }
导航至设备项的容器
DeviceItem deviceItem = ...; HardwareObject container = deviceItem.Container;
其他见帮助文档
设置属性
DeviceItem deviceItem = ...; ((IEngineeringObject)deviceItem).SetAttribute("Comment", "This is a comment.");
例如设置ET200SP模块的电位组
DeviceItem deviceItem = ...; //设置为1即为新电位组0为使用左侧模块电位组 ((IEngineeringObject)deviceItem)..SetAttribute("PotentialGroup", 1);
接口操作方法
访问接口
使用该接口, 用户可以访问接口的节点和操作模式
使用枚举 InterfaceOperatingModes 访问接口的属性
InterfaceOperatingModes.None(默认值)
InterfaceOperatingModes.IoDevice(从站)
InterfaceOperatingModes.IoController(主站)
InterfaceOperatingModes.IoDevice or InterfaceOperatingModes.IoController
公共父类
ReadWrite
string Name 设备名
Read
string Classification 设备项所属的分类、 标志枚举
Siemens.Engineering.HW.Device ItemClassifications.None
无分类
Siemens.Engineering.HW.Device ItemClassifications.CPU
设备项为CPU
Siemens.Engineering.HW.Device ItemClassifications.HM
设备项为头模块
Device Container 容器
Boolean IsBuiltIn
对于可由用户创建的对象而言为 FALSE
Boolean IsPlugged
对于已插入的设备而言为 TRUE
int PositionNumber
设备项位置标号
string TypeIdentifier
例如:OrderNumber:6ES7 155-6AU01-0CN0/V4.2
Siemens.Engineering.HW.DeviceItemAssociation Items
子类:头模块CPU(默认均带网口)
ReadWrite
string Author 作者
Boolean ProtectionEnablePutGetCommunication PUT/GET通信访问
int CycleMaximumCycleTime 最大循环时间
范围1....6000ms
int CycleMinimumCycleTime 最小循环时间
Boolean ClockMemoryByte 时钟存储器位
Boolean SystemMemoryByte 系统存储器位
Read
string Classification 设备项所属的分类、 标志枚举
Siemens.Engineering.HW.Device ItemClassifications.CPU
string FirmwareVersion 版本
例如:V1.8,可为空,例如导轨或者无
string OrderNumber
例如:6ES7 515-2AN03-0AB0
string TypeIdentifier
例如:OrderNumber:6ES7 515-2AN03-0AB0/V3.0
string TypeName
CPU 1515-2 PN
GetService<PlcAccessLevelProvider>()
设置/获取访问等级
PlcProtectionAccessLevel 的枚举值
None
0/用于枚举值初始化。该值不得由Openness 用户设置
FullAccess
1
ReadAccess
2
HMIAccess
3
NoAccess
4
FullAccessIncludingFailsa fe
5/仅可用于故障安全 PLC
为无访问权限的 PlcProtectionAccessLevel 使用以下代码示例
DeviceItem S71500PLC = ...; PlcAccessLevelProvider myPlcAccessLevelProvider = S71500PLC.GetService<PlcAccessLevelProvider>(); myPlcAccessLevelProvider.PlcProtectionAccessLevel = PlcProtectionAccessLevel.NoAccess;
GetService<PlcMasterSecretConfigurator>()
保护 PLC 组态数据
取消保护
void Unprotect()方法
保护设置密码,查询PDF文件
补充
ET200SP信号模块
PotentialGroup(电位组)
int:1为新电位组
int:0为使用左侧电位组
Devices[]
TypeIdentifier
(Read, System.String, System:Device.ET200SP)
DeviceItems
DeviceItems[]
子主题
接口
InterfaceOperatingMode
Read, Siemens.Engineering.HW.InterfaceOperatingModes
None
IoController
IoDevice
InterfaceType
Read, Siemens.Engineering.HW.NetType, Ethernet
DeviceItem.cs
属性
string Name 设备名
ReadWrite
string DeviceName
string Classification 设备项所属的分类、 标志枚举
Siemens.Engineering.HW.Device ItemClassifications.None
无分类
Siemens.Engineering.HW.Device ItemClassifications.CPU
设备项为CPU
Siemens.Engineering.HW.Device ItemClassifications.HM
设备项为头模块
Address.cs
属性
string IoType
Siemens.Engineering.HW.ChannelIoType,例如 Input
int Length
模块通道分配总位数
int StartAddress
模块通道起始地址
Channel.cs
属性
string IoType
Siemens.Engineering.HW.ChannelIoType,例如 Input
int Number
通道号
string Type
Siemens.Engineering.HW.ChannelType,例如 Digital
int OperatingRange
针对AI/AO有测量范围的选择,例如+/-10V
int OperatingType
针对AI/AO有测量类型的选择,例如电压/电流
int ReactionToCpuStop
针对AO/DO类型有对CpuStop的响应选择
DeviceModel.cs
属性
int CurrentDeviceCount
Catalog DeviceCatalog
IList<DeviceItem> DeviceItemComposition
方法
public void LoadDeviceCatalog(XDocument catalogDocument)
加载外部设备目录文件
private void InitDeviceCatalog()
初始化设备目录,如设备目录属性不为空则清空
public string GetNamePropertyName()
public string GetDeviceNamePropertyName()
plcTagTable.cs
属性
string Name
plcTag.cs
属性
tagName
变量名称
dataType
数据类型名称
logicalAddress
逻辑地址
comment(注释)
MultilingualTextItems
MultilingualTextItem
language
zh-CN
Text
例如:送风机状态
ExternalVisible
外部可见
ExternalAccessible
外部可访问
ExternalWritable
外部可写
IsSafety
Parent
上一级,为变量表,例如:变量表1