更新S7协议插件

This commit is contained in:
2248356998 qq.com
2023-03-21 13:45:58 +08:00
parent 6a69be8537
commit 73de3ba856
8 changed files with 50 additions and 25 deletions

View File

@@ -84,7 +84,6 @@ namespace ThingsGateway.Foundation.Adapter.Siemens
}
set
{
//TODO:这里优化为ThingsGatewayBitConverter
if (_currentPlc == SiemensEnum.S200 || _currentPlc == SiemensEnum.S200Smart)
{
ISO_CR[17] = BitConverter.GetBytes(value)[1];
@@ -112,7 +111,6 @@ namespace ThingsGateway.Foundation.Adapter.Siemens
}
set
{
//TODO:这里优化为ThingsGatewayBitConverter
if (_currentPlc == SiemensEnum.S200 || _currentPlc == SiemensEnum.S200Smart)
{
ISO_CR[13] = BitConverter.GetBytes(value)[1];

View File

@@ -19,8 +19,8 @@ namespace ThingsGateway.Siemens
[DeviceProperty("端口", "")] public int Port { get; set; } = 102;
public override IThingsGatewayBitConverter ThingsGatewayBitConverter { get => _plc?.ThingsGatewayBitConverter; }
[DeviceProperty("读写超时时间", "")] public ushort TimeOut { get; set; } = 3000;
[DeviceProperty("LocalTASP", "")] public int LocalTASP { get; set; }
[DeviceProperty("DestTSAP", "")] public int DestTSAP { get; set; }
[DeviceProperty("LocalTSAP", "为0时不写入")] public int LocalTSAP { get; set; } = 0;
[DeviceProperty("DestTSAP", "为0时不写入")] public int DestTSAP { get; set; } = 0;
[DeviceMethod("ReadDate", "")]

View File

@@ -20,7 +20,14 @@
_plc.DataFormat = DataFormat;
_plc.ConnectTimeOut = ConnectTimeOut;
_plc.TimeOut = TimeOut;
if(LocalTSAP !=0)
{
_plc.LocalTSAP = LocalTSAP;
}
if(DestTSAP!=0)
{
_plc.DestTSAP = DestTSAP;
}
}

View File

@@ -20,7 +20,14 @@
_plc.DataFormat = DataFormat;
_plc.ConnectTimeOut = ConnectTimeOut;
_plc.TimeOut = TimeOut;
if (LocalTSAP != 0)
{
_plc.LocalTSAP = LocalTSAP;
}
if (DestTSAP != 0)
{
_plc.DestTSAP = DestTSAP;
}
}

View File

@@ -20,7 +20,14 @@
_plc.DataFormat = DataFormat;
_plc.ConnectTimeOut = ConnectTimeOut;
_plc.TimeOut = TimeOut;
if (LocalTSAP != 0)
{
_plc.LocalTSAP = LocalTSAP;
}
if (DestTSAP != 0)
{
_plc.DestTSAP = DestTSAP;
}
}

View File

@@ -20,23 +20,15 @@
_plc.DataFormat = DataFormat;
_plc.ConnectTimeOut = ConnectTimeOut;
_plc.TimeOut = TimeOut;
if (LocalTSAP != 0)
{
_plc.LocalTSAP = LocalTSAP;
}
if (DestTSAP != 0)
{
_plc.DestTSAP = DestTSAP;
}
}
//[Method("HotStart", "热启动")]
//public OperResult HotStart()
//{
// return _plc?.HotStart();
//}
//[Method("ColdStart", "冷启动")]
//public OperResult ColdStart()
//{
// return _plc?.ColdStart();
//}
//[Method("Stop", "停止")]
//public OperResult Stop()
//{
// return _plc?.Stop();
//}
}
}

View File

@@ -20,7 +20,14 @@
_plc.DataFormat = DataFormat;
_plc.ConnectTimeOut = ConnectTimeOut;
_plc.TimeOut = TimeOut;
if (LocalTSAP != 0)
{
_plc.LocalTSAP = LocalTSAP;
}
if (DestTSAP != 0)
{
_plc.DestTSAP = DestTSAP;
}
}

View File

@@ -20,7 +20,14 @@
_plc.DataFormat = DataFormat;
_plc.ConnectTimeOut = ConnectTimeOut;
_plc.TimeOut = TimeOut;
if (LocalTSAP != 0)
{
_plc.LocalTSAP = LocalTSAP;
}
if (DestTSAP != 0)
{
_plc.DestTSAP = DestTSAP;
}
}