示例#1
0
        /// <summary>
        /// Perform Fast-1D alignment with dual-adc-channel-capture.
        /// </summary>
        /// <param name="Axis"></param>
        /// <param name="Range"></param>
        /// <param name="Interval"></param>
        /// <param name="Speed"></param>
        /// <param name="AnalogCapture"></param>
        /// <param name="ScanResult"></param>
        public void StartFast1D(IAxis Axis, double Range, double Interval, int Speed, ADCChannels AnalogCapture, out List <Point2D> ScanResult, ADCChannels AnalogCapture2, out List <Point2D> ScanResult2)
        {
            ScanResult  = null;
            ScanResult2 = null;

            if (Axis.GetType() != typeof(IrixiM12Axis))
            {
                throw new Exception("The axis you specified does not support the fast alignment function.");
            }

            var unit = ((IrixiM12Axis)Axis).ID;

            var rangeInStep    = Axis.UnitHelper.ConvertDistanceToSteps(Range);
            var intervalInStep = (ushort)Axis.UnitHelper.ConvertDistanceToSteps(Interval);

            // limit the speed to the maximum value defined in the config file.
            var cSpeed = (byte)(Speed * Axis.MaxSpeed / 100);

            if (cSpeed == 0)
            {
                cSpeed = 1;
            }
            else if (cSpeed > 100)
            {
                cSpeed = 100;
            }

            _m12.StartFast1D(unit, rangeInStep, intervalInStep, cSpeed, AnalogCapture, out ScanResult, AnalogCapture2, out ScanResult2);
        }
示例#2
0
        /// <summary>
        /// Perform blind-search alignment.
        /// </summary>
        /// <param name="HAxis"></param>
        /// <param name="VAxis"></param>
        /// <param name="Range"></param>
        /// <param name="Gap"></param>
        /// <param name="Interval"></param>
        /// <param name="Speed"></param>
        /// <param name="AnalogCapture"></param>
        /// <param name="ScanResults"></param>
        public void StartBlindSearch(IAxis HAxis, IAxis VAxis, double Range, double Gap, double Interval, int Speed, ADCChannels AnalogCapture, out List <Point3D> ScanResults)
        {
            ScanResults = null;

            if (HAxis.GetType() != typeof(IrixiM12Axis) || VAxis.GetType() != typeof(IrixiM12Axis))
            {
                throw new Exception("The axis you specified does not support the Blind-Search function.");
            }

            var hUnit = ((IrixiM12Axis)HAxis).ID;
            var vUnit = ((IrixiM12Axis)VAxis).ID;

            // limit the speed to the maximum value defined in the config file.
            var horiSpeed = Speed * HAxis.MaxSpeed / 100;

            if (horiSpeed == 0)
            {
                horiSpeed = 1;
            }
            else if (horiSpeed > 100)
            {
                horiSpeed = 100;
            }

            // limit the speed to the maximum value defined in the config file.
            var vertSpeed = Speed * VAxis.MaxSpeed / 100;

            if (vertSpeed == 0)
            {
                vertSpeed = 1;
            }
            else if (vertSpeed > 100)
            {
                vertSpeed = 100;
            }

            BlindSearchArgs horiArgs = new BlindSearchArgs(
                hUnit,
                (uint)HAxis.UnitHelper.ConvertDistanceToSteps(Range),
                (uint)HAxis.UnitHelper.ConvertDistanceToSteps(Gap),
                (ushort)HAxis.UnitHelper.ConvertDistanceToSteps(Interval),
                (byte)horiSpeed);

            BlindSearchArgs veriArgs = new BlindSearchArgs(
                vUnit,
                (uint)VAxis.UnitHelper.ConvertDistanceToSteps(Range),
                (uint)VAxis.UnitHelper.ConvertDistanceToSteps(Gap),
                (ushort)VAxis.UnitHelper.ConvertDistanceToSteps(Interval),
                (byte)vertSpeed);


            _m12.StartBlindSearch(horiArgs, veriArgs, AnalogCapture, out ScanResults);
        }