Critial Bug Fix in Connector. Samples Bug Fix.
This commit is contained in:
@@ -41,7 +41,7 @@ namespace TripleAdd.Controllers
|
||||
{
|
||||
if (utility == null)
|
||||
{
|
||||
utility = new ModbusUtility(ModbusType.Tcp, "192.168.0.172", 2, 0);
|
||||
utility = new ModbusUtility(ModbusType.Tcp, "192.168.0.161", 2, 0);
|
||||
utility.AddressTranslator = new AddressTranslatorModbus();
|
||||
}
|
||||
object[] getNum = await utility.GetDatasAsync("4X 1", new KeyValuePair<Type, int>(typeof(ushort), 4));
|
||||
@@ -53,7 +53,7 @@ namespace TripleAdd.Controllers
|
||||
{
|
||||
if (machine == null)
|
||||
{
|
||||
machine = new ModbusMachine("1", ModbusType.Tcp, "192.168.3.10", new List<AddressUnit>()
|
||||
machine = new ModbusMachine("1", ModbusType.Tcp, "192.168.0.161", 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},
|
||||
@@ -79,20 +79,20 @@ namespace TripleAdd.Controllers
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<JsonResult> SetUtility(TripleAddViewModel model)
|
||||
public async Task<ActionResult> SetUtility(TripleAddViewModel model)
|
||||
{
|
||||
ushort add1 = model.Add1, add2 = model.Add2, add3 = model.Add3;
|
||||
var ans = await await utility.SetDatasAsync("4X 1", new object[] { add1, add2, add3 }).ContinueWith(async p => await GetUtilityEnter());
|
||||
return Json(ans);
|
||||
await utility.SetDatasAsync("4X 1", new object[] { add1, add2, add3 });
|
||||
return RedirectToAction("Utility");
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<JsonResult> SetMachine(TripleAddViewModel model)
|
||||
public async Task<ActionResult> SetMachine(TripleAddViewModel model)
|
||||
{
|
||||
ushort add1 = model.Add1, add2 = model.Add2, add3 = model.Add3;
|
||||
var setDic = new Dictionary<string, double> { { "Add1", add1 }, { "Add2", add2 }, { "Add3", add3 } };
|
||||
var ans = await await machine.SetDatasAsync(MachineDataType.CommunicationTag, setDic).ContinueWith(async p => await GetMachineEnter());
|
||||
return Json(ans);
|
||||
await machine.SetDatasAsync(MachineDataType.CommunicationTag, setDic);
|
||||
return RedirectToAction("Machine");
|
||||
}
|
||||
|
||||
public IActionResult Privacy()
|
||||
|
||||
Reference in New Issue
Block a user