Exemplo n.º 1
0
        private void getGateTolMonitor(GateType gateType, DGateType dGatetType, int tolMonitorIndex)
        {
            int    error_code;
            double min         = 0;
            double max         = 0;
            uint   suppressCnt = 0;

            //Close double gate tolerance active
            error_code = SetDGateDAQ.TolMonitorActive(SelectAscan.sessionIndex, SelectAscan.port, dGatetType, TMActive.OFF);
            if (error_code != 0)
            {
                return;
            }

            //Open gate tolerance active
            error_code = SetGateDAQ.TolMonitorActive(SelectAscan.sessionIndex, SelectAscan.port, gateType, TMActive.ON);
            if (error_code != 0)
            {
                return;
            }

            error_code = GetGateDAQ.TolMonitorMax(SelectAscan.sessionIndex, SelectAscan.port, gateType, ref max);
            if (error_code != 0)
            {
                return;
            }
            ((NumericUpDown)(Controls.Find("numUpDownMax" + tolMonitorIndex, true)[0])).Text = max.ToString();

            error_code = GetGateDAQ.TolMonitorMin(SelectAscan.sessionIndex, SelectAscan.port, gateType, ref min);
            if (error_code != 0)
            {
                return;
            }
            ((NumericUpDown)(Controls.Find("numUpDownMin" + tolMonitorIndex, true)[0])).Text = min.ToString();

            error_code = GetGateDAQ.TolMonitorSc(SelectAscan.sessionIndex, SelectAscan.port, gateType, ref suppressCnt);
            if (error_code != 0)
            {
                return;
            }
            ((NumericUpDown)(Controls.Find("numUpDownSc" + tolMonitorIndex, true)[0])).Text = suppressCnt.ToString();
        }
Exemplo n.º 2
0
        /**Get Gate DAQ*/
        private static int getGate(uint ascanNum, uint ascanPort, GateType gateType, ref PGate param)
        {
            int error_code;

            error_code = GetGateDAQ.Delay(ascanNum, ascanPort, gateType, ref param.Delay);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.Width(ascanNum, ascanPort, gateType, ref param.Width);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.Threshold(ascanNum, ascanPort, gateType, ref param.Threshold);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.IFActive(ascanNum, ascanPort, gateType, ref param.IF);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.TofMode(ascanNum, ascanPort, gateType, ref param.TofMode);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.DnsActive(ascanNum, ascanPort, gateType, ref param.DnsActive);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.DnsBw(ascanNum, ascanPort, gateType, ref param.DnsBw);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.DnsStart(ascanNum, ascanPort, gateType, ref param.DnsStart);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.DnsStep(ascanNum, ascanPort, gateType, ref param.DnsStep);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.AlarmLogic(ascanNum, ascanPort, gateType, ref param.AlarmLogic);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.ScActive(ascanNum, ascanPort, gateType, ref param.ScActive);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.ScCounter(ascanNum, ascanPort, gateType, ref param.ScCounter);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.DtsActive(ascanNum, ascanPort, gateType, ref param.DtsActive);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.DtsBand(ascanNum, ascanPort, gateType, ref param.DtsBand);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.DtsStart(ascanNum, ascanPort, gateType, ref param.DtsStart);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.DtsStep(ascanNum, ascanPort, gateType, ref param.DtsStep);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.TolMonitorActive(ascanNum, ascanPort, gateType, ref param.TolMonitorActive);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.TolMonitorMax(ascanNum, ascanPort, gateType, ref param.TolMonitorMax);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.TolMonitorMin(ascanNum, ascanPort, gateType, ref param.TolMonitorMin);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.TolMonitorSc(ascanNum, ascanPort, gateType, ref param.TolMonitorSc);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.AlarmActive(ascanNum, ascanPort, gateType, ref param.AlarmActive);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.AlarmMode(ascanNum, ascanPort, gateType, ref param.AlarmMode);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.AlarmSignalLength(ascanNum, ascanPort, gateType, ref param.AlarmSignalLength);
            if (error_code != 0)
            {
                return(error_code);
            }

            //error_code = SetGateDAQ.AlarmTimeLength(ascanNum, gateType, param.);
            //if (error_code != 0)
            //    return error_code;

            error_code = GetGateDAQ.AlarmActiveLevel(ascanNum, ascanPort, gateType, ref param.AlarmActiveLevel);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.MeasActive(ascanNum, ascanPort, gateType, ref param.MeasActive);
            if (error_code != 0)
            {
                return(error_code);
            }

            error_code = GetGateDAQ.MeasMode(ascanNum, ascanPort, gateType, ref param.MeasMode);
            if (error_code != 0)
            {
                return(error_code);
            }
            return(error_code);
        }