public void AdjustingZeroMethodTestModbus(Behavior behavior)
        {
            testConnection = new TestModbusTCPConnection(behavior, "172.19.103.8");
            _wtxObj        = new WTXModbus(testConnection, 200, Update);

            _wtxObj.Connect(this.OnConnect, 100);

            _wtxObj.AdjustZeroSignal();

            if (behavior == Behavior.TareMethodTestSuccess)
            {
                Assert.AreEqual(0x80, testConnection.GetCommand);
            }
            else
            if (behavior == Behavior.TareMethodTestFail)
            {
                Assert.AreEqual(0x0, testConnection.GetCommand);
            }
        }
Beispiel #2
0
        public bool MeasureZeroTest(Behavior behavior)
        {
            testConnection = new TestModbusTCPConnection(behavior, "172.19.103.8");
            _wtxDevice     = new WTXModbus(testConnection, 200, UpdateMeasureZeroTest);

            _wtxDevice.Connect(this.OnConnect, 100);

            _wtxDevice.AdjustZeroSignal();

            //check if : write reg 48, 0x7FFFFFFF and if Net and gross value are zero.

            if ((testConnection.getArrElement1 == (0x7FFFFFFF & 0xffff0000) >> 16) &&
                (testConnection.getArrElement2 == (0x7FFFFFFF & 0x0000ffff)) &&
                _wtxDevice.ProcessData.Weight.Net == 0 && _wtxDevice.ProcessData.Weight.Gross == 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }