|
|
@@ -31,7 +31,7 @@ namespace BPASmartClient.MorkCL.Server |
|
|
|
//{ |
|
|
|
// for (byte i = 0; i < s.Length; i++) BoxDetection[i] = s[i]; |
|
|
|
//}); |
|
|
|
|
|
|
|
MyModbus.SlaveAddress = 1; |
|
|
|
MyModbus.Read<ushort>("LW630".ToModbusAdd()).OnSuccess(s => |
|
|
|
{ |
|
|
|
for (byte i = 0; i < 4; i++) |
|
|
@@ -41,7 +41,7 @@ namespace BPASmartClient.MorkCL.Server |
|
|
|
}); |
|
|
|
Thread.Sleep(250); |
|
|
|
//myDevice.SlaveAddress = 2; |
|
|
|
|
|
|
|
MyModbus.SlaveAddress = 2; |
|
|
|
MyModbus.Read<float>("LW6".ToModbusAdd()).OnSuccess(s => { CurrentWeight = s.Content; }); |
|
|
|
|
|
|
|
Thread.Sleep(250); |
|
|
@@ -95,6 +95,7 @@ namespace BPASmartClient.MorkCL.Server |
|
|
|
{ |
|
|
|
//ModbusRtu weigher = (ModbusRtu)MyModbus; |
|
|
|
//MyModbus.SlaveAddress = 2; |
|
|
|
MyModbus.SlaveAddress = 2; |
|
|
|
return MyModbus.Write<bool>("LB4".ToModbusAdd(), true).IsSuccess; |
|
|
|
} |
|
|
|
else |
|
|
@@ -110,6 +111,7 @@ namespace BPASmartClient.MorkCL.Server |
|
|
|
{ |
|
|
|
//ModbusRtu weigher = (ModbusRtu)MyModbus; |
|
|
|
//weigher.SlaveAddress = 2; |
|
|
|
MyModbus.SlaveAddress = 2; |
|
|
|
return MyModbus.Write<bool>("LB3".ToModbusAdd(), true).IsSuccess; |
|
|
|
} |
|
|
|
else |
|
|
|