diff --git a/framework/Foundation/ThingsGateway.Foundation.Adapter.Siemens/Siemens/SiemensS7PLC.cs b/framework/Foundation/ThingsGateway.Foundation.Adapter.Siemens/Siemens/SiemensS7PLC.cs index 090ed8b5e..43e1baa7d 100644 --- a/framework/Foundation/ThingsGateway.Foundation.Adapter.Siemens/Siemens/SiemensS7PLC.cs +++ b/framework/Foundation/ThingsGateway.Foundation.Adapter.Siemens/Siemens/SiemensS7PLC.cs @@ -123,34 +123,7 @@ namespace ThingsGateway.Foundation.Adapter.Siemens #region 设置 /// - /// 远程TSAP,需重新连接 - /// - public int DestTSAP - { - get - { - return - _currentPlc == SiemensEnum.S200 || _currentPlc == SiemensEnum.S200Smart ? - (ISO_CR[17] * 256) + ISO_CR[18] : - (ISO_CR[20] * 256) + ISO_CR[21]; - } - set - { - if (_currentPlc == SiemensEnum.S200 || _currentPlc == SiemensEnum.S200Smart) - { - ISO_CR[17] = BitConverter.GetBytes(value)[1]; - ISO_CR[18] = BitConverter.GetBytes(value)[0]; - } - else - { - ISO_CR[20] = BitConverter.GetBytes(value)[1]; - ISO_CR[21] = BitConverter.GetBytes(value)[0]; - } - } - } - - /// - /// 本地TSAP,需重新连接 + /// 本地TSAP /// public int LocalTSAP { diff --git a/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_1200.cs b/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_1200.cs index 853864d25..4b2b424a8 100644 --- a/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_1200.cs +++ b/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_1200.cs @@ -43,9 +43,13 @@ namespace ThingsGateway.Plugin.Siemens { _plc.LocalTSAP = driverPropertys.LocalTSAP; } - if (driverPropertys.DestTSAP != 0) + if (driverPropertys.Rack != 0) { - _plc.DestTSAP = driverPropertys.DestTSAP; + _plc.Rack = driverPropertys.Rack; + } + if (driverPropertys.Slot != 0) + { + _plc.Slot = driverPropertys.Slot; } } diff --git a/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_1500.cs b/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_1500.cs index df62996ff..4f4ab0b75 100644 --- a/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_1500.cs +++ b/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_1500.cs @@ -42,9 +42,13 @@ namespace ThingsGateway.Plugin.Siemens { _plc.LocalTSAP = driverPropertys.LocalTSAP; } - if (driverPropertys.DestTSAP != 0) + if (driverPropertys.Rack != 0) { - _plc.DestTSAP = driverPropertys.DestTSAP; + _plc.Rack = driverPropertys.Rack; + } + if (driverPropertys.Slot != 0) + { + _plc.Slot = driverPropertys.Slot; } } diff --git a/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_200.cs b/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_200.cs index e9fd6b709..9cdf59284 100644 --- a/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_200.cs +++ b/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_200.cs @@ -42,9 +42,13 @@ namespace ThingsGateway.Plugin.Siemens { _plc.LocalTSAP = driverPropertys.LocalTSAP; } - if (driverPropertys.DestTSAP != 0) + if (driverPropertys.Rack != 0) { - _plc.DestTSAP = driverPropertys.DestTSAP; + _plc.Rack = driverPropertys.Rack; + } + if (driverPropertys.Slot != 0) + { + _plc.Slot = driverPropertys.Slot; } } diff --git a/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_200SMART.cs b/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_200SMART.cs index d40bde551..ef77fb138 100644 --- a/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_200SMART.cs +++ b/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_200SMART.cs @@ -42,9 +42,13 @@ namespace ThingsGateway.Plugin.Siemens { _plc.LocalTSAP = driverPropertys.LocalTSAP; } - if (driverPropertys.DestTSAP != 0) + if (driverPropertys.Rack != 0) { - _plc.DestTSAP = driverPropertys.DestTSAP; + _plc.Rack = driverPropertys.Rack; + } + if (driverPropertys.Slot != 0) + { + _plc.Slot = driverPropertys.Slot; } } diff --git a/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_300.cs b/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_300.cs index 141afbcb9..487ff54dc 100644 --- a/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_300.cs +++ b/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_300.cs @@ -42,9 +42,13 @@ namespace ThingsGateway.Plugin.Siemens { _plc.LocalTSAP = driverPropertys.LocalTSAP; } - if (driverPropertys.DestTSAP != 0) + if (driverPropertys.Rack != 0) { - _plc.DestTSAP = driverPropertys.DestTSAP; + _plc.Rack = driverPropertys.Rack; + } + if (driverPropertys.Slot != 0) + { + _plc.Slot = driverPropertys.Slot; } } diff --git a/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_400.cs b/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_400.cs index 6fffc7ba1..60247eb22 100644 --- a/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_400.cs +++ b/framework/Plugin/ThingsGateway.Plugin.Siemens/S7_400.cs @@ -42,9 +42,13 @@ namespace ThingsGateway.Plugin.Siemens { _plc.LocalTSAP = driverPropertys.LocalTSAP; } - if (driverPropertys.DestTSAP != 0) + if (driverPropertys.Rack != 0) { - _plc.DestTSAP = driverPropertys.DestTSAP; + _plc.Rack = driverPropertys.Rack; + } + if (driverPropertys.Slot != 0) + { + _plc.Slot = driverPropertys.Slot; } } diff --git a/framework/Plugin/ThingsGateway.Plugin.Siemens/SiemensProperty.cs b/framework/Plugin/ThingsGateway.Plugin.Siemens/SiemensProperty.cs index cad2f6de2..f5eddaa35 100644 --- a/framework/Plugin/ThingsGateway.Plugin.Siemens/SiemensProperty.cs +++ b/framework/Plugin/ThingsGateway.Plugin.Siemens/SiemensProperty.cs @@ -37,13 +37,19 @@ public class SiemensProperty : CollectDriverPropertyBase /// [DeviceProperty("默认解析顺序", "")] public DataFormat DataFormat { get; set; } /// - /// DestTSAP + /// Rack /// - [DeviceProperty("DestTSAP", "为0时不写入,通常默认0即可")] public int DestTSAP { get; set; } = 0; + [DeviceProperty("机架号", "为0时不写入")] public byte Rack { get; set; } = 0; + /// + /// Slot + /// + [DeviceProperty("槽位号", "为0时不写入")] public byte Slot { get; set; } = 0; + /// /// LocalTSAP /// [DeviceProperty("LocalTSAP", "为0时不写入,通常默认0即可")] public int LocalTSAP { get; set; } = 0; + /// /// ///