sample retest

This commit is contained in:
luosheng
2023-04-20 13:49:43 +08:00
parent 2687cf7cce
commit 78c305d37e
5 changed files with 7 additions and 9 deletions

View File

@@ -55,7 +55,7 @@ namespace AnyType.Controllers
Value = 0,
Type = unitValue.DataType.Name
};
var machine = new ModbusMachine("1", ModbusType.Tcp, "192.168.0.172:502", addressUnits, true, 2, 0);
var machine = new ModbusMachine("1", ModbusType.Tcp, "10.10.18.251:502", addressUnits, true, 2, 0);
//启动任务
await MachineJobSchedulerCreator.CreateScheduler("Trigger1", -1, 1).Result.From(machine.Id, machine, MachineDataType.CommunicationTag).Result.Query("Query1",
returnValues =>

View File

@@ -30,7 +30,7 @@ namespace CrossLamp.Controllers
{
if (_utility == null)
{
_utility = new ModbusUtility(ModbusType.Tcp, "192.168.0.161", 2, 0);
_utility = new ModbusUtility(ModbusType.Tcp, "10.10.18.251", 2, 0);
await _utility.ConnectAsync();
}
Lamp light = new Lamp();

View File

@@ -9,7 +9,7 @@
}
},
"ConnectionStrings": {
"DatabaseWriteConnectionString": "Server=192.168.8.225; User ID=root; Password=123456; Database=modbusnettest;"
"DatabaseWriteConnectionString": "Server=10.10.18.245; User ID=root; Password=123456; Database=modbusnettest;"
},
"Modbus.Net": {
@@ -18,7 +18,7 @@
"a:id": "ModbusMachine1",
"b:protocol": "Modbus",
"c:type": "Tcp",
"d:connectionString": "192.168.8.210",
"d:connectionString": "10.10.18.251",
"e:addressMap": "AddressMapModbus",
"f:keepConnect": true,
"g:slaveAddress": 1,
@@ -29,7 +29,7 @@
"a:id": "SiemensMachine1",
"b:protocol": "Siemens",
"c:type": "Tcp",
"d:connectionString": "192.168.8.210",
"d:connectionString": "10.10.18.251",
"e:model": "S7_1200",
"f:addressMap": "AddressMapSiemens",
"g:keepConnect": true,

View File

@@ -41,7 +41,7 @@ namespace TripleAdd.Controllers
{
if (utility == null)
{
utility = new ModbusUtility(ModbusType.Tcp, "192.168.0.161", 2, 0);
utility = new ModbusUtility(ModbusType.Tcp, "10.10.18.251", 2, 0);
utility.AddressTranslator = new AddressTranslatorModbus();
await utility.ConnectAsync();
}
@@ -54,7 +54,7 @@ namespace TripleAdd.Controllers
{
if (machine == null)
{
machine = new ModbusMachine<string, string>("1", ModbusType.Tcp, "192.168.0.161", new List<AddressUnit>()
machine = new ModbusMachine<string, string>("1", ModbusType.Tcp, "10.10.18.251", new List<AddressUnit>()
{
new AddressUnit() {Id = "1", Area = "4X", Address = 1, CommunicationTag = "Add1", DataType = typeof(ushort), Zoom = 1, DecimalPos = 0},
new AddressUnit() {Id = "2", Area = "4X", Address = 2, CommunicationTag = "Add2", DataType = typeof(ushort), Zoom = 1, DecimalPos = 0},