Modbus modified, UniCB Init. modified, RunDeviceAfter() called in reversed order, ver. 3.1.1597

This commit is contained in:
Milan Hanajik
2021-03-18 16:16:49 +01:00
parent ff70a11cad
commit d7e65ff04b
14 changed files with 293 additions and 157 deletions
+18 -19
View File
@@ -179,12 +179,6 @@ namespace TBF.Rig.ControlBoard.Uni
scopeAnalyzerData = null;
switchCounterData = null;
serialPort = null;
buffer = new byte[BUFFER_SIZE];
rcvdData = new byte[BUFFER_SIZE];
cumulativeSums = new int[BUFFER_SIZE];
rcvdBytesCount = 0;
routeMask = 0;
for (int i = 0; i < 128; i++)
{
@@ -194,19 +188,6 @@ namespace TBF.Rig.ControlBoard.Uni
}
}
TBF.UiBridge.Bridge.RouteChangeHandler += delegate(object sndr, TBF.UiBridge.RouteChangeArgs args)
{
UInt128 mask = ((UInt128)1) << args.BitNr;
if ((benchModelRoute & mask) == 0)
{
benchModelRoute |= mask;
}
else
{
benchModelRoute &= (~mask);
}
};
log.Warn(this.ToString());
}
@@ -233,12 +214,30 @@ namespace TBF.Rig.ControlBoard.Uni
return;
}
buffer = new byte[BUFFER_SIZE];
rcvdData = new byte[BUFFER_SIZE];
cumulativeSums = new int[BUFFER_SIZE];
rcvdBytesCount = 0;
serialPort = new SerialPort(comPort, 9600, Parity.None, 8, StopBits.One);
serialPort.DtrEnable = true;
serialPort.WriteTimeout = 4000;
serialPort.ParityReplace = 0xFF;
serialPort.Open();
TBF.UiBridge.Bridge.RouteChangeHandler += delegate(object sndr, TBF.UiBridge.RouteChangeArgs args)
{
UInt128 mask = ((UInt128)1) << args.BitNr;
if ((benchModelRoute & mask) == 0)
{
benchModelRoute |= mask;
}
else
{
benchModelRoute &= (~mask);
}
};
log.FatalFormat("{0} - Device successfully initialized", Name);
}