Пример #1
0
        /// <summary>
        /// Creates a new RandomAccessScanner writing samples to the indicated channels
        /// </summary>
        /// <param name="lookupTable">The point-voltage conversion table to use</param>
        /// <param name="xChannel">The device and ao-channel for the x-mirror</param>
        /// <param name="yChannel">The device and ao-channel for the y-mirror</param>
        /// <param name="vMin">The minimum of the voltage range used on the Ao channels</param>
        /// <param name="vMax">The maximum of the voltage range used on the Ao channels</param>
        public RandomAccessScanner(PointVoltageConverter lookupTable, string xChannel, string yChannel, double vMin, double vMax)
        {
            if (!(vMin < vMax))
            {
                throw new ArgumentException("Minimum voltage has to be smaller than maximum voltage");
            }
            if (vMin < -10 || vMax > 10)
            {
                throw new ArgumentException("The minimum voltage can't be below -10 and the maximum voltage can't be above 10");
            }

            _vMin = vMin;
            _vMax = vMax;
            //_xMirrorTask = new Task("AOXMirror");
            //_xMirrorTask.AOChannels.CreateVoltageChannel(xChannel, "XOut", vMin, vMax, AOVoltageUnits.Volts);
            //_xWriter = new AnalogSingleChannelWriter(_xMirrorTask.Stream);
            //_yMirrorTask = new Task("AOYMirror");
            //_yMirrorTask.AOChannels.CreateVoltageChannel(yChannel, "YOut", vMin, vMax, AOVoltageUnits.Volts);
            //_yWriter = new AnalogSingleChannelWriter(_yMirrorTask.Stream);
            _mirrorTask = new Task("AOMirror");
            _mirrorTask.AOChannels.CreateVoltageChannel(xChannel, "XOut", vMin, vMax, AOVoltageUnits.Volts);
            _mirrorTask.AOChannels.CreateVoltageChannel(yChannel, "YOut", vMin, vMax, AOVoltageUnits.Volts);
            _multiWriter = new AnalogMultiChannelWriter(_mirrorTask.Stream);
            if (lookupTable != null && !lookupTable.Complete)
            {
                throw new ArgumentException("The provided lookup table has to be complete");
            }
            CoordinateConverter = lookupTable;
        }
Пример #2
0
 /// <summary>
 /// Creates a new RandomAccessScanner writing samples to the first device
 /// using AO0 for the xMirror and AO1 for the YMirror
 /// </summary>
 /// <param name="lookupTable">The point-voltage conversion table to use</param>
 public RandomAccessScanner(PointVoltageConverter lookupTable) : this()
 {
     if (!lookupTable.Complete)
     {
         throw new ArgumentException("The provided lookup table has to be complete");
     }
     CoordinateConverter = lookupTable;
 }