更新S7协议插件
This commit is contained in:
@@ -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];
|
||||
|
||||
@@ -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", "")]
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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();
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user