Test fix and tcp connector disconnect bug fix
This commit is contained in:
@@ -34,7 +34,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CrossLamp", "..\Samples\Cro
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TripleAdd", "..\Samples\TripleAdd\TripleAdd.csproj", "{414956B8-DBD4-414C-ABD3-565580739646}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TripleAdd", "..\Samples\TripleAdd\TripleAdd.csproj", "{414956B8-DBD4-414C-ABD3-565580739646}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Modbus.Net.Modbus.SelfDefinedSample", "Modbus.Net.Modbus.SelfDefinedSample\Modbus.Net.Modbus.SelfDefinedSample.csproj", "{C4FA55AF-80ED-4467-948F-8EF865C8A5A5}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Modbus.Net.Modbus.SelfDefinedSample", "Modbus.Net.Modbus.SelfDefinedSample\Modbus.Net.Modbus.SelfDefinedSample.csproj", "{C4FA55AF-80ED-4467-948F-8EF865C8A5A5}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ namespace Modbus.Net
|
|||||||
{
|
{
|
||||||
private static readonly IConfigurationRoot configuration = new ConfigurationBuilder()
|
private static readonly IConfigurationRoot configuration = new ConfigurationBuilder()
|
||||||
.SetBasePath(Directory.GetCurrentDirectory())
|
.SetBasePath(Directory.GetCurrentDirectory())
|
||||||
.AddJsonFile("appsettings.default.json")
|
.AddJsonFile("appsettings.default.json", optional: false, reloadOnChange: true)
|
||||||
.AddJsonFile("appsettings.json")
|
.AddJsonFile("appsettings.json", optional:false, reloadOnChange: true)
|
||||||
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT") ?? Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", true)
|
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT") ?? Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", optional: true, reloadOnChange: true)
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
#nullable enable
|
#nullable enable
|
||||||
|
|||||||
@@ -13,11 +13,11 @@ namespace Modbus.Net
|
|||||||
public class MachineReader
|
public class MachineReader
|
||||||
{
|
{
|
||||||
private static readonly IConfigurationRoot configuration = new ConfigurationBuilder()
|
private static readonly IConfigurationRoot configuration = new ConfigurationBuilder()
|
||||||
.SetBasePath(Directory.GetCurrentDirectory())
|
.SetBasePath(Directory.GetCurrentDirectory())
|
||||||
.AddJsonFile("appsettings.default.json")
|
.AddJsonFile("appsettings.default.json", optional: false, reloadOnChange: true)
|
||||||
.AddJsonFile("appsettings.json")
|
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||||
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT") ?? Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", true)
|
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT") ?? Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", optional: true, reloadOnChange: true)
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 读取设备列表
|
/// 读取设备列表
|
||||||
@@ -107,11 +107,11 @@ namespace Modbus.Net
|
|||||||
class AddressReader
|
class AddressReader
|
||||||
{
|
{
|
||||||
private static readonly IConfigurationRoot configuration = new ConfigurationBuilder()
|
private static readonly IConfigurationRoot configuration = new ConfigurationBuilder()
|
||||||
.SetBasePath(Directory.GetCurrentDirectory())
|
.SetBasePath(Directory.GetCurrentDirectory())
|
||||||
.AddJsonFile("appsettings.default.json")
|
.AddJsonFile("appsettings.default.json", optional: false, reloadOnChange: true)
|
||||||
.AddJsonFile("appsettings.json")
|
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||||
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT") ?? Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", true)
|
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT") ?? Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", optional: true, reloadOnChange: true)
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
public static IEnumerable<AddressUnit<string>> ReadAddresses(string addressMapName)
|
public static IEnumerable<AddressUnit<string>> ReadAddresses(string addressMapName)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ namespace Modbus.Net
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string ConnectionToken => _host;
|
public override string ConnectionToken => _host + ":" + _port;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override int TimeoutTime { get; set; }
|
protected override int TimeoutTime { get; set; }
|
||||||
@@ -145,7 +145,7 @@ namespace Modbus.Net
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override bool Disconnect()
|
public override bool Disconnect()
|
||||||
{
|
{
|
||||||
if (Channel.Open)
|
if (!(Channel?.Open == true))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ namespace Modbus.Net
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public override string ConnectionToken => _host;
|
public override string ConnectionToken => _host + ":" + _port;
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override int TimeoutTime { get; set; }
|
protected override int TimeoutTime { get; set; }
|
||||||
|
|||||||
@@ -8,8 +8,9 @@ namespace MachineJob
|
|||||||
{
|
{
|
||||||
private static readonly IConfigurationRoot configuration = new ConfigurationBuilder()
|
private static readonly IConfigurationRoot configuration = new ConfigurationBuilder()
|
||||||
.SetBasePath(Directory.GetCurrentDirectory())
|
.SetBasePath(Directory.GetCurrentDirectory())
|
||||||
.AddJsonFile("appsettings.json")
|
.AddJsonFile("appsettings.default.json", optional: false, reloadOnChange: true)
|
||||||
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", true)
|
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
|
||||||
|
.AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("DOTNET_ENVIRONMENT") ?? Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Production"}.json", optional: true, reloadOnChange: true)
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
private static readonly string connectionString = configuration.GetConnectionString("DatabaseWriteConnectionString")!;
|
private static readonly string connectionString = configuration.GetConnectionString("DatabaseWriteConnectionString")!;
|
||||||
|
|||||||
@@ -9,7 +9,9 @@ namespace Modbus.Net.Tests
|
|||||||
{
|
{
|
||||||
private List<AddressUnit<int>>? _addressUnits;
|
private List<AddressUnit<int>>? _addressUnits;
|
||||||
|
|
||||||
private BaseMachine<int, int>? _baseMachine2;
|
private BaseMachine<int, int>? _baseMachine;
|
||||||
|
|
||||||
|
private string _machineIp = "10.10.18.251";
|
||||||
|
|
||||||
[TestInitialize]
|
[TestInitialize]
|
||||||
public void Init()
|
public void Init()
|
||||||
@@ -122,13 +124,13 @@ namespace Modbus.Net.Tests
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
_baseMachine2 = new SiemensMachine<int, int>(2, SiemensType.Tcp, "192.168.3.10", SiemensMachineModel.S7_1200, _addressUnits, true, 2, 0)
|
_baseMachine = new SiemensMachine<int, int>(2, SiemensType.Tcp, _machineIp, SiemensMachineModel.S7_1200, _addressUnits, true, 2, 0, 1, 0)
|
||||||
{
|
{
|
||||||
ProjectName = "Project 1",
|
ProjectName = "Project 1",
|
||||||
MachineName = "Test 2"
|
MachineName = "Test 2"
|
||||||
};
|
};
|
||||||
|
|
||||||
_baseMachine2.ConnectAsync().Wait();
|
_baseMachine.ConnectAsync().Wait();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@@ -293,7 +295,7 @@ namespace Modbus.Net.Tests
|
|||||||
[TestCleanup]
|
[TestCleanup]
|
||||||
public void MachineClean()
|
public void MachineClean()
|
||||||
{
|
{
|
||||||
_baseMachine2?.Disconnect();
|
_baseMachine?.Disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,12 +10,14 @@ namespace Modbus.Net.Tests
|
|||||||
|
|
||||||
private BaseMachine<string, string>? _modbusTcpMachine2;
|
private BaseMachine<string, string>? _modbusTcpMachine2;
|
||||||
|
|
||||||
|
private string _machineIp = "10.10.18.251";
|
||||||
|
|
||||||
[TestInitialize]
|
[TestInitialize]
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
_modbusTcpMachine = new ModbusMachine<string, string>("1", ModbusType.Tcp, "127.0.0.1", null, true, 1, 0);
|
_modbusTcpMachine = new ModbusMachine<string, string>("1", ModbusType.Tcp, _machineIp, null, true, 1, 0, Endian.BigEndianLsb);
|
||||||
|
|
||||||
_modbusTcpMachine2 = new ModbusMachine<string, string>("2", ModbusType.Tcp, "127.0.0.1", null, true, 1, 0, Endian.LittleEndianLsb);
|
_modbusTcpMachine2 = new ModbusMachine<string, string>("2", ModbusType.Tcp, _machineIp, null, true, 1, 0, Endian.LittleEndianLsb);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
@@ -47,6 +49,7 @@ namespace Modbus.Net.Tests
|
|||||||
_modbusTcpMachine2!.GetAddresses = addresses;
|
_modbusTcpMachine2!.GetAddresses = addresses;
|
||||||
await _modbusTcpMachine.SetDatasAsync(MachineDataType.Address, dic1);
|
await _modbusTcpMachine.SetDatasAsync(MachineDataType.Address, dic1);
|
||||||
var ans = await _modbusTcpMachine.GetDatasAsync(MachineDataType.Address);
|
var ans = await _modbusTcpMachine.GetDatasAsync(MachineDataType.Address);
|
||||||
|
_modbusTcpMachine.Disconnect();
|
||||||
var ans2 = await _modbusTcpMachine2.GetDatasAsync(MachineDataType.Address);
|
var ans2 = await _modbusTcpMachine2.GetDatasAsync(MachineDataType.Address);
|
||||||
Assert.AreEqual(ans.Datas["4X 1.0"].DeviceValue, dic1["4X 1"]);
|
Assert.AreEqual(ans.Datas["4X 1.0"].DeviceValue, dic1["4X 1"]);
|
||||||
Assert.AreEqual(ans2.Datas["4X 1.0"].DeviceValue, (ushort)dic1["4X 1"] % 256 * 256 + (ushort)dic1["4X 1"] / 256);
|
Assert.AreEqual(ans2.Datas["4X 1.0"].DeviceValue, (ushort)dic1["4X 1"] % 256 * 256 + (ushort)dic1["4X 1"] / 256);
|
||||||
|
|||||||
@@ -7,32 +7,35 @@ namespace Modbus.Net.Tests
|
|||||||
[TestClass]
|
[TestClass]
|
||||||
public class MachineMethodTest
|
public class MachineMethodTest
|
||||||
{
|
{
|
||||||
|
private string _machineIp = "10.10.18.251";
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public void GetUtility()
|
public void GetUtility()
|
||||||
{
|
{
|
||||||
BaseMachine<int, int> baseMachine = new ModbusMachine<int, int>(1, ModbusType.Tcp, "192.168.3.12", null, true, 2, 0);
|
BaseMachine<int, int> baseMachine = new ModbusMachine<int, int>(1, ModbusType.Tcp, _machineIp, null, true, 2, 0);
|
||||||
var utility = baseMachine.GetUtilityMethods<IUtilityMethodDatas>();
|
var utility = baseMachine.GetUtilityMethods<IUtilityMethodDatas>();
|
||||||
var methods = utility.GetType().GetRuntimeMethods();
|
var methods = utility.GetType().GetRuntimeMethods();
|
||||||
Assert.AreEqual(methods.FirstOrDefault(method => method.Name == "GetDataAsync") != null, true);
|
Assert.AreEqual(methods.FirstOrDefault(method => method.Name == "GetDatasAsync") != null, true);
|
||||||
Assert.AreEqual(methods.FirstOrDefault(method => method.Name == "SetDataAsync") != null, true);
|
Assert.AreEqual(methods.FirstOrDefault(method => method.Name == "SetDatasAsync") != null, true);
|
||||||
baseMachine.Disconnect();
|
baseMachine.Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task InvokeUtility()
|
public async Task InvokeUtility()
|
||||||
{
|
{
|
||||||
BaseMachine<int, int> baseMachine = new ModbusMachine<int, int>(1, ModbusType.Tcp, "192.168.3.12", null, true, 2, 0);
|
BaseMachine<int, int> baseMachine = new ModbusMachine<int, int>(1, ModbusType.Tcp, _machineIp, null, true, 2, 0);
|
||||||
var success = await baseMachine.BaseUtility.GetUtilityMethods<IUtilityMethodDatas>().SetDatasAsync("4X 1", new object[] { (byte)11 });
|
await baseMachine.BaseUtility.ConnectAsync();
|
||||||
Assert.AreEqual(success, true);
|
var success = await baseMachine.BaseUtility.GetUtilityMethods<IUtilityMethodDatas>().SetDatasAsync("4X 1", new object[] { (ushort)11 });
|
||||||
|
Assert.AreEqual(success.IsSuccess, true);
|
||||||
var datas = await baseMachine.BaseUtility.GetUtilityMethods<IUtilityMethodDatas>().GetDatasAsync("4X 1", 1);
|
var datas = await baseMachine.BaseUtility.GetUtilityMethods<IUtilityMethodDatas>().GetDatasAsync("4X 1", 1);
|
||||||
Assert.AreEqual(datas.Datas[0], 11);
|
Assert.AreEqual(datas.Datas[1], 11);
|
||||||
baseMachine.Disconnect();
|
baseMachine.Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task InvokeMachine()
|
public async Task InvokeMachine()
|
||||||
{
|
{
|
||||||
BaseMachine<int, int> baseMachine = new ModbusMachine<int, int>(1, ModbusType.Tcp, "192.168.3.10", new List<AddressUnit<int>>
|
BaseMachine<int, int> baseMachine = new ModbusMachine<int, int>(1, ModbusType.Tcp, _machineIp, new List<AddressUnit<int>>
|
||||||
{
|
{
|
||||||
new AddressUnit<int>
|
new AddressUnit<int>
|
||||||
{
|
{
|
||||||
@@ -52,7 +55,7 @@ namespace Modbus.Net.Tests
|
|||||||
"0X 1.0", 1
|
"0X 1.0", 1
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Assert.AreEqual(success, true);
|
Assert.AreEqual(success.IsSuccess, true);
|
||||||
var datas = await baseMachine.GetMachineMethods<IMachineMethodDatas>().GetDatasAsync(MachineDataType.Address);
|
var datas = await baseMachine.GetMachineMethods<IMachineMethodDatas>().GetDatasAsync(MachineDataType.Address);
|
||||||
Assert.AreEqual(datas.Datas["0X 1.0"].DeviceValue, 1);
|
Assert.AreEqual(datas.Datas["0X 1.0"].DeviceValue, 1);
|
||||||
success = await baseMachine.GetMachineMethods<IMachineMethodDatas>().SetDatasAsync(
|
success = await baseMachine.GetMachineMethods<IMachineMethodDatas>().SetDatasAsync(
|
||||||
@@ -63,7 +66,7 @@ namespace Modbus.Net.Tests
|
|||||||
"0X 1.0", 0
|
"0X 1.0", 0
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Assert.AreEqual(success, true);
|
Assert.AreEqual(success.IsSuccess, true);
|
||||||
baseMachine.Disconnect();
|
baseMachine.Disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,20 @@
|
|||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Remove="appsettings.default.json" />
|
||||||
|
<None Remove="appsettings.json" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="appsettings.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
<Content Include="appsettings.default.json">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
|
||||||
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
|
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
|
||||||
|
|||||||
@@ -10,11 +10,13 @@ namespace Modbus.Net.Tests
|
|||||||
|
|
||||||
private BaseMachine<string, string>? _modbusRtuMachine2;
|
private BaseMachine<string, string>? _modbusRtuMachine2;
|
||||||
|
|
||||||
|
private string _machineCom = "COM1";
|
||||||
|
|
||||||
[TestInitialize]
|
[TestInitialize]
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
_modbusRtuMachine1 = new ModbusMachine<string, string>("1", ModbusType.Rtu, "COM1", null, true, 1, 0);
|
_modbusRtuMachine1 = new ModbusMachine<string, string>("1", ModbusType.Rtu, _machineCom, null, true, 1, 0);
|
||||||
_modbusRtuMachine2 = new ModbusMachine<string, string>("2", ModbusType.Rtu, "COM1", null, true, 2, 0);
|
_modbusRtuMachine2 = new ModbusMachine<string, string>("2", ModbusType.Rtu, _machineCom, null, true, 2, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
|
|||||||
@@ -12,14 +12,18 @@ namespace Modbus.Net.Tests
|
|||||||
|
|
||||||
private BaseMachine<string, string>? _modbusAsciiMachine;
|
private BaseMachine<string, string>? _modbusAsciiMachine;
|
||||||
|
|
||||||
|
private string _machineIp = "10.10.18.251";
|
||||||
|
|
||||||
|
private string _machineCom = "COM1";
|
||||||
|
|
||||||
[TestInitialize]
|
[TestInitialize]
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
_modbusTcpMachine = new ModbusMachine<string, string>("1", ModbusType.Tcp, "192.168.3.10", null, true, 2, 0);
|
_modbusTcpMachine = new ModbusMachine<string, string>("1", ModbusType.Tcp, _machineIp, null, true, 2, 0);
|
||||||
|
|
||||||
_modbusRtuMachine = new ModbusMachine<string, string>("2", ModbusType.Rtu, "COM5", null, true, 2, 0);
|
_modbusRtuMachine = new ModbusMachine<string, string>("2", ModbusType.Rtu, _machineCom, null, true, 2, 0);
|
||||||
|
|
||||||
_modbusAsciiMachine = new ModbusMachine<string, string>("3", ModbusType.Ascii, "COM5", null, true, 2, 0);
|
_modbusAsciiMachine = new ModbusMachine<string, string>("3", ModbusType.Ascii, _machineCom, null, true, 2, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
|
|||||||
@@ -8,10 +8,12 @@ namespace Modbus.Net.Tests
|
|||||||
{
|
{
|
||||||
private BaseMachine<string, string>? _siemensTcpMachine;
|
private BaseMachine<string, string>? _siemensTcpMachine;
|
||||||
|
|
||||||
|
private string _machineIp = "10.10.18.251";
|
||||||
|
|
||||||
[TestInitialize]
|
[TestInitialize]
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
_siemensTcpMachine = new SiemensMachine<string, string>("1", SiemensType.Tcp, "192.168.3.10", SiemensMachineModel.S7_1200, null, true, 2, 0);
|
_siemensTcpMachine = new SiemensMachine<string, string>("1", SiemensType.Tcp, _machineIp, SiemensMachineModel.S7_1200, null, true, 2, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
|
|||||||
45
Tests/Modbus.Net.Tests/appsettings.default.json
Normal file
45
Tests/Modbus.Net.Tests/appsettings.default.json
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
{
|
||||||
|
"Modbus.Net": {
|
||||||
|
"TCP": {
|
||||||
|
"ConnectionTimeout": "5000",
|
||||||
|
"FetchSleepTime": "100",
|
||||||
|
"FullDuplex": "False",
|
||||||
|
"Modbus": {
|
||||||
|
"ModbusPort": "502",
|
||||||
|
"IP": "192.168.1.1"
|
||||||
|
},
|
||||||
|
"Siemens": {
|
||||||
|
"SiemensPort": "102",
|
||||||
|
"IP": "192.168.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"UDP": {
|
||||||
|
"ConnectionTimeout": "5000",
|
||||||
|
"FetchSleepTime": "100",
|
||||||
|
"FullDuplex": "False",
|
||||||
|
"Modbus": {
|
||||||
|
"ModbusPort": "502",
|
||||||
|
"IP": "192.168.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"COM": {
|
||||||
|
"FetchSleepTime": "100",
|
||||||
|
"ConnectionTimeout": "5000",
|
||||||
|
"BaudRate": "BaudRate9600",
|
||||||
|
"Parity": "None",
|
||||||
|
"StopBits": "One",
|
||||||
|
"DataBits": "Eight",
|
||||||
|
"Handshake": "None",
|
||||||
|
"FullDuplex": "False",
|
||||||
|
"Modbus": {
|
||||||
|
"COM": "COM1"
|
||||||
|
},
|
||||||
|
"Siemens": {
|
||||||
|
"COM": "COM2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Controller": {
|
||||||
|
"WaitingListCount": "100"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
Tests/Modbus.Net.Tests/appsettings.json
Normal file
3
Tests/Modbus.Net.Tests/appsettings.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user