reformat project architecture for more extends
This commit is contained in:
@@ -7,6 +7,7 @@ using System.Web.Http;
|
||||
using System.Web.Http.Routing;
|
||||
using CrossLampControl.WebApi.Models;
|
||||
using ModBus.Net;
|
||||
using ModBus.Net.Simense;
|
||||
|
||||
namespace CrossLampControl.WebApi.Controllers
|
||||
{
|
||||
|
||||
@@ -17,74 +17,6 @@ namespace ModBus.Net
|
||||
public abstract KeyValuePair<int,int> AddressTranslate(string address, bool isRead);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// NA200H数据单元翻译器
|
||||
/// </summary>
|
||||
public class AddressTranslatorNA200H : AddressTranslator
|
||||
{
|
||||
protected Dictionary<string, int> TransDictionary;
|
||||
protected Dictionary<string, int> ReadFunctionCodeDictionary;
|
||||
protected Dictionary<string, int> WriteFunctionCodeDictionary;
|
||||
|
||||
public AddressTranslatorNA200H()
|
||||
{
|
||||
TransDictionary = new Dictionary<string, int>
|
||||
{
|
||||
{"Q", 0},
|
||||
{"M", 10000},
|
||||
{"N", 20000},
|
||||
{"I", 0},
|
||||
{"S", 10000},
|
||||
{"IW", 0},
|
||||
{"SW", 5000},
|
||||
{"MW", 0},
|
||||
{"NW", 10000},
|
||||
{"QW", 20000},
|
||||
};
|
||||
ReadFunctionCodeDictionary = new Dictionary<string, int>
|
||||
{
|
||||
{"Q", (int)ModbusProtocalReadDataFunctionCode.ReadCoilStatus},
|
||||
{"M", (int)ModbusProtocalReadDataFunctionCode.ReadCoilStatus},
|
||||
{"N", (int)ModbusProtocalReadDataFunctionCode.ReadCoilStatus},
|
||||
{"I", (int)ModbusProtocalReadDataFunctionCode.ReadInputStatus},
|
||||
{"S", (int)ModbusProtocalReadDataFunctionCode.ReadInputStatus},
|
||||
{"IW", (int)ModbusProtocalReadDataFunctionCode.ReadInputRegister},
|
||||
{"SW", (int)ModbusProtocalReadDataFunctionCode.ReadInputRegister},
|
||||
{"MW", (int)ModbusProtocalReadDataFunctionCode.ReadHoldRegister},
|
||||
{"NW", (int)ModbusProtocalReadDataFunctionCode.ReadHoldRegister},
|
||||
{"QW", (int)ModbusProtocalReadDataFunctionCode.ReadHoldRegister},
|
||||
};
|
||||
WriteFunctionCodeDictionary = new Dictionary<string, int>
|
||||
{
|
||||
{"Q", (int)ModbusProtocalWriteDataFunctionCode.WriteMultiCoil},
|
||||
{"M", (int)ModbusProtocalWriteDataFunctionCode.WriteMultiCoil},
|
||||
{"N", (int)ModbusProtocalWriteDataFunctionCode.WriteMultiCoil},
|
||||
{"MW", (int)ModbusProtocalWriteDataFunctionCode.WriteMultiRegister},
|
||||
{"NW", (int)ModbusProtocalWriteDataFunctionCode.WriteMultiRegister},
|
||||
{"QW", (int)ModbusProtocalWriteDataFunctionCode.WriteMultiRegister},
|
||||
};
|
||||
}
|
||||
|
||||
public override KeyValuePair<int, int> AddressTranslate(string address, bool isRead)
|
||||
{
|
||||
address = address.ToUpper();
|
||||
int i = 0;
|
||||
int t;
|
||||
while (!int.TryParse(address[i].ToString(), out t) && i < address.Length)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
if (i == 0 || i >= address.Length) throw new FormatException();
|
||||
string head = address.Substring(0, i);
|
||||
string tail = address.Substring(i);
|
||||
return isRead
|
||||
? new KeyValuePair<int, int>(TransDictionary[head] + int.Parse(tail) - 1,
|
||||
ReadFunctionCodeDictionary[head])
|
||||
: new KeyValuePair<int, int>(TransDictionary[head] + int.Parse(tail) - 1,
|
||||
WriteFunctionCodeDictionary[head]);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 基本的单元转换器
|
||||
/// </summary>
|
||||
@@ -102,54 +34,4 @@ namespace ModBus.Net
|
||||
throw new FormatException();
|
||||
}
|
||||
}
|
||||
|
||||
public class AddressTranslatorSimense : AddressTranslator
|
||||
{
|
||||
protected Dictionary<string, int> AreaCodeDictionary;
|
||||
|
||||
public AddressTranslatorSimense()
|
||||
{
|
||||
AreaCodeDictionary = new Dictionary<string, int>
|
||||
{
|
||||
{"S", 0x04},
|
||||
{"SM", 0x05},
|
||||
{"AI", 0x06},
|
||||
{"AQ", 0x07},
|
||||
{"C", 0x1E},
|
||||
{"T", 0x1F},
|
||||
{"HC", 0x20},
|
||||
{"I", 0x81},
|
||||
{"Q", 0x82},
|
||||
{"M", 0x83},
|
||||
{"DB", 0x84},
|
||||
{"V", 0x184},
|
||||
};
|
||||
}
|
||||
|
||||
public override KeyValuePair<int, int> AddressTranslate(string address, bool isRead)
|
||||
{
|
||||
address = address.ToUpper();
|
||||
if (address.Substring(0,2) == "DB")
|
||||
{
|
||||
var addressSplit = address.Split('.');
|
||||
if (addressSplit.Length != 2) throw new FormatException();
|
||||
addressSplit[0] = addressSplit[0].Substring(2);
|
||||
if (addressSplit[1].Substring(0, 2) == "DB")
|
||||
addressSplit[1] = addressSplit[1].Substring(2);
|
||||
return new KeyValuePair<int, int>(int.Parse(addressSplit[1]), int.Parse(addressSplit[0]) * 256 + AreaCodeDictionary["DB"]);
|
||||
}
|
||||
int i = 0;
|
||||
int t;
|
||||
while (!int.TryParse(address[i].ToString(), out t) && i < address.Length)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
if (i == 0 || i >= address.Length) throw new FormatException();
|
||||
string head = address.Substring(0, i);
|
||||
string tail = address.Substring(i);
|
||||
return
|
||||
new KeyValuePair<int, int>(int.Parse(tail),
|
||||
AreaCodeDictionary[head]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@@ -44,24 +44,9 @@
|
||||
</Compile>
|
||||
<Compile Include="CRC16.cs" />
|
||||
<Compile Include="IProtocalFormatting.cs" />
|
||||
<Compile Include="ModbusMachine.cs" />
|
||||
<Compile Include="ModbusProtocal.cs" />
|
||||
<Compile Include="ModbusProtocalLinkerBytesExtend.cs" />
|
||||
<Compile Include="ModbusRtuProtocal.cs" />
|
||||
<Compile Include="ModbusRtuProtocalLinker.cs" />
|
||||
<Compile Include="ModbusTcpProtocal.cs" />
|
||||
<Compile Include="ModbusTcpProtocalLinker.cs" />
|
||||
<Compile Include="ModbusUtility.cs" />
|
||||
<Compile Include="ProtocalLinker.cs" />
|
||||
<Compile Include="ProtocalLinkerBytesExtend.cs" />
|
||||
<Compile Include="ProtocalUnit.cs" />
|
||||
<Compile Include="SimenseMachine.cs" />
|
||||
<Compile Include="SimenseProtocal.cs" />
|
||||
<Compile Include="SimenseProtocalLinkerBytesExtend.cs" />
|
||||
<Compile Include="SimenseStructDefinition.cs" />
|
||||
<Compile Include="SimenseTcpProtocal.cs" />
|
||||
<Compile Include="SimenseTcpProtocalLinker.cs" />
|
||||
<Compile Include="SimenseUtility.cs" />
|
||||
<Compile Include="TaskManager.cs" />
|
||||
<Compile Include="TcpConnector.cs" />
|
||||
<Compile Include="TcpProtocalLinker.cs" />
|
||||
@@ -71,9 +56,7 @@
|
||||
<ItemGroup>
|
||||
<None Include="ConfigurationManager.resx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="c:\Users\luosheng\Documents\Projects\Modbus.Net-xamarin\ModBus.Net\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -56,9 +56,10 @@
|
||||
<Compile Include="BaseUtility.cs" />
|
||||
<Compile Include="BaseMachine.cs" />
|
||||
<Compile Include="ComConnector.cs" />
|
||||
<Compile Include="ModbusMachine.cs" />
|
||||
<Compile Include="ModbusProtocalLinkerBytesExtend.cs" />
|
||||
<Compile Include="ModbusUtility.cs" />
|
||||
<Compile Include="Modbus\AddressTranslatorModbus.cs" />
|
||||
<Compile Include="Modbus\ModbusMachine.cs" />
|
||||
<Compile Include="Modbus\ModbusProtocalLinkerBytesExtend.cs" />
|
||||
<Compile Include="Modbus\ModbusUtility.cs" />
|
||||
<Compile Include="ComProtocalLinker.cs" />
|
||||
<Compile Include="ConfigurationManager.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
@@ -68,22 +69,23 @@
|
||||
<Compile Include="BaseConnector.cs" />
|
||||
<Compile Include="CRC16.cs" />
|
||||
<Compile Include="IProtocalFormatting.cs" />
|
||||
<Compile Include="ModbusRtuProtocal.cs" />
|
||||
<Compile Include="ModbusRtuProtocalLinker.cs" />
|
||||
<Compile Include="ModbusTcpProtocalLinker.cs" />
|
||||
<Compile Include="Modbus\ModbusRtuProtocal.cs" />
|
||||
<Compile Include="Modbus\ModbusRtuProtocalLinker.cs" />
|
||||
<Compile Include="Modbus\ModbusTcpProtocalLinker.cs" />
|
||||
<Compile Include="ProtocalLinker.cs" />
|
||||
<Compile Include="ProtocalLinkerBytesExtend.cs" />
|
||||
<Compile Include="ProtocalUnit.cs" />
|
||||
<Compile Include="ModbusProtocal.cs" />
|
||||
<Compile Include="ModbusTcpProtocal.cs" />
|
||||
<Compile Include="Modbus\ModbusProtocal.cs" />
|
||||
<Compile Include="Modbus\ModbusTcpProtocal.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="SimenseMachine.cs" />
|
||||
<Compile Include="SimenseProtocal.cs" />
|
||||
<Compile Include="SimenseStructDefinition.cs" />
|
||||
<Compile Include="SimenseTcpProtocal.cs" />
|
||||
<Compile Include="SimenseProtocalLinkerBytesExtend.cs" />
|
||||
<Compile Include="SimenseTcpProtocalLinker.cs" />
|
||||
<Compile Include="SimenseUtility.cs" />
|
||||
<Compile Include="Simense\AddressTranslatorSimense.cs" />
|
||||
<Compile Include="Simense\SimenseMachine.cs" />
|
||||
<Compile Include="Simense\SimenseProtocal.cs" />
|
||||
<Compile Include="Simense\SimenseStructDefinition.cs" />
|
||||
<Compile Include="Simense\SimenseTcpProtocal.cs" />
|
||||
<Compile Include="Simense\SimenseProtocalLinkerBytesExtend.cs" />
|
||||
<Compile Include="Simense\SimenseTcpProtocalLinker.cs" />
|
||||
<Compile Include="Simense\SimenseUtility.cs" />
|
||||
<Compile Include="TaskManager.cs" />
|
||||
<Compile Include="TcpConnector.cs">
|
||||
<SubType>Code</SubType>
|
||||
@@ -97,6 +99,7 @@
|
||||
<LastGenOutput>ConfigurationManager.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
76
Modbus.Net/ModBus.Net/Modbus/AddressTranslatorModbus.cs
Normal file
76
Modbus.Net/ModBus.Net/Modbus/AddressTranslatorModbus.cs
Normal file
@@ -0,0 +1,76 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ModBus.Net.Modbus
|
||||
{
|
||||
/// <summary>
|
||||
/// NA200H数据单元翻译器
|
||||
/// </summary>
|
||||
public class AddressTranslatorNA200H : AddressTranslator
|
||||
{
|
||||
protected Dictionary<string, int> TransDictionary;
|
||||
protected Dictionary<string, int> ReadFunctionCodeDictionary;
|
||||
protected Dictionary<string, int> WriteFunctionCodeDictionary;
|
||||
|
||||
public AddressTranslatorNA200H()
|
||||
{
|
||||
TransDictionary = new Dictionary<string, int>
|
||||
{
|
||||
{"Q", 0},
|
||||
{"M", 10000},
|
||||
{"N", 20000},
|
||||
{"I", 0},
|
||||
{"S", 10000},
|
||||
{"IW", 0},
|
||||
{"SW", 5000},
|
||||
{"MW", 0},
|
||||
{"NW", 10000},
|
||||
{"QW", 20000},
|
||||
};
|
||||
ReadFunctionCodeDictionary = new Dictionary<string, int>
|
||||
{
|
||||
{"Q", (int)ModbusProtocalReadDataFunctionCode.ReadCoilStatus},
|
||||
{"M", (int)ModbusProtocalReadDataFunctionCode.ReadCoilStatus},
|
||||
{"N", (int)ModbusProtocalReadDataFunctionCode.ReadCoilStatus},
|
||||
{"I", (int)ModbusProtocalReadDataFunctionCode.ReadInputStatus},
|
||||
{"S", (int)ModbusProtocalReadDataFunctionCode.ReadInputStatus},
|
||||
{"IW", (int)ModbusProtocalReadDataFunctionCode.ReadInputRegister},
|
||||
{"SW", (int)ModbusProtocalReadDataFunctionCode.ReadInputRegister},
|
||||
{"MW", (int)ModbusProtocalReadDataFunctionCode.ReadHoldRegister},
|
||||
{"NW", (int)ModbusProtocalReadDataFunctionCode.ReadHoldRegister},
|
||||
{"QW", (int)ModbusProtocalReadDataFunctionCode.ReadHoldRegister},
|
||||
};
|
||||
WriteFunctionCodeDictionary = new Dictionary<string, int>
|
||||
{
|
||||
{"Q", (int)ModbusProtocalWriteDataFunctionCode.WriteMultiCoil},
|
||||
{"M", (int)ModbusProtocalWriteDataFunctionCode.WriteMultiCoil},
|
||||
{"N", (int)ModbusProtocalWriteDataFunctionCode.WriteMultiCoil},
|
||||
{"MW", (int)ModbusProtocalWriteDataFunctionCode.WriteMultiRegister},
|
||||
{"NW", (int)ModbusProtocalWriteDataFunctionCode.WriteMultiRegister},
|
||||
{"QW", (int)ModbusProtocalWriteDataFunctionCode.WriteMultiRegister},
|
||||
};
|
||||
}
|
||||
|
||||
public override KeyValuePair<int, int> AddressTranslate(string address, bool isRead)
|
||||
{
|
||||
address = address.ToUpper();
|
||||
int i = 0;
|
||||
int t;
|
||||
while (!int.TryParse(address[i].ToString(), out t) && i < address.Length)
|
||||
{
|
||||
i++;
|
||||
}
|
||||
if (i == 0 || i >= address.Length) throw new FormatException();
|
||||
string head = address.Substring(0, i);
|
||||
string tail = address.Substring(i);
|
||||
return isRead
|
||||
? new KeyValuePair<int, int>(TransDictionary[head] + int.Parse(tail) - 1,
|
||||
ReadFunctionCodeDictionary[head])
|
||||
: new KeyValuePair<int, int>(TransDictionary[head] + int.Parse(tail) - 1,
|
||||
WriteFunctionCodeDictionary[head]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ModBus.Net
|
||||
namespace ModBus.Net.Modbus
|
||||
{
|
||||
public class ModbusMachine : BaseMachine
|
||||
{
|
||||
@@ -2,43 +2,43 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
internal enum ModbusProtocalVariableFunctionCode : byte
|
||||
namespace ModBus.Net.Modbus
|
||||
{
|
||||
internal enum ModbusProtocalVariableFunctionCode : byte
|
||||
{
|
||||
ReadVariable = 20,
|
||||
WriteVariable = 21,
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 跟时间有关的功能码
|
||||
/// </summary>
|
||||
public enum ModbusProtocalTimeFunctionCode : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// 跟时间有关的功能码
|
||||
/// </summary>
|
||||
public enum ModbusProtocalTimeFunctionCode : byte
|
||||
{
|
||||
GetSystemTime = 3,
|
||||
SetSystemTime = 16,
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 跟读数据有关的功能码
|
||||
/// </summary>
|
||||
public enum ModbusProtocalReadDataFunctionCode : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// 跟读数据有关的功能码
|
||||
/// </summary>
|
||||
public enum ModbusProtocalReadDataFunctionCode : byte
|
||||
{
|
||||
ReadCoilStatus = 1,
|
||||
ReadInputStatus = 2,
|
||||
ReadHoldRegister = 3,
|
||||
ReadInputRegister = 4,
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 跟写数据有关的功能码
|
||||
/// </summary>
|
||||
internal enum ModbusProtocalWriteDataFunctionCode : byte
|
||||
{
|
||||
/// <summary>
|
||||
/// 跟写数据有关的功能码
|
||||
/// </summary>
|
||||
internal enum ModbusProtocalWriteDataFunctionCode : byte
|
||||
{
|
||||
WriteMultiCoil = 15,
|
||||
WriteMultiRegister = 16,
|
||||
}
|
||||
}
|
||||
|
||||
namespace ModBus.Net
|
||||
{
|
||||
public abstract class ModbusProtocal : BaseProtocal
|
||||
{
|
||||
public override bool Connect()
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace ModBus.Net
|
||||
namespace ModBus.Net.Modbus
|
||||
{
|
||||
/// <summary>
|
||||
/// Tcp协议字节伸缩
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
|
||||
namespace ModBus.Net
|
||||
namespace ModBus.Net.Modbus
|
||||
{
|
||||
/// <summary>
|
||||
/// Modbus/Rtu协议
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
namespace ModBus.Net
|
||||
namespace ModBus.Net.Modbus
|
||||
{
|
||||
class ModbusRtuProtocalLinker : ComProtocalLinker
|
||||
{
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
|
||||
namespace ModBus.Net
|
||||
namespace ModBus.Net.Modbus
|
||||
{
|
||||
/// <summary>
|
||||
/// Modbus/Tcp协议
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
|
||||
namespace ModBus.Net
|
||||
namespace ModBus.Net.Modbus
|
||||
{
|
||||
public class ModbusTcpProtocalLinker : TcpProtocalLinker
|
||||
{
|
||||
@@ -1,11 +1,12 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
/// <summary>
|
||||
/// Modbus连接类型
|
||||
/// </summary>
|
||||
public enum ModbusType
|
||||
namespace ModBus.Net.Modbus
|
||||
{
|
||||
/// <summary>
|
||||
/// Modbus连接类型
|
||||
/// </summary>
|
||||
public enum ModbusType
|
||||
{
|
||||
/// <summary>
|
||||
/// Rtu连接
|
||||
/// </summary>
|
||||
@@ -14,10 +15,8 @@ public enum ModbusType
|
||||
/// Tcp连接
|
||||
/// </summary>
|
||||
Tcp = 1,
|
||||
}
|
||||
}
|
||||
|
||||
namespace ModBus.Net
|
||||
{
|
||||
public class ModbusUtility : BaseUtility
|
||||
{
|
||||
private ModbusType _modbusType;
|
||||
@@ -35,5 +35,5 @@ using System.Runtime.InteropServices;
|
||||
// 方法是按如下所示使用“*”:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
[assembly: AssemblyVersion("0.2.5.0716")]
|
||||
[assembly: AssemblyFileVersion("0.2.5.0716")]
|
||||
[assembly: AssemblyVersion("0.2.9.0923")]
|
||||
[assembly: AssemblyFileVersion("0.2.9.0923")]
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ModBus.Net
|
||||
namespace ModBus.Net.Simense
|
||||
{
|
||||
public class SimenseMachine : BaseMachine
|
||||
{
|
||||
@@ -2,8 +2,10 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public enum SimenseTypeCode : byte
|
||||
namespace ModBus.Net.Simense
|
||||
{
|
||||
public enum SimenseTypeCode : byte
|
||||
{
|
||||
Bool = 0x01,
|
||||
Byte = 0x02,
|
||||
Word = 0x03,
|
||||
@@ -11,27 +13,25 @@ public enum SimenseTypeCode : byte
|
||||
C = 0x1E,
|
||||
T = 0x1F,
|
||||
HC = 0x20,
|
||||
};
|
||||
};
|
||||
|
||||
public enum SimenseAccessResult : byte
|
||||
{
|
||||
public enum SimenseAccessResult : byte
|
||||
{
|
||||
NoError = 0xFF,
|
||||
HardwareFault = 0x01,
|
||||
IllegalObjectAccess = 0x03,
|
||||
InvalidAddress = 0x05,
|
||||
DataTypeNotSupport = 0x06,
|
||||
ObjNotExistOrLengthError = 0x0A,
|
||||
};
|
||||
};
|
||||
|
||||
public enum SimenseDataType : byte
|
||||
{
|
||||
public enum SimenseDataType : byte
|
||||
{
|
||||
Error = 0x00,
|
||||
BitAccess = 0x03,
|
||||
OtherAccess = 0x04
|
||||
};
|
||||
};
|
||||
|
||||
namespace ModBus.Net
|
||||
{
|
||||
public abstract class SimenseProtocal : BaseProtocal
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace ModBus.Net
|
||||
namespace ModBus.Net.Simense
|
||||
{
|
||||
public class SimenseTcpProtocalLinkerBytesExtend : ProtocalLinkerBytesExtend
|
||||
{
|
||||
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
|
||||
namespace ModBus.Net
|
||||
namespace ModBus.Net.Simense
|
||||
{
|
||||
public struct TodClockStatus
|
||||
{
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ModBus.Net
|
||||
namespace ModBus.Net.Simense
|
||||
{
|
||||
public class SimenseTcpProtocal : SimenseProtocal
|
||||
{
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace ModBus.Net
|
||||
namespace ModBus.Net.Simense
|
||||
{
|
||||
public class SimenseTcpProtocalLinker : TcpProtocalLinker
|
||||
{
|
||||
@@ -1,25 +1,26 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public enum SimenseType
|
||||
namespace ModBus.Net.Simense
|
||||
{
|
||||
public enum SimenseType
|
||||
{
|
||||
Ppi = 0,
|
||||
Mpi = 1,
|
||||
Tcp = 2
|
||||
};
|
||||
};
|
||||
|
||||
public enum SimenseMachineModel
|
||||
{
|
||||
public enum SimenseMachineModel
|
||||
{
|
||||
S7_200 = 0,
|
||||
S7_200_Smart = 1,
|
||||
S7_300 = 2,
|
||||
S7_400 = 3,
|
||||
S7_1200 = 4,
|
||||
S7_1500 = 5
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
namespace ModBus.Net
|
||||
{
|
||||
public class SimenseUtility : BaseUtility
|
||||
{
|
||||
private byte _tdpuSize;
|
||||
@@ -1,17 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModBus.Net-xamarin", "ModBus.Net\ModBus.Net-xamarin.csproj", "{E97FCE46-855D-498B-8E58-00AFF3A1E760}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{E97FCE46-855D-498B-8E58-00AFF3A1E760}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E97FCE46-855D-498B-8E58-00AFF3A1E760}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E97FCE46-855D-498B-8E58-00AFF3A1E760}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E97FCE46-855D-498B-8E58-00AFF3A1E760}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,19 +0,0 @@
|
||||
<Properties StartupItem="ModBus.Net\ModBus.Net-xamarin.csproj">
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="ModBus.Net\ConfigurationManager.Designer.cs">
|
||||
<Files>
|
||||
<File FileName="ModBus.Net\ValueHelper.cs" Line="1" Column="1" />
|
||||
<File FileName="ModBus.Net\TcpProtocalLinker.cs" Line="1" Column="1" />
|
||||
<File FileName="ModBus.Net\ModbusTcpProtocal.cs" Line="1" Column="1" />
|
||||
<File FileName="ModBus.Net\ConfigurationManager.Designer.cs" Line="1" Column="1" />
|
||||
</Files>
|
||||
</MonoDevelop.Ide.Workbench>
|
||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<BreakpointStore />
|
||||
</MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
|
||||
<DisabledProjects>
|
||||
<String>Modbus.Net-xamarin\Modbus.Net.csproj</String>
|
||||
<String>ModBus.Net\ModBus.Net.csproj</String>
|
||||
</DisabledProjects>
|
||||
</Properties>
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using ModBus.Net;
|
||||
using System.Windows;
|
||||
using ModBus.Net.Simense;
|
||||
|
||||
|
||||
namespace NA200H.UI.WPF
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using ModBus.Net;
|
||||
using ModBus.Net.Simense;
|
||||
|
||||
namespace Simense_S7_200.UI.WPF.TaskTest
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user