Commit ea9a9c14 刘韬

清洗流程加上try等待反馈未知错误

1 个父辈 25d5a1d2
...@@ -30,6 +30,6 @@ using log4net.Config; ...@@ -30,6 +30,6 @@ using log4net.Config;
// 内部版本号 // 内部版本号
// 修订号 // 修订号
// //
[assembly: AssemblyVersion("3.3.6.0")] [assembly: AssemblyVersion("3.3.7.0")]
[assembly: AssemblyFileVersion("3.3.6.0")] [assembly: AssemblyFileVersion("3.3.7.0")]
[assembly: log4net.Config.DOMConfigurator(ConfigFileExtension = "config", Watch = true)] [assembly: log4net.Config.DOMConfigurator(ConfigFileExtension = "config", Watch = true)]
...@@ -3,6 +3,7 @@ using System.Threading; ...@@ -3,6 +3,7 @@ using System.Threading;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using log4net.Repository.Hierarchy;
namespace MachineDll namespace MachineDll
{ {
...@@ -108,7 +109,9 @@ namespace MachineDll ...@@ -108,7 +109,9 @@ namespace MachineDll
} }
double data = _ItsSerialPort.ReadAIString("01 03 02 58 00 08 C4 67"); double data = _ItsSerialPort.ReadAIString("01 03 02 58 00 08 C4 67");
return data; var cdata = SerialPortSetting.CurrentConversion(data);
SerialPortSetting.LOGGER.Debug($"IO Return: data:{data}, cov:{cdata}");
return cdata;
} }
public bool ReadX0() public bool ReadX0()
...@@ -125,6 +128,20 @@ namespace MachineDll ...@@ -125,6 +128,20 @@ namespace MachineDll
_ItsSerialPort.SendString(s); _ItsSerialPort.SendString(s);
} }
public double GetOHREC10_Value()
{//读AI数据
if (IsDebug)
{
simulate_data_Enumerator.MoveNext();
return simulate_data_Enumerator.Current;
}
double data = _ItsSerialPort.ReadAIString("02 03 00 80 00 02 C5 E3",100,SerialPortSetting.ByteType.Double_32Bit_Little_endian_ByteSwap);
double temp = _ItsSerialPort.ReadAIString("02 03 00 05 00 01 94 0B",10, SerialPortSetting.ByteType.Int16);
SerialPortSetting.LOGGER.Debug($"IO2 Return: data:{data}, temp:{temp}");
return data;
}
#endregion #endregion
} }
......
...@@ -9,7 +9,7 @@ namespace MachineDll ...@@ -9,7 +9,7 @@ namespace MachineDll
public class TheMachine public class TheMachine
{ {
enum MachineType { enum MachineType {
IO,PLC IO,PLC,IO2
} }
//接受到的数据 //接受到的数据
private int _ReadCount; private int _ReadCount;
...@@ -31,6 +31,10 @@ namespace MachineDll ...@@ -31,6 +31,10 @@ namespace MachineDll
{ {
machineType = MachineType.PLC; machineType = MachineType.PLC;
} }
else if (("IO2").Equals(type))
{
machineType = MachineType.IO2;
}
LOGGER.Info($"port={port},machineType={machineType}"); LOGGER.Info($"port={port},machineType={machineType}");
SerialPortSetting.PortName = port; SerialPortSetting.PortName = port;
} }
...@@ -340,6 +344,8 @@ namespace MachineDll ...@@ -340,6 +344,8 @@ namespace MachineDll
} }
LOGGER.Debug($"IO Return: {returnValue}"); LOGGER.Debug($"IO Return: {returnValue}");
return returnValue; return returnValue;
}else if (machineType == MachineType.IO2) {
return _ItsControllor.GetOHREC10_Value();
} }
else else
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!