Exemplo n.º 1
0
        private void tbxSweepStartVolt_ValueChanged(object sender, EventArgs e)
        {
            Int16 temp;

            temp = (Int16)tbxSweepStartVolt.Value;

            aq.txData[0] = 0x11;
            aq.txData[1] = (byte)(temp >> 8);
            aq.txData[2] = (byte)temp;
            aq.txCount   = 3;

            aq.validateDevice(this.tbxSweepStartVolt);
        }
Exemplo n.º 2
0
        private void btnDifTest_Click(object sender, EventArgs e)
        {
            if (!testStarted)//Start test.
            {
                //Indicate test has started.
                btnDifTest.Text = "Abort Test";
                testStarted     = true;

                disableGUI();      //Disable all GUI components.
                resetData();       //Reset all data.
                removeListeners(); //Remove action listeners from the charts.

                //Reset state machine.
                difState = difPulseState.DIF_IDLE;

                //Start test.
                aq.validateDevice(this.btnDifTest);
                difTimer.setTimer(400, timerTypes.TIMER_DIF_TEST, this.btnDifTest);
            }

            else//Abort the current test.
            {
                //Send abort message to device.
                byte[] bArray = new byte[8];
                bArray[0] = (byte)'X';

                try
                {
                    aq.sp.Write(bArray, 0, 1);
                }
                catch (Exception err)
                {
                    aq.comCloser();
                    aq.comErrorHandler(err.ToString());
                }
            }
        }