示例#1
0
        //clone an instrument
        private void InstrumentContextCloneBtn_ItemClick(object sender, RoutedEventArgs routedEventArgs)
        {
            var inst   = (Instrument)InstrumentsGrid.SelectedItem;
            var window = new AddInstrumentManuallyWindow(inst);

            window.ShowDialog();
            if (window.InstrumentAdded)
            {
                Instruments.Add(window.TheInstrument);
            }
            window.Close();
        }
示例#2
0
        //show the interactive brokers add instrument window
        private void AddInstrumentIBBtn_ItemClick(object sender, RoutedEventArgs routedEventArgs)
        {
            var window = new AddInstrumentInteractiveBrokersWindow();

            if (window.ViewModel != null && window.ViewModel.AddedInstruments != null)
            {
                foreach (Instrument i in window.ViewModel.AddedInstruments)
                {
                    Instruments.Add(i);
                }
                window.Close();
            }
        }
示例#3
0
        //show the Quandl add instrument window
        private void AddInstrumentQuandlBtn_OnClick(object sender, RoutedEventArgs e)
        {
            var window = new AddInstrumentQuandlWindow();

            if (window.AddedInstruments != null)
            {
                foreach (Instrument i in window.AddedInstruments)
                {
                    Instruments.Add(i);
                }
                window.Close();
            }
        }
        private void AddInstrumentIb()
        {
            var window = new Windows.AddInstrumentInteractiveBrokersWindow();

            if (window.ViewModel?.AddedInstruments != null)
            {
                foreach (Instrument i in window.ViewModel.AddedInstruments)
                {
                    Instruments.Add(i);
                }

                window.Close();
            }
        }
示例#5
0
        //show the FRED add instrument window
        private void AddInstrumentFredBtn_OnClick(object sender, RoutedEventArgs e)
        {
            using (var context = new MyDBContext())
            {
                var window = new AddInstrumentFredWindow(context);

                if (window.AddedInstruments != null)
                {
                    foreach (Instrument i in window.AddedInstruments)
                    {
                        Instruments.Add(i);
                    }
                    window.Close();
                }
            }
        }
 public void AddInstance(Instrument instrument, InstrumentStrategy strategy)
 {
     strategy.Instrument = instrument;
     strategy.Instruments.Add(instrument);
     strategy.Portfolio.GetOrCreatePosition(instrument);
     strategy.raiseEvents = true;
     strategy.SetRawDataProvider(this.rawDataProvider);
     strategy.SetRawExecutionProvider(this.rawExecutionProvider);
     InsertStrategy(strategy);
     if (Instruments.GetById(instrument.Id) == null)
     {
         Instruments.Add(instrument);
     }
     strategy.Status = StrategyStatus.Running;
     strategy.OnStrategyInit();
     strategy.OnStrategyStart();
 }
        private void Search(int page = 1)
        {
            Instruments.Clear();
            int count            = 0;
            var foundInstruments = QuandlUtils.FindInstruments(SymbolTextBox.Text, out count, page);

            foreach (var i in foundInstruments)
            {
                i.Datasource   = _thisDS;
                i.DatasourceID = _thisDS.ID;
                i.Multiplier   = 1;
                Instruments.Add(i);
            }

            StatusLabel.Content = count + " contracts found";

            CurrentPageTextBox.Text = page.ToString();
        }
        async Task ExecuteLoadItemsCommand()
        {
            IsBusy = true;

            try
            {
                Instruments.Clear();
                var instruments = await InstrumentDataStore.GetItemsAsync(true);

                foreach (var instrument in instruments)
                {
                    Instruments.Add(instrument);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
示例#9
0
 public void Add(Strategy strategy)
 {
     this.list_1.Add(strategy);
     strategy.Portfolio.Parent = Portfolio;
     foreach (Instrument current in strategy.Instruments)
     {
         List <Strategy> list;
         if (this.idArray_3[current.Id] == null)
         {
             list = new List <Strategy>();
             this.idArray_3[current.Id] = list;
         }
         else
         {
             list = this.idArray_3[current.Id];
         }
         list.Add(strategy);
         if (!Instruments.Contains(current))
         {
             Instruments.Add(current);
         }
     }
 }
示例#10
0
        public DecelerationHardware()
        {
            // YAG laser
            yag = new MiniliteLaser();

            // add the boards
            Boards.Add("daq", "/dev2");
            Boards.Add("pg", "/dev1");
            Boards.Add("usbDev", "/dev3");
            Boards.Add("PXI6", "/PXI1Slot6");
            Boards.Add("PXI4", "/PXI1Slot4");
            string pgBoard  = (string)Boards["pg"];
            string usbBoard = (string)Boards["usbDev"];
            string daqBoard = (string)Boards["daq"];
            string PXIBoard = (string)Boards["PXI6"];
            string TCLBoard = (string)Boards["PXI4"];

            Instruments.Add("synth", new HP8673BSynth("GPIB0::19::INSTR"));
            Instruments.Add("counter", new HP5350BCounter("GPIB0::14::INSTR"));

            //VCO lock
            AddAnalogOutputChannel("VCO_Out", PXIBoard + "/ao12", 0.0, 10.0);

            // add things to the info
            Info.Add("PGClockLine", Boards["pg"] + "/PFI2");
            Info.Add("PatternGeneratorBoard", pgBoard);
            Info.Add("PGType", "dedicated");

            //TCL Lockable lasers
            Info.Add("TCLLockableLasers", new string[] { "laser", "laser2" });
            Info.Add("TCLPhotodiodes", new string[] { "cavity", "master", "p1", "p2" }); // THE FIRST TWO MUST BE CAVITY AND MASTER PHOTODIODE!!!!
            Info.Add("TCL_Slave_Voltage_Limit_Upper", 10.0);                             //volts: Laser control
            Info.Add("TCL_Slave_Voltage_Limit_Lower", -10.0);                            //volts: Laser control
            Info.Add("TCL_Default_Gain", 0.01);
            Info.Add("TCL_Default_VoltageToLaser", 0.0);
            Info.Add("TCL_MAX_INPUT_VOLTAGE", 10.0);

            // Some matching up for TCL
            Info.Add("laser", "p1");
            Info.Add("laser2", "p2");


            // the analog triggers
            Info.Add("analogTrigger0", (string)Boards["daq"] + "/PFI0"); // pin 10
            Info.Add("analogTrigger1", (string)Boards["daq"] + "/PFI1"); // pin 11
            Info.Add("TCLTrigger", (string)Boards["PXI4"] + "/PFI0");
            //Info.Add("analogTrigger2", (string)Boards["usbDev"] + "/PFI0"); //Pin 29
            Info.Add("analogTrigger3", (string)Boards["daq"] + "/PFI6"); //Pin 5 - breakout 31
            //distance information
            Info.Add("sourceToDetect", 0.81);                            //in m
            Info.Add("sourceToSoftwareDecelerator", 0.12);               //in m
            //information about the molecule
            Info.Add("molecule", "caf");
            Info.Add("moleculeMass", 58.961);                   // this is 40CaF in atomic mass units
            Info.Add("moleculeRotationalConstant", 1.02675E10); //in Hz
            Info.Add("moleculeDipoleMoment", 15400.0);          //in Hz/(V/m)
            //information about the decelerator

            //These settings for WF
            Info.Add("deceleratorStructure", DecelerationConfig.DecelerationExperiment.SwitchStructure.V_H);             //Vertical first
            Info.Add("deceleratorLensSpacing", 0.006);
            Info.Add("deceleratorFieldMap", "RodLayout3_EonAxis.dat");
            Info.Add("mapPoints", 121);
            Info.Add("mapStartPoint", 0.0);
            Info.Add("mapResolution", 0.0001);

            // These settings for AG
            //	Info.Add("deceleratorStructure", DecelerationConfig.DecelerationExperiment.SwitchStructure.H_V); //Horizontal first
            //  Info.Add("deceleratorLensSpacing", 0.024);
            //  Info.Add("deceleratorFieldMap", "Section1v1_onAxisFieldTemplate.dat");
            //  Info.Add("mapPoints", 481);
            //  Info.Add("mapStartPoint", 0.0);
            //  Info.Add("mapResolution", 0.0001);

            //Here are constants for 174YbF for future reference
            //Info.Add("molecule", "ybf");
            //Info.Add("moleculeMass", 192.937); // this is 174YbF in atomic mass units
            //Info.Add("moleculeRotationalConstant", 7.2338E9); //in Hz
            //Info.Add("moleculeDipoleMoment", 19700.0); //in Hz/(V/m)

            // map the digital channels
            AddDigitalOutputChannel("valve", pgBoard, 0, 6);
            AddDigitalOutputChannel("flash", pgBoard, 0, 0);            //Changed from pg board P.0.5 because that appears to have died mysteriously (line dead in ribbon cable?) TEW 06/04/09
            AddDigitalOutputChannel("q", pgBoard, 0, 2);
            AddDigitalOutputChannel("detector", pgBoard, 3, 7);
            AddDigitalOutputChannel("detectorprime", pgBoard, 3, 6);
            AddDigitalOutputChannel("aom", pgBoard, 2, 1);               //Same channel as "ttl2" as used by the AomLevelControlPlugin. Now commented out.
            AddDigitalOutputChannel("decelhplus", pgBoard, 1, 0);        //Pin 16
            AddDigitalOutputChannel("decelhminus", pgBoard, 1, 1);       //Pin 17
            AddDigitalOutputChannel("decelvplus", pgBoard, 1, 2);        //Pin 51
            AddDigitalOutputChannel("decelvminus", pgBoard, 1, 3);       //Pin 52
            AddDigitalOutputChannel("cavityTriggerOut", usbBoard, 0, 1); //Pin 18
            //AddDigitalOutputChannel("ttl1", pgBoard, 2, 2); //Pin 58 Used to be used with AomLevelControlPlugin.
            //AddDigitalOutputChannel("ttl2", pgBoard, 2, 1); //Pin 57
            // AddDigitalOutputChannel("ttlSwitch", pgBoard, 1, 3);	// This is the output that the pg
            // will switch if it's switch scanning.

            // map the analog channels
            AddAnalogInputChannel("pmt", daqBoard + "/ai0", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("pmt2", daqBoard + "/ai8", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("longcavity", daqBoard + "/ai3", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("refcavity", daqBoard + "/ai1", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("lockcavity", daqBoard + "/ai2", AITerminalConfiguration.Rse);

            AddAnalogInputChannel("master", TCLBoard + "/ai1", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("p1", TCLBoard + "/ai3", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("cavity", TCLBoard + "/ai2", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("p2", TCLBoard + "/ai0", AITerminalConfiguration.Rse);

            AddAnalogOutputChannel("laser", PXIBoard + "/ao13");
            //AddAnalogOutputChannel("cavity", daqBoard + "/ao0");
            // AddAnalogOutputChannel("cavity", PXIBoard + "/ao5");
            AddAnalogOutputChannel("laser2", PXIBoard + "/ao25");
            AddAnalogOutputChannel("laser3", PXIBoard + "/ao31");
            AddAnalogOutputChannel("rampfb", PXIBoard + "/ao19");

            AddAnalogOutputChannel("highvoltage", daqBoard + "/ao1");// hardwareController has "highvoltage" hardwired into it and so needs to see this ao, otherwise it crashes. Need to fix this.


            // map the counter channels
            AddCounterChannel("pmt", daqBoard + "/ctr0");
            AddCounterChannel("sample clock", daqBoard + "/ctr1");
        }
        private void StartLoad()
        {
            try
            {
                IsConnected = _bitmexApiSocketService.Connect();
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }

            if (IsConnected)
            {
                _bitmexApiSocketService.Subscribe(BitmetSocketSubscriptions.CreateInstrumentSubsription(
                                                      message =>
                {
                    foreach (var instrumentDto in message.Data)
                    {
                        lock (_syncObj)
                        {
                            var existing = Instruments.FirstOrDefault(a => a.Symbol == instrumentDto.Symbol);
                            if (existing != null && message.Action == BitmexActions.Update)
                            {
                                Mapper.Map <InstrumentDto, InstrumentModel>(instrumentDto, existing);
                            }
                            else if (message.Action != BitmexActions.Partial && message.Action != BitmexActions.Delete)
                            {
                                Instruments.Add(Mapper.Map <InstrumentDto, InstrumentModel>(instrumentDto));
                            }
                        }
                    }
                }));

                _bitmexApiSocketService.Subscribe(BitmetSocketSubscriptions.CreateOrderSubsription(
                                                      message =>
                {
                    foreach (var order in message.Data)
                    {
                        lock (_syncObjOrders)
                        {
                            var existing = OrderUpdates.FirstOrDefault(a => a.OrderId == order.OrderId);
                            if (existing != null && message.Action == BitmexActions.Update)
                            {
                                Mapper.Map <OrderDto, OrderUpdateModel>(order, existing);
                            }
                            else if (message.Action != BitmexActions.Partial && message.Action != BitmexActions.Delete)
                            {
                                OrderUpdates.Add(Mapper.Map <OrderDto, OrderUpdateModel>(order));
                            }
                        }

                        OnPropertyChanged(nameof(OrderUpdates));
                    }
                }));

                _bitmexApiSocketService.Subscribe(BitmetSocketSubscriptions.CreateOrderBook10Subsription(
                                                      message =>
                {
                    foreach (var dto in message.Data)
                    {
                        if (dto.Symbol != "XBTUSD")
                        {
                            continue;
                        }

                        lock (_syncObjOrderBook10)
                        {
                            OrderBook10 = dto.Asks.Select(a =>
                                                          new OrderBookModel {
                                Direction = "Sell", Price = a[0], Size = a[1]
                            })
                                          .Union(dto.Asks.Select(a =>
                                                                 new OrderBookModel {
                                Direction = "Buy", Price = a[0], Size = a[1]
                            })).ToList();
                        }

                        OnPropertyChanged(nameof(OrderBook10));
                    }
                }));

                _bitmexApiSocketService.Subscribe(BitmetSocketSubscriptions.CreateOrderBookL2Subsription(
                                                      message =>
                {
                    foreach (var dto in message.Data)
                    {
                        if (dto.Symbol != "XBTUSD")
                        {
                            continue;
                        }

                        lock (_syncObjOrderBookL2)
                        {
                            if (message.Action == BitmexActions.Insert || message.Action == BitmexActions.Partial)
                            {
                                OrderBookL2.Add(Mapper.Map <OrderBookDto, OrderBookModel>(dto));
                            }
                            if (message.Action == BitmexActions.Delete)
                            {
                                var existing = OrderBookL2.FirstOrDefault(a => a.Id == dto.Id);
                                if (existing != null)
                                {
                                    OrderBookL2.Remove(existing);
                                }
                            }

                            if (message.Action == BitmexActions.Update)
                            {
                                var existing = OrderBookL2.FirstOrDefault(a => a.Id == dto.Id);
                                if (existing == null)
                                {
                                    OrderBookL2.Add(Mapper.Map <OrderBookDto, OrderBookModel>(dto));
                                }
                                else
                                {
                                    Mapper.Map <OrderBookDto, OrderBookModel>(dto, existing);
                                }
                            }
                        }

                        OnPropertyChanged(nameof(OrderBook10));
                    }
                }));
            }
        }
示例#12
0
        public SympatheticHardware()
        {
            // YAG laser
            yag = new QuantaRayLaser();

            // add the boards
            Boards.Add("daq", "/dev2");
            Boards.Add("pg", "/dev1");
            Boards.Add("usbDAQ2", "/dev3");
            Boards.Add("TCLAIBoard", "/dev4");
            //Boards.Add("usbDAQ1", "/dev4");
            string pgBoard  = (string)Boards["pg"];
            string daqBoard = (string)Boards["daq"];
            string usbDAQ1  = (string)Boards["usbDAQ1"];
            string usbDAQ2  = (string)Boards["usbDAQ2"];
            string TCLBoard = (string)Boards["TCLAIBoard"];

            // add things to the info
            Info.Add("PGClockLine", Boards["pg"] + "/PFI2");
            Info.Add("PatternGeneratorBoard", pgBoard);
            Info.Add("PGType", "dedicated");

            // the analog triggers
            Info.Add("analogTrigger0", (string)Boards["daq"] + "/PFI0"); //DAQ Pin 11
            Info.Add("analogTrigger1", (string)Boards["daq"] + "/PFI1"); //DAQ Pin 10
            //Info.Add("analogTrigger2", (string)Boards["daq"] + "/PFI5"); //DAQ Pin 6
            //Info.Add("analogTrigger2", (string)Boards["usbDAQ2"] + "/PFI0");
            Info.Add("analogTrigger2", TCLBoard + "/PFI0");
            //Info.Add("analogTrigger2", (string)Boards["daq"] + "/PFI1"); //DAQ Pin 10
            //distance information
            Info.Add("sourceToDetect", 0.787);
            Info.Add("sourceToSoftwareDecelerator", 0.123);
            //information about the molecule
            Info.Add("moleculeMass", 8.024);                                                                 //this is 7LiH in amu
            Info.Add("moleculeRotationalConstant", 2.22545E11);                                              //in Hz
            Info.Add("moleculeDipoleMoment", 29600.0);                                                       //in Hz/(V/m)
            //information about the decelerator
            Info.Add("deceleratorStructure", DecelerationConfig.DecelerationExperiment.SwitchStructure.H_V); //Horizontal first
            Info.Add("deceleratorLensSpacing", 0.006);
            Info.Add("deceleratorFieldMap", "RodLayout3_EonAxis.dat");
            Info.Add("mapPoints", 121);
            Info.Add("mapStartPoint", 0.0);
            Info.Add("mapResolution", 0.0001);
            //TCL Lockable lasers
            Info.Add("TCLLockableLasers", new string[] { "laser" });
            Info.Add("TCLPhotodiodes", new string[] { "cavity", "master", "p1" }); // THE FIRST TWO MUST BE CAVITY AND MASTER PHOTODIODE!!!!
            Info.Add("TCL_Slave_Voltage_Limit_Upper", 10.0);                       //volts: Laser control
            Info.Add("TCL_Slave_Voltage_Limit_Lower", -10.0);                      //volts: Laser control
            Info.Add("TCL_Default_Gain", 0.5);
            Info.Add("TCL_Default_VoltageToLaser", 0.0);
            Info.Add("TCL_MAX_INPUT_VOLTAGE", 10.0);

            // map the GPIB instruments
            Instruments.Add("microwave", new EIP578Synth("GPIB0::19::INSTR"));
            Instruments.Add("agilent", new Agilent33250Synth("GPIB0::10::INSTR"));
            Instruments.Add("gigatronics", new Gigatronics7100Synth("GPIB0::6::INSTR"));

            // map the digital channels
            // these channels are to be part of the "PatternList" and shoud all be on the low half of the board
            AddDigitalOutputChannel("valve", pgBoard, 0, 0);             //Pin 10
            AddDigitalOutputChannel("flash", pgBoard, 0, 1);             //Pin 44
            AddDigitalOutputChannel("valve2", pgBoard, 0, 1);
            AddDigitalOutputChannel("discharge", pgBoard, 0, 3);
            AddDigitalOutputChannel("q", pgBoard, 0, 2);                //Pin 45
            AddDigitalOutputChannel("detector", pgBoard, 0, 7);         //Pin 15
            AddDigitalOutputChannel("detectorprime", pgBoard, 1, 7);    //Pin 22
            //	AddDigitalOutputChannel("fig", pgBoard, 3, 1); //Pin 63
            AddDigitalOutputChannel("aom", pgBoard, 0, 4);              //Pin 13
            AddDigitalOutputChannel("flash2", pgBoard, 0, 5);           //Pin 47
            AddDigitalOutputChannel("q2", pgBoard, 0, 6);               //Pin 48
            AddDigitalOutputChannel("cavityTriggerOut", usbDAQ2, 0, 1); //Pin 17
            // the following are the decelerator channels for the burst
            AddDigitalOutputChannel("decelhplus", pgBoard, 1, 0);       //Pin 16
            AddDigitalOutputChannel("decelhminus", pgBoard, 1, 1);      //Pin 17
            AddDigitalOutputChannel("decelvplus", pgBoard, 1, 2);       //Pin 51
            AddDigitalOutputChannel("decelvminus", pgBoard, 1, 3);      //Pin 52
            AddDigitalOutputChannel("SynthTrigger", pgBoard, 0, 3);     //Pin 48

            // these channels are to be switched "manually" and should all be on the high half of the board
            // the following set of switches are used to enable or disable the burst
            AddDigitalOutputChannel("hplusBurstEnable", pgBoard, 2, 0);
            AddDigitalOutputChannel("hminusBurstEnable", pgBoard, 3, 4);
            AddDigitalOutputChannel("vplusBurstEnable", pgBoard, 2, 2);
            AddDigitalOutputChannel("vminusBurstEnable", pgBoard, 2, 3);
            // the following set of switches are used for dc on or off
            AddDigitalOutputChannel("hplusdc", pgBoard, 2, 4);
            AddDigitalOutputChannel("hminusdc", pgBoard, 2, 5);
            AddDigitalOutputChannel("vplusdc", pgBoard, 2, 6);
            AddDigitalOutputChannel("vminusdc", pgBoard, 3, 3);


            // map the analog input channels
            AddAnalogInputChannel("pmt", daqBoard + "/ai0", AITerminalConfiguration.Rse);             //Pin 68
            //AddAnalogInputChannel("p1", daqBoard + "/ai7", AITerminalConfiguration.Rse);//Pin 57
            //AddAnalogInputChannel("p2", daqBoard + "/ai14", AITerminalConfiguration.Rse);//Pin 58
            //AddAnalogInputChannel("cavityVoltageRead", daqBoard + "/ai12", AITerminalConfiguration.Rse); //Pin 61

            //AddAnalogInputChannel("p1", usbDAQ2 + "/ai0", AITerminalConfiguration.Rse);//Pin 2
            //AddAnalogInputChannel("p2", usbDAQ2 + "/ai1", AITerminalConfiguration.Rse);//Pin 5
            //AddAnalogInputChannel("cavityVoltageRead", usbDAQ2 + "/ai2", AITerminalConfiguration.Rse); //Pin 8
            AddAnalogInputChannel("p1", TCLBoard + "/ai0", AITerminalConfiguration.Rse);                          //Pin 2
            AddAnalogInputChannel("p2", TCLBoard + "/ai1", AITerminalConfiguration.Rse);                          //Pin 5
            AddAnalogInputChannel("cavityVoltageRead", TCLBoard + "/ai2", AITerminalConfiguration.Rse);           //Pin 8

            AddAnalogInputChannel("lockcavity", daqBoard + "/ai1", AITerminalConfiguration.Rse);                  //Pin 33
            AddAnalogInputChannel("probepower", daqBoard + "/ai9", AITerminalConfiguration.Rse);                  //Pin 66
            //AddAnalogInputChannel("refcavity", daqBoard + "/ai2", AITerminalConfiguration.Rse); //Pin 65
            AddAnalogInputChannel("pressureP1", daqBoard + "/ai2", AITerminalConfiguration.Rse);                  //Pin 65
            AddAnalogInputChannel("fig", daqBoard + "/ai5", AITerminalConfiguration.Rse);                         //Pin 60
            AddAnalogInputChannel("atomSourcePressure1", usbDAQ1 + "/ai0", AITerminalConfiguration.Differential); //ai0+ is pin 2, ai0- is pin 3
            AddAnalogInputChannel("atomSourcePressure2", usbDAQ1 + "/ai1", AITerminalConfiguration.Differential); //ai1+ is pin 5, ai1- is pin 6

            //map the analog output channels
            AddAnalogOutputChannel("laser", daqBoard + "/ao0");       // Pin 22
            // AddAnalogOutputChannel("dyelaser", daqBoard + "/ao1",-5,5); // Pin 21
            AddAnalogOutputChannel("highvoltage", daqBoard + "/ao1"); // Note - this is just here because a channel called "highvoltage" has been hard-wired into DecelerationHardwareControl - this needs to be rectified
            AddAnalogOutputChannel("cavity", daqBoard + "/ao1");      // Pin 21
            //AddAnalogOutputChannel("cavity", usbDAQ2 + "/ao0"); // Pin 14

            // map the counter channels
            AddCounterChannel("pmt", daqBoard + "/ctr0");          //Source is pin 37, gate is pin 3, out is pin 2
            AddCounterChannel("sample clock", daqBoard + "/ctr1"); //Source is pin 42, gate is pin 41, out is pin 40
        }
示例#13
0
        public EDMHardware()
        {
            // add the boards
            Boards.Add("daq", "/dev1");
            Boards.Add("pg", "/dev2");
            Boards.Add("counter", "/dev3");
            Boards.Add("usbDAQ1", "/dev4");
            Boards.Add("analogIn", "/dev5");
            Boards.Add("usbDAQ2", "/dev6");
            Boards.Add("usbDAQ3", "/dev7");
            Boards.Add("usbDAQ4", "/dev9");
            string pgBoard      = (string)Boards["pg"];
            string daqBoard     = (string)Boards["daq"];
            string counterBoard = (string)Boards["counter"];
            string usbDAQ1      = (string)Boards["usbDAQ1"];
            string analogIn     = (string)Boards["analogIn"];
            string usbDAQ2      = (string)Boards["usbDAQ2"];
            string usbDAQ3      = (string)Boards["usbDAQ3"];
            string usbDAQ4      = (string)Boards["usbDAQ4"];

            // add things to the info
            // the analog triggers
            Info.Add("analogTrigger0", (string)Boards["analogIn"] + "/PFI0");
            Info.Add("analogTrigger1", (string)Boards["analogIn"] + "/PFI1");
            Info.Add("sourceToDetect", 1.3);
            Info.Add("moleculeMass", 193.0);
            Info.Add("phaseLockControlMethod", "synth");
            Info.Add("PGClockLine", Boards["pg"] + "/PFI2");
            Info.Add("PatternGeneratorBoard", pgBoard);
            Info.Add("PGType", "dedicated");

            // YAG laser
            yag = new BrilliantLaser("ASRL1::INSTR");

            // add the GPIB instruments
            Instruments.Add("green", new HP8657ASynth("GPIB0::7::INSTR"));
            Instruments.Add("red", new HP3325BSynth("GPIB0::12::INSTR"));
            Instruments.Add("4861", new ICS4861A("GPIB0::4::INSTR"));
            Instruments.Add("bCurrentMeter", new HP34401A("GPIB0::22::INSTR"));
            Instruments.Add("rfCounter", new Agilent53131A("GPIB0::3::INSTR"));
            Instruments.Add("rfPower", new HP438A("GPIB0::13::INSTR"));

            // map the digital channels
            // these channels are generally switched by the pattern generator
            // they're all in the lower half of the pg
            AddDigitalOutputChannel("valve", pgBoard, 0, 0);
            AddDigitalOutputChannel("flash", pgBoard, 0, 1);
            AddDigitalOutputChannel("q", pgBoard, 0, 2);
            AddDigitalOutputChannel("detector", pgBoard, 0, 3);
            AddDigitalOutputChannel("detectorprime", pgBoard, 1, 2);             // this trigger is for switch scanning
            // see ModulatedAnalogShotGatherer.cs
            // for details.
            AddDigitalOutputChannel("rfSwitch", pgBoard, 0, 4);
            AddDigitalOutputChannel("fmSelect", pgBoard, 1, 0);            // This line selects which fm voltage is
            // sent to the synth.
            AddDigitalOutputChannel("attenuatorSelect", pgBoard, 0, 5);    // This line selects the attenuator voltage
            // sent to the voltage-controlled attenuator.
            AddDigitalOutputChannel("piFlip", pgBoard, 1, 1);
            AddDigitalOutputChannel("ttlSwitch", pgBoard, 1, 3);                // This is the output that the pg
            // will switch if it's switch scanning.
            AddDigitalOutputChannel("scramblerEnable", pgBoard, 1, 4);

            // these channel are usually software switched - they should not be in
            // the lower half of the pattern generator
            AddDigitalOutputChannel("b", pgBoard, 2, 0);
            AddDigitalOutputChannel("notB", pgBoard, 2, 1);
            AddDigitalOutputChannel("db", pgBoard, 2, 2);
            AddDigitalOutputChannel("notDB", pgBoard, 2, 3);
//			AddDigitalOutputChannel("notEOnOff", pgBoard, 2, 4);  // this line seems to be broken on our pg board
//          AddDigitalOutputChannel("eOnOff", pgBoard, 2, 5);  // this and the above are not used now we have analog E control
            AddDigitalOutputChannel("targetStepper", pgBoard, 2, 5);
            AddDigitalOutputChannel("ePol", pgBoard, 2, 6);
            AddDigitalOutputChannel("notEPol", pgBoard, 2, 7);
            AddDigitalOutputChannel("eBleed", pgBoard, 3, 0);
            AddDigitalOutputChannel("piFlipEnable", pgBoard, 3, 1);
            AddDigitalOutputChannel("notPIFlipEnable", pgBoard, 3, 5);
            AddDigitalOutputChannel("pumpShutter", pgBoard, 3, 3);
            AddDigitalOutputChannel("probeShutter", pgBoard, 3, 4);
            AddDigitalOutputChannel("argonShutter", pgBoard, 3, 2);// (3,6) & (3,7) are dead.

            // map the analog channels

            // These channels are on the daq board. Used mainly for diagnostic purposes.
            // On no account should they switch during the edm acquisition pattern.
            AddAnalogInputChannel("iodine", daqBoard + "/ai2", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("cavity", daqBoard + "/ai3", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("probePD", daqBoard + "/ai4", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("pumpPD", daqBoard + "/ai5", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("northLeakage", daqBoard + "/ai6", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("southLeakage", daqBoard + "/ai7", AITerminalConfiguration.Nrse);
            // Used ai10,11 & 12 over 6,7 & 8 for miniFluxgates, because ai8, 9 have an isolated ground.
            AddAnalogInputChannel("miniFlux1", daqBoard + "/ai10", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("miniFlux2", daqBoard + "/ai11", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("miniFlux3", daqBoard + "/ai12", AITerminalConfiguration.Nrse);


            // high quality analog inputs (will be) on the S-series analog in board
            AddAnalogInputChannel("top", analogIn + "/ai0", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("norm", analogIn + "/ai1", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("magnetometer", analogIn + "/ai2", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("gnd", analogIn + "/ai3", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("battery", analogIn + "/ai4", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("piMonitor", analogIn + "/ai5", AITerminalConfiguration.Differential);


            AddAnalogOutputChannel("phaseScramblerVoltage", daqBoard + "/ao0");
            AddAnalogOutputChannel("b", daqBoard + "/ao1");

            // rf rack control
            //AddAnalogInputChannel("rfPower", usbDAQ1 + "/ai0", AITerminalConfiguration.Rse);

            AddAnalogOutputChannel("rf1Attenuator", usbDAQ1 + "/ao0", 0, 5);
            AddAnalogOutputChannel("rf2Attenuator", usbDAQ1 + "/ao1", 0, 5);
            AddAnalogOutputChannel("rf1FM", usbDAQ2 + "/ao0", 0, 5);
            AddAnalogOutputChannel("rf2FM", usbDAQ2 + "/ao1", 0, 5);

            // E field control and monitoring
            AddAnalogInputChannel("cPlusMonitor", usbDAQ3 + "/ai1", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("cMinusMonitor", usbDAQ3 + "/ai2", AITerminalConfiguration.Differential);

            AddAnalogOutputChannel("cPlus", usbDAQ3 + "/ao0", -5, 0);
            AddAnalogOutputChannel("cMinus", usbDAQ3 + "/ao1", 0, 5);

            // B field control
            AddAnalogOutputChannel("steppingBBias", usbDAQ4 + "/ao0", 0, 5);

            // FL control
            AddAnalogOutputChannel("flPZT", usbDAQ4 + "/ao1", 0, 5);

            // map the counter channels
            AddCounterChannel("phaseLockOscillator", counterBoard + "/ctr7");
            AddCounterChannel("phaseLockReference", counterBoard + "/pfi10");
            //AddCounterChannel("northLeakage", counterBoard +"/ctr0");
            //AddCounterChannel("southLeakage", counterBoard +"/ctr1");
        }
示例#14
0
        public PXIEDMHardwareNormal()
        {
            // add the boards
            Boards.Add("daq", "/PXI1Slot18");
            Boards.Add("pg", "/PXI1Slot10");
            Boards.Add("counter", "/PXI1Slot3");
            Boards.Add("aoBoard", "/PXI1Slot4");
            // this drives the rf attenuators
            Boards.Add("usbDAQ1", "/Dev2");
            Boards.Add("analogIn", "/PXI1Slot2");
            Boards.Add("usbDAQ2", "/dev1");
            Boards.Add("usbDAQ3", "/dev4");
            Boards.Add("usbDAQ4", "/dev3");
            Boards.Add("tclBoard", "/PXI1Slot9");
            string pgBoard      = (string)Boards["pg"];
            string daqBoard     = (string)Boards["daq"];
            string counterBoard = (string)Boards["counter"];
            string aoBoard      = (string)Boards["aoBoard"];
            string usbDAQ1      = (string)Boards["usbDAQ1"];
            string analogIn     = (string)Boards["analogIn"];
            string usbDAQ2      = (string)Boards["usbDAQ2"];
            string usbDAQ3      = (string)Boards["usbDAQ3"];
            string usbDAQ4      = (string)Boards["usbDAQ4"];
            string tclBoard     = (string)Boards["tclBoard"];

            // add things to the info
            // the analog triggers
            Info.Add("analogTrigger0", (string)Boards["analogIn"] + "/PFI0");
            Info.Add("analogTrigger1", (string)Boards["analogIn"] + "/PFI1");

            Info.Add("sourceToDetect", 1.3);
            Info.Add("moleculeMass", 193.0);
            Info.Add("phaseLockControlMethod", "synth");
            Info.Add("PGClockLine", pgBoard + "/PFI4"); //Mapped to PFI2 on 6533 connector
            Info.Add("PatternGeneratorBoard", pgBoard);
            Info.Add("PGType", "dedicated");
            // rf counter switch control seq``
            Info.Add("IodineFreqMon", new bool[] { false, false });      // IN 1
            Info.Add("pumpAOMFreqMon", new bool[] { false, true });      // IN 2
            Info.Add("FLModulationFreqMon", new bool[] { true, false }); // IN 3

            Info.Add("PGTrigger", pgBoard + "/PFI5");                    //Mapped to PFI7 on 6533 connector

            // YAG laser
            yag = new BrilliantLaser("ASRL2::INSTR");

            // add the GPIB/RS232 instruments
            Instruments.Add("green", new HP8657ASynth("GPIB0::7::INSTR"));
            Instruments.Add("red", new HP3325BSynth("GPIB0::12::INSTR"));
            Instruments.Add("4861", new ICS4861A("GPIB0::4::INSTR"));
            Instruments.Add("bCurrentMeter", new HP34401A("GPIB0::22::INSTR"));
            Instruments.Add("rfCounter", new Agilent53131A("GPIB0::3::INSTR"));
            //Instruments.Add("rfCounter2", new Agilent53131A("GPIB0::5::INSTR"));
            Instruments.Add("rfPower", new HP438A("GPIB0::13::INSTR"));
            Instruments.Add("BfieldController", new SerialDAQ("ASRL12::INSTR"));
            Instruments.Add("rfCounter2", new SerialAgilent53131A("ASRL8::INSTR"));
            Instruments.Add("probePolControl", new SerialMotorControllerBCD("ASRL5::INSTR"));
            Instruments.Add("pumpPolControl", new SerialMotorControllerBCD("ASRL3::INSTR"));


            // map the digital channels
            // these channels are generally switched by the pattern generator
            // they're all in the lower half of the pg
            AddDigitalOutputChannel("valve", pgBoard, 0, 0);
            AddDigitalOutputChannel("flash", pgBoard, 0, 1);
            AddDigitalOutputChannel("q", pgBoard, 0, 2);
            AddDigitalOutputChannel("detector", pgBoard, 0, 3);
            AddDigitalOutputChannel("detectorprime", pgBoard, 1, 2); // this trigger is for switch scanning
            // see ModulatedAnalogShotGatherer.cs
            // for details.
            AddDigitalOutputChannel("rfSwitch", pgBoard, 0, 4);
            AddDigitalOutputChannel("fmSelect", pgBoard, 1, 0);         // This line selects which fm voltage is
            // sent to the synth.
            AddDigitalOutputChannel("attenuatorSelect", pgBoard, 0, 5); // This line selects the attenuator voltage
            // sent to the voltage-controlled attenuator.
            AddDigitalOutputChannel("piFlip", pgBoard, 1, 1);
            AddDigitalOutputChannel("ttlSwitch", pgBoard, 1, 3);        // This is the output that the pg
            // will switch if it's switch scanning.
            AddDigitalOutputChannel("scramblerEnable", pgBoard, 1, 4);

            //RF Counter Control (single pole 4 throw)
            //AddDigitalOutputChannel("rfCountSwBit1", pgBoard, 3, 5);
            //AddDigitalOutputChannel("rfCountSwBit2", pgBoard, 3, 6);

            // new rf amp blanking
            AddDigitalOutputChannel("rfAmpBlanking", pgBoard, 1, 5);

            // these channel are usually software switched - they should not be in
            // the lower half of the pattern generator
            AddDigitalOutputChannel("b", pgBoard, 2, 0);
            AddDigitalOutputChannel("notB", pgBoard, 2, 1);
            AddDigitalOutputChannel("db", pgBoard, 2, 2);
            AddDigitalOutputChannel("notDB", pgBoard, 2, 3);
            //			AddDigitalOutputChannel("notEOnOff", pgBoard, 2, 4);  // this line seems to be broken on our pg board
            //          AddDigitalOutputChannel("eOnOff", pgBoard, 2, 5);  // this and the above are not used now we have analog E control
            AddDigitalOutputChannel("targetStepper", pgBoard, 2, 5);
            AddDigitalOutputChannel("ePol", pgBoard, 2, 6);
            AddDigitalOutputChannel("notEPol", pgBoard, 2, 7);
            AddDigitalOutputChannel("eBleed", pgBoard, 3, 0);
            AddDigitalOutputChannel("piFlipEnable", pgBoard, 3, 1);
            AddDigitalOutputChannel("notPIFlipEnable", pgBoard, 3, 5);
            AddDigitalOutputChannel("pumpShutter", pgBoard, 3, 3);
            AddDigitalOutputChannel("probeShutter", pgBoard, 3, 4);
            AddDigitalOutputChannel("argonShutter", pgBoard, 3, 2);

            //I2 Lock Control
            AddDigitalOutputChannel("I2PropSwitch", pgBoard, 2, 4);
            AddDigitalOutputChannel("I2IntSwitch", pgBoard, 3, 6);



            AddDigitalOutputChannel("fibreAmpEnable", aoBoard, 0, 0);

            // Map the digital input channels
            AddDigitalInputChannel("fibreAmpMasterErr", aoBoard, 0, 1);
            AddDigitalInputChannel("fibreAmpSeedErr", aoBoard, 0, 2);
            AddDigitalInputChannel("fibreAmpBackFeflectErr", aoBoard, 0, 3);
            AddDigitalInputChannel("fibreAmpTempErr", aoBoard, 0, 4);
            AddDigitalInputChannel("fibreAmpPowerSupplyErr", aoBoard, 0, 5);

            // map the analog channels
            // These channels are on the daq board. Used mainly for diagnostic purposes.
            // On no account should they switch during the edm acquisition pattern.
            AddAnalogInputChannel("diodeLaserCurrent", daqBoard + "/ai0", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("iodine", daqBoard + "/ai2", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("cavity", daqBoard + "/ai3", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("probePD", daqBoard + "/ai4", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("pumpPD", daqBoard + "/ai5", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("northLeakage", daqBoard + "/ai6", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("southLeakage", daqBoard + "/ai7", AITerminalConfiguration.Nrse);
            // Used ai13,11 & 12 over 6,7 & 8 for miniFluxgates, because ai8, 9 have an isolated ground.
            AddAnalogInputChannel("miniFlux1", daqBoard + "/ai13", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("miniFlux2", daqBoard + "/ai11", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("miniFlux3", daqBoard + "/ai12", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("piMonitor", daqBoard + "/ai10", AITerminalConfiguration.Nrse);
            //AddAnalogInputChannel("diodeLaserRefCavity", daqBoard + "/ai13", AITerminalConfiguration.Nrse);
            // Don't use ai10, cross talk with other channels on this line

            // high quality analog inputs (will be) on the S-series analog in board
            AddAnalogInputChannel("top", analogIn + "/ai0", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("norm", analogIn + "/ai1", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("magnetometer", analogIn + "/ai2", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("gnd", analogIn + "/ai3", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("battery", analogIn + "/ai4", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("piMonitor", analogIn + "/ai5", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("bFieldCurrentMonitor", analogIn + "/ai6", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("reflectedrf1Amplitude", analogIn + "/ai5", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("reflectedrf2Amplitude", analogIn + "/ai6", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("rfCurrent", analogIn + "/ai7 ", AITerminalConfiguration.Differential);

            AddAnalogOutputChannel("phaseScramblerVoltage", aoBoard + "/ao0");
            AddAnalogOutputChannel("b", aoBoard + "/ao1");


            // rf rack control
            //AddAnalogInputChannel("rfPower", usbDAQ1 + "/ai0", AITerminalConfiguration.Rse);

            AddAnalogOutputChannel("rf1Attenuator", usbDAQ1 + "/ao0", 0, 5);
            AddAnalogOutputChannel("rf2Attenuator", usbDAQ1 + "/ao1", 0, 5);
            AddAnalogOutputChannel("rf1FM", usbDAQ2 + "/ao0", 0, 5);
            AddAnalogOutputChannel("rf2FM", usbDAQ2 + "/ao1", 0, 5);

            // E field control and monitoring
            AddAnalogInputChannel("cPlusMonitor", usbDAQ3 + "/ai1", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("cMinusMonitor", usbDAQ3 + "/ai2", AITerminalConfiguration.Differential);

            AddAnalogOutputChannel("cPlus", usbDAQ3 + "/ao0", 0, 10);
            AddAnalogOutputChannel("cMinus", usbDAQ3 + "/ao1", 0, 10);

            // B field control
            //AddAnalogOutputChannel("steppingBBias", usbDAQ4 + "/ao0", 0, 5);


            // map the counter channels
            AddCounterChannel("phaseLockOscillator", counterBoard + "/ctr7");
            AddCounterChannel("phaseLockReference", counterBoard + "/pfi10");
            //AddCounterChannel("northLeakage", counterBoard + "/ctr0");
            //AddCounterChannel("southLeakage", counterBoard + "/ctr1");

            //TCL Lockable lasers
            //Info.Add("TCLLockableLasers", new string[][] { new string[] { "flPZT2" }, /*new string[] { "flPZT2Temp" },*/ new string[] { "fibreAOM", "flPZT2Temp" } });
            Info.Add("TCLLockableLasers", new string[] { "flPZT2" });                 //, new string[] { "flPZT2Temp" }, new string[] { "fibreAOM"} });
            Info.Add("TCLPhotodiodes", new string[] { "transCavV", "master", "p1" }); // THE FIRST TWO MUST BE CAVITY AND MASTER PHOTODIODE!!!!
            Info.Add("TCL_Slave_Voltage_Limit_Upper", 10.0);                          //volts: Laser control
            Info.Add("TCL_Slave_Voltage_Limit_Lower", 0.0);                           //volts: Laser control
            Info.Add("TCL_Default_Gain", -1.1);
            //Info.Add("TCL_Default_ScanPoints", 250);
            Info.Add("TCL_Default_VoltageToLaser", 2.5);
            Info.Add("TCL_Default_VoltageToDependent", 1.0);
            // Some matching up for TCL
            Info.Add("flPZT2", "p1");
            Info.Add("flPZT2Temp", "p1");
            //Info.Add("fibreAOM", "p1");
            Info.Add("TCLTrigger", tclBoard + "/PFI0");
            Info.Add("TCL_MAX_INPUT_VOLTAGE", 10.0);

            AddAnalogInputChannel("transCavV", tclBoard + "/ai0", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("master", tclBoard + "/ai1", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("p1", tclBoard + "/ai2", AITerminalConfiguration.Rse);

            // Laser control
            //AddAnalogOutputChannel("flPZT", usbDAQ4 + "/ao1", 0, 5);
            AddAnalogOutputChannel("flPZT", aoBoard + "/ao7", 0, 10);
            AddAnalogOutputChannel("flPZT2", aoBoard + "/ao2", 0, 10);
            AddAnalogOutputChannel("fibreAmpPwr", aoBoard + "/ao3");
            //AddAnalogOutputChannel("pumpAOM", aoBoard + "/ao4", 0, 10);
            AddAnalogOutputChannel("pumpAOM", usbDAQ4 + "/ao0", 0, 5);
            //AddAnalogOutputChannel("flPZT2Temp", aoBoard + "/ao5", 0, 4); //voltage must not exceed 4V for Koheras laser
            //AddAnalogOutputChannel("flPZT2Cur", aoBoard + "/ao6", 0, 5); //voltage must not exceed 5V for Koheras laser
            //AddAnalogOutputChannel("fibreAOM", usbDAQ4 + "/ao1", 0, 5);
            AddAnalogOutputChannel("rampfb", aoBoard + "/ao4", -10, 10);
            AddAnalogOutputChannel("I2LockBias", aoBoard + "/ao5", 0, 5);
        }
示例#15
0
        public PXIEDMHardware()
        {
            // add the boards
            Boards.Add("daq", "/PXI1Slot18");
            Boards.Add("pg", "/PXI1Slot10");
            Boards.Add("doBoard", "/PXI1Slot11");
            Boards.Add("analogIn2", "/PXI1Slot17");
            Boards.Add("counter", "/PXI1Slot16");
            Boards.Add("aoBoard", "/PXI1Slot2");
            // this drives the rf attenuators
            Boards.Add("usbDAQ1", "/Dev2");
            Boards.Add("analogIn", "/PXI1Slot15");
            Boards.Add("usbDAQ2", "/Dev4");
            Boards.Add("usbDAQ3", "/Dev1");
            Boards.Add("usbDAQ4", "/Dev3");
            //Boards.Add("tclBoardPump", "/PXI1Slot17");
            //Boards.Add("tclBoardProbe", "/PXI1Slot9");
            string rfAWG        = (string)Boards["rfAWG"];
            string pgBoard      = (string)Boards["pg"];
            string daqBoard     = (string)Boards["daq"];
            string analogIn2    = (string)Boards["analogIn2"];
            string counterBoard = (string)Boards["counter"];
            string aoBoard      = (string)Boards["aoBoard"];
            string usbDAQ1      = (string)Boards["usbDAQ1"];
            string analogIn     = (string)Boards["analogIn"];
            string usbDAQ2      = (string)Boards["usbDAQ2"];
            string usbDAQ3      = (string)Boards["usbDAQ3"];
            string usbDAQ4      = (string)Boards["usbDAQ4"];
            string doBoard      = (string)Boards["doBoard"];

            //string tclBoardPump = (string)Boards["tclBoardPump"];
            //string tclBoardProbe = (string)Boards["tclBoardProbe"];

            // add things to the info
            // the analog triggers
            Info.Add("analogTrigger0", (string)Boards["analogIn"] + "/PFI0");
            Info.Add("analogTrigger1", (string)Boards["analogIn"] + "/PFI1");

            Info.Add("sourceToDetect", 1.3);
            Info.Add("moleculeMass", 193.0);
            Info.Add("machineLengthRatio", 3.842);
            Info.Add("defaultGate", new double[] { 2190, 80 });


            Info.Add("phaseLockControlMethod", "synth");
            Info.Add("PGClockLine", pgBoard + "/PFI4"); //Mapped to PFI2 on 6533 connector
            Info.Add("PatternGeneratorBoard", pgBoard);
            Info.Add("PGType", "dedicated");
            // rf counter switch control seq``
            Info.Add("IodineFreqMon", new bool[] { false, false });      // IN 1
            Info.Add("pumpAOMFreqMon", new bool[] { false, true });      // IN 2
            Info.Add("FLModulationFreqMon", new bool[] { true, false }); // IN 3

            Info.Add("PGTrigger", pgBoard + "/PFI5");                    //Mapped to PFI7 on 6533 connector

            // YAG laser
            yag = new BrilliantLaser("ASRL13::INSTR");

            // add the GPIB/RS232/USB instruments
            Instruments.Add("green", new HP8657ASynth("GPIB0::7::INSTR"));
            //Instruments.Add("gigatronix", new Gigatronics7100Synth("GPIB0::19::INSTR"));
            Instruments.Add("red", new HP3325BSynth("ASRL12::INSTR"));
            Instruments.Add("4861", new ICS4861A("GPIB0::4::INSTR"));
            Instruments.Add("bCurrentMeter", new HP34401A("GPIB0::12::INSTR"));
            Instruments.Add("rfCounter", new Agilent53131A("GPIB0::3::INSTR"));
            //Instruments.Add("rfCounter2", new Agilent53131A("GPIB0::5::INSTR"));
            Instruments.Add("rfPower", new HP438A("GPIB0::13::INSTR"));
            Instruments.Add("BfieldController", new SerialDAQ("ASRL19::INSTR"));
            Instruments.Add("rfCounter2", new SerialAgilent53131A("ASRL17::INSTR"));
            Instruments.Add("probePolControl", new SerialMotorControllerBCD("ASRL8::INSTR"));
            Instruments.Add("pumpPolControl", new SerialMotorControllerBCD("ASRL11::INSTR"));
            Instruments.Add("anapico", new AnapicoSynth("USB0::1003::45055::321-028100000-0168::0::INSTR"));       //old anapico 1 channel
            Instruments.Add("anapicoSYN420", new AnapicoSynth("USB0::0x03EB::0xAFFF::322-03A100005-0539::INSTR")); // new 2 channel anapico
            Instruments.Add("rfAWG", new NIPXI5670("PXI1Slot4"));

            // map the digital channels
            // these channels are generally switched by the pattern generator
            // they're all in the lower half of the pg
            AddDigitalOutputChannel("valve", pgBoard, 0, 0);
            AddDigitalOutputChannel("flash", pgBoard, 0, 1);
            AddDigitalOutputChannel("q", pgBoard, 0, 2);
            AddDigitalOutputChannel("detector", pgBoard, 0, 3);
            AddDigitalOutputChannel("detectorprime", pgBoard, 1, 2); // this trigger is for switch scanning
            // see ModulatedAnalogShotGatherer.cs
            // for details.
            AddDigitalOutputChannel("rfSwitch", pgBoard, 0, 4);
            AddDigitalOutputChannel("fmSelect", pgBoard, 1, 0);         // This line selects which fm voltage is
            // sent to the synth.
            AddDigitalOutputChannel("attenuatorSelect", pgBoard, 0, 5); // This line selects the attenuator voltage
            // sent to the voltage-controlled attenuator.
            AddDigitalOutputChannel("piFlip", pgBoard, 1, 1);
            //AddDigitalOutputChannel("ttlSwitch", pgBoard, 1, 3);	// This is the output that the pg
            // will switch if it's switch scanning.
            AddDigitalOutputChannel("ttlSwitch", pgBoard, 3, 5);        // This is the output that the pg
            AddDigitalOutputChannel("scramblerEnable", pgBoard, 1, 4);

            //RF Counter Control (single pole 4 throw)
            //AddDigitalOutputChannel("rfCountSwBit1", pgBoard, 3, 5);
            //AddDigitalOutputChannel("rfCountSwBit2", pgBoard, 3, 6);

            // new rf amp blanking
            AddDigitalOutputChannel("rfAmpBlanking", pgBoard, 1, 5);
            AddDigitalOutputChannel("mwEnable", pgBoard, 3, 3);
            AddDigitalOutputChannel("mwSelectPumpChannel", pgBoard, 3, 6);
            AddDigitalOutputChannel("mwSelectTopProbeChannel", pgBoard, 3, 2);
            AddDigitalOutputChannel("mwSelectBottomProbeChannel", pgBoard, 2, 4);
            AddDigitalOutputChannel("pumprfSwitch", pgBoard, 3, 4);

            // rf awg test
            AddDigitalOutputChannel("rfAWGTestTrigger", doBoard, 0, 1);

            // these channel are usually software switched - they are on the AO board
            AddDigitalOutputChannel("b", aoBoard, 0, 0);
            AddDigitalOutputChannel("notB", aoBoard, 0, 1);

            AddDigitalOutputChannel("db", aoBoard, 0, 2);
            AddDigitalOutputChannel("notDB", aoBoard, 0, 3);
            AddDigitalOutputChannel("piFlipEnable", aoBoard, 0, 4);
            AddDigitalOutputChannel("notPIFlipEnable", aoBoard, 0, 5); //not connected to anything
            AddDigitalOutputChannel("mwSwitching", aoBoard, 0, 6);

            // these digitial outputs are switched slowly during the pattern
            AddDigitalOutputChannel("ePol", usbDAQ4, 0, 4);
            AddDigitalOutputChannel("notEPol", usbDAQ4, 0, 5);
            AddDigitalOutputChannel("eBleed", usbDAQ4, 0, 6);
            AddDigitalOutputChannel("eSwitching", usbDAQ4, 0, 7);


            // these digitial outputs are are not switched during the pattern
            AddDigitalOutputChannel("argonShutter", usbDAQ4, 0, 0);
            AddDigitalOutputChannel("patternTTL", usbDAQ4, 0, 2);
            AddDigitalOutputChannel("rfPowerAndFreqSelectSwitch", usbDAQ4, 0, 3);
            AddDigitalOutputChannel("targetStepper", usbDAQ4, 0, 1);;


            // map the analog channels
            // These channels are on the daq board. Used mainly for diagnostic purposes.
            AddAnalogInputChannel("iodine", daqBoard + "/ai2", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("valveMonVoltage", daqBoard + "/ai4", AITerminalConfiguration.Rse);
            //AddAnalogInputChannel("cavity", daqBoard + "/ai3", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("topPD", daqBoard + "/ai3", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("bottomPD", daqBoard + "/ai5", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("northLeakage", daqBoard + "/ai6", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("southLeakage", daqBoard + "/ai7", AITerminalConfiguration.Nrse);
            //AddAnalogInputChannel("northLeakage", usbDAQ4 + "/ai0", AITerminalConfiguration.Rse);
            //AddAnalogInputChannel("southLeakage", usbDAQ4 + "/ai1", AITerminalConfiguration.Rse);

            // Used ai13,11 & 12 over 6,7 & 8 for miniFluxgates, because ai8, 9 have an isolated ground.
            AddAnalogInputChannel("miniFlux1", daqBoard + "/ai13", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("miniFlux2", daqBoard + "/ai11", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("miniFlux3", daqBoard + "/ai12", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("ground", daqBoard + "/ai14", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("piMonitor", daqBoard + "/ai10", AITerminalConfiguration.Nrse);
            //AddAnalogInputChannel("diodeLaserRefCavity", daqBoard + "/ai13", AITerminalConfiguration.Nrse);
            // Don't use ai10, cross talk with other channels on this line

            // high quality analog inputs (will be) on the S-series analog in board
            // The last number in AddAnalogInputChannel is an optional calibration which turns VuS and MHz
            AddAnalogInputChannel("topProbe", analogIn + "/ai0", AITerminalConfiguration.Differential, 0.1);
            AddAnalogInputChannel("bottomProbe", analogIn + "/ai1", AITerminalConfiguration.Differential, 0.02);
            AddAnalogInputChannel("magnetometer", analogIn + "/ai2", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("gnd", analogIn + "/ai3", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("battery", analogIn + "/ai4", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("piMonitor", analogIn + "/ai5", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("bFieldCurrentMonitor", analogIn + "/ai6", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("reflectedrf1Amplitude", analogIn + "/ai5", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("reflectedrf2Amplitude", analogIn + "/ai6", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("rfCurrent", analogIn + "/ai7 ", AITerminalConfiguration.Differential);

            AddAnalogInputChannel("middlePenningGauge", daqBoard + "/ai15", AITerminalConfiguration.Rse); //nothing is connected here; only here bc hardware controller needs it to build

            //temp inputs used for magnetic noise diagnosis in test shield, cables are labelled "00EW"
            AddAnalogInputChannel("quSpinFS_Y", analogIn + "/ai5", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("quSpinFS_Z", analogIn + "/ai6", AITerminalConfiguration.Differential);
            //mag inputs for quspins inside the chamber
            AddAnalogInputChannel("quSpinFV_Y", analogIn2 + "/ai2", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("quSpinFV_Z", analogIn2 + "/ai3", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("quSpinB0_Y", analogIn2 + "/ai2", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("quSpinB0_Z", analogIn2 + "/ai3", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("quSpinEV_Y", analogIn + "/ai6", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("quSpinEV_Z", analogIn2 + "/ai1", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("quSpinEW_Y", analogIn + "/ai5", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("quSpinEW_Z", analogIn + "/ai7", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("quSpinEX_Y", analogIn2 + "/ai4", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("quSpinEX_Z", analogIn2 + "/ai5", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("quSpinEU_Y", analogIn2 + "/ai6", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("quSpinEU_Z", analogIn2 + "/ai7", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("battery2", analogIn2 + "/ai7", AITerminalConfiguration.Differential);//temp move to have battery on both DAQs to monitor


            //AddAnalogInputChannel("Bart200_Z", analogIn + "/ai5", AITerminalConfiguration.Differential);//this was stolen from penning gauge monitor
            //AddAnalogInputChannel("Bart200_X", daqBoard + "/ai3", AITerminalConfiguration.Rse);
            //AddAnalogInputChannel("Bart200_Y", daqBoard + "/ai15", AITerminalConfiguration.Rse);
            //AddAnalogInputChannel("Bart200_Z", daqBoard + "/ai5", AITerminalConfiguration.Rse);//stolen from pump and probe mon pds, which are legacy so can be replaced anyway

            //This analog input is broken, we assign this as a dummy so we don't break the rest of the code
            AddAnalogInputChannel("laserPowerMeter", analogIn2 + "/ai0", AITerminalConfiguration.Differential);

            AddAnalogOutputChannel("phaseScramblerVoltage", aoBoard + "/ao10");
            AddAnalogOutputChannel("bScan", aoBoard + "/ao2");

            //Coherent 899 dye laser ctrl voltage
            AddAnalogOutputChannel("Coherent899ControlVoltage", aoBoard + "/ao12", -5, 5);

            // B field control
            //AddAnalogOutputChannel("steppingBBias", usbDAQ4 + "/ao0", 0, 5);
            // Add B field stepping box bias analog output to this board for now (B field controller is not connected to anything!)
            AddAnalogOutputChannel("steppingBBias", aoBoard + "/ao8", -10, 10);

            // rf rack control
            //AddAnalogInputChannel("rfPower", usbDAQ1 + "/ai0", AITerminalConfiguration.Rse);

            AddAnalogOutputChannel("rf1Attenuator", usbDAQ1 + "/ao0", 0, 5);
            AddAnalogOutputChannel("rf2Attenuator", usbDAQ1 + "/ao1", 0, 5);
            AddAnalogOutputChannel("rf1FM", usbDAQ2 + "/ao0", 0, 5);
            AddAnalogOutputChannel("rf2FM", usbDAQ2 + "/ao1", 0, 5);

            //Source control
            AddAnalogOutputChannel("valveCtrlVoltage", aoBoard + "/ao14", 0, 8);

            // E field control and monitoring
            AddAnalogInputChannel("cPlusMonitor", usbDAQ3 + "/ai1", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("cMinusMonitor", usbDAQ3 + "/ai2", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("cPlusMonitor", daqBoard + "/ai0", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("cMinusMonitor", daqBoard + "/ai1", AITerminalConfiguration.Differential);

            AddAnalogOutputChannel("cPlus", usbDAQ3 + "/ao1", 0, 10);
            AddAnalogOutputChannel("cMinus", usbDAQ3 + "/ao0", 0, 10); //Use these two lines for the applied kilovolts supply which provides 1kV/V

            //AddAnalogOutputChannel("cPlus", usbDAQ3 + "/ao1", 0,3.5);//these last two are for use with the bertan HV supply which requires 0 to -5V control voltage for 0 to +15kV output on the positive box
            //AddAnalogOutputChannel("cMinus", usbDAQ3 + "/ao0", -3.5,0);


            // map the counter channels
            AddCounterChannel("phaseLockOscillator", counterBoard + "/ctr7");
            AddCounterChannel("phaseLockReference", counterBoard + "/pfi10");
            //AddCounterChannel("northLeakage", counterBoard + "/ctr0");
            //AddCounterChannel("southLeakage", counterBoard + "/ctr1");


            // Cavity inputs for the cavity that controls the Pump lasers
            //AddAnalogInputChannel("PumpCavityRampVoltage", tclBoardPump + "/ai8", AITerminalConfiguration.Rse); //tick
            //AddAnalogInputChannel("Pumpmaster", tclBoardPump + "/ai1", AITerminalConfiguration.Rse);
            //AddAnalogInputChannel("Pumpp1", tclBoardPump + "/ai2", AITerminalConfiguration.Rse);
            //AddAnalogInputChannel("Pumpp2", tclBoardPump + "/ai3", AITerminalConfiguration.Rse);

            // Lasers locked to pump cavity
            //AddAnalogOutputChannel("KeopsysDiodeLaser", tclBoardPump + "/ao2", -4, 4); //tick
            //AddAnalogOutputChannel("MenloPZT", tclBoardPump + "/ao0", 0, 10); //tick

            // Length stabilisation for pump cavity
            //AddAnalogOutputChannel("PumpCavityLengthVoltage", tclBoardPump + "/ao1", -10, 10); //tick

            //TCL configuration for pump cavity
            //TCLConfig tcl1 = new TCLConfig("Pump Cavity");
            //tcl1.AddLaser("MenloPZT", "Pumpp1");
            //tcl1.AddLaser("KeopsysDiodeLaser", "Pumpp2");
            //tcl1.Trigger = tclBoardPump + "/PFI0";
            //tcl1.Cavity = "PumpCavityRampVoltage";
            //tcl1.MasterLaser = "Pumpmaster";
            //tcl1.Ramp = "PumpCavityLengthVoltage";
            //tcl1.TCPChannel = 1190;
            //tcl1.AnalogSampleRate = 61250;
            //tcl1.DefaultScanPoints = 500;
            //tcl1.MaximumNLMFSteps = 20;
            //tcl1.PointsToConsiderEitherSideOfPeakInFWHMs = 2.5;
            //tcl1.TriggerOnRisingEdge = false;
            //tcl1.AddFSRCalibration("MenloPZT", 3.84);
            //tcl1.AddFSRCalibration("KeopsysDiodeLaser", 3.84);
            //tcl1.AddDefaultGain("Master", 0.3);
            //tcl1.AddDefaultGain("MenloPZT", -0.2);
            //tcl1.AddDefaultGain("KeopsysDiodeLaser", 4);
            //Info.Add("PumpCavity", tcl1);
            //Info.Add("DefaultCavity", tcl1);

            // Probe cavity inputs
            //AddAnalogInputChannel("ProbeRampVoltage", tclBoardProbe + "/ai0", AITerminalConfiguration.Rse); //tick
            //AddAnalogInputChannel("Probemaster", tclBoardProbe + "/ai1", AITerminalConfiguration.Rse); //tick
            //AddAnalogInputChannel("Probep1", tclBoardProbe + "/ai2", AITerminalConfiguration.Rse); //tick

            // Lasers locked to Probe cavity
            //AddAnalogOutputChannel("TopticaSHGPZT", tclBoardProbe + "/ao0", -4, 4); //tick
            //AddAnalogOutputChannel("ProbeCavityLengthVoltage", tclBoardProbe + "/ao1", -10, 10); //tick

            // TCL configuration for Probe cavity
            //TCLConfig tcl2 = new TCLConfig("Probe Cavity");
            //tcl2.AddLaser("TopticaSHGPZT", "Probep1");
            //tcl2.Trigger = tclBoardProbe + "/PFI0";
            //tcl2.Cavity = "ProbeRampVoltage";
            //tcl2.MasterLaser = "Probemaster";
            //tcl2.Ramp = "ProbeCavityLengthVoltage";
            //tcl2.TCPChannel = 1191;
            //tcl2.AnalogSampleRate = 61250/2;
            //tcl2.DefaultScanPoints = 250;
            //tcl2.MaximumNLMFSteps = 20;
            //tcl2.PointsToConsiderEitherSideOfPeakInFWHMs = 12;
            //tcl2.AddFSRCalibration("TopticaSHGPZT", 3.84);
            //tcl2.TriggerOnRisingEdge = false;
            //tcl2.AddDefaultGain("Master", 0.4);
            //tcl2.AddDefaultGain("TopticaSHGPZT", 0.04);
            //Info.Add("ProbeCavity", tcl2);
            //Info.Add("DefaultCavity", tcl2);

            //probe AOM control
            AddAnalogOutputChannel("probeAOM", aoBoard + "/ao29", 0, 10);
            AddAnalogOutputChannel("probeAOMamp", aoBoard + "/ao28", 0, 10);

            //Obselete Laser control
            AddAnalogOutputChannel("pumpAOM", aoBoard + "/ao20", 0, 10);
            AddAnalogOutputChannel("fibreAmpPwr", aoBoard + "/ao3");
            AddAnalogOutputChannel("I2LockBias", aoBoard + "/ao5", 0, 5);

            //Microwave Control Channels
            AddAnalogOutputChannel("uWaveDCFM", aoBoard + "/ao11", -2.5, 2.5);
            //AddAnalogOutputChannel("uWaveMixerV", aoBoard + "/ao12", 0, 10);
            AddAnalogOutputChannel("pumpMixerV", aoBoard + "/ao19", 0, 5);
            AddAnalogOutputChannel("bottomProbeMixerV", aoBoard + "/ao24", 0, 5);
            AddAnalogOutputChannel("topProbeMixerV", aoBoard + "/ao25", 0, 5);



            //RF control Channels
            AddAnalogOutputChannel("VCO161Amp", aoBoard + "/ao13", 0, 10);
            AddAnalogOutputChannel("VCO161Freq", aoBoard + "/ao14", 0, 10);
            AddAnalogOutputChannel("VCO30Amp", aoBoard + "/ao15", 0, 10);
            AddAnalogOutputChannel("VCO30Freq", aoBoard + "/ao16", 0, 10);
            AddAnalogOutputChannel("VCO155Amp", aoBoard + "/ao17", 0, 10);
            AddAnalogOutputChannel("VCO155Freq", aoBoard + "/ao18", 0, 10);
        }
示例#16
0
        public BufferClassicHardware()
        {
            // add the boards
            Boards.Add("daq", "/DAQ_PXIe_6363");
            Boards.Add("pg", "/PG_PXIe_6535");
            Boards.Add("tcl", "/TCL_PXI_6229");
            Boards.Add("UEDMHardwareController", "/UEDM_Hardware_Controller_PXI_6229");
            string daqBoard = (string)Boards["daq"];
            string pgBoard  = (string)Boards["pg"];
            string TCLBoard = (string)Boards["tcl"];
            string UEDMHardwareControllerBoard = (string)Boards["UEDMHardwareController"];

            // map the digital channels of the "pg" card
            AddDigitalOutputChannel("q", pgBoard, 0, 0);        //Pin 10
            AddDigitalOutputChannel("aom", pgBoard, 1, 1);      //
            AddDigitalOutputChannel("aom2", pgBoard, 1, 2);     //
            AddDigitalOutputChannel("shutter1", pgBoard, 1, 3); //
            AddDigitalOutputChannel("shutter2", pgBoard, 1, 4); //
            AddDigitalOutputChannel("flash", pgBoard, 0, 2);    //Pin 45
            AddDigitalOutputChannel("chirpTrigger", pgBoard, 0, 3);
            //(0,3) pin 12 is unconnected
            //AddDigitalOutputChannel("heatersS1TriggerDigitalOutputTask", pgBoard, 1, 6);// Pin 21, used to be "shutterTrig1" (triggers camera for on-shots (not wired up))
            //AddDigitalOutputChannel("heatersS2TriggerDigitalOutputTask", pgBoard, 1, 7);// Pin 22, used to be "shutterTrig2" (triggers camera for off-shots (not wired up))
            AddDigitalOutputChannel("probe", pgBoard, 0, 1);         //Pin 44 previously connected to aom (not wired up)
            AddDigitalOutputChannel("valve", pgBoard, 0, 6);         //
            AddDigitalOutputChannel("detector", pgBoard, 1, 0);      //Pin 16 (onShot)from pg to daq
            AddDigitalOutputChannel("detectorprime", pgBoard, 0, 7); //Pin 15 (OffShot)from pg to daq
            //digital output P 0.6 wired up, not used (Pin 48)

            // map the digital channels of the "daq" card
            // this is the digital output from the daq board that the TTlSwitchPlugin wil switch
            AddDigitalOutputChannel("digitalSwitchChannel", daqBoard, 0, 0);//enable for camera
            //AddDigitalOutputChannel("cryoTriggerDigitalOutputTask", daqBoard, 0, 0);// cryo cooler digital logic


            // add things to the info
            // the analog triggers
            Info.Add("analogTrigger0", daqBoard + "/PFI0");
            Info.Add("analogTrigger1", daqBoard + "/PFI1");
            Info.Add("phaseLockControlMethod", "analog");
            Info.Add("PGClockLine", Boards["pg"] + "/PFI4");
            Info.Add("PatternGeneratorBoard", pgBoard);
            Info.Add("PGType", "dedicated");

            // external triggering control
            Info.Add("PGTrigger", pgBoard + "/PFI1"); //Mapped to PFI7 on 6533 connector


            // map the analog input channels for "daq" card
            AddAnalogInputChannel("Temp1", daqBoard + "/ai0", AITerminalConfiguration.Rse);                  //Pin 31
            AddAnalogInputChannel("pressureGauge_beamline", daqBoard + "/ai1", AITerminalConfiguration.Rse); //Pin 31. Used to be "Temp2"
            AddAnalogInputChannel("TempRef", daqBoard + "/ai2", AITerminalConfiguration.Rse);                //Pin 66
            //AddAnalogInputChannel("pressureGauge_source", daqBoard + "/ai3", AITerminalConfiguration.Rse);//Pin 33 pressure reading at the moment
            AddAnalogInputChannel("detector1", daqBoard + "/ai4", AITerminalConfiguration.Rse);              //Pin 68
            AddAnalogInputChannel("detector2", daqBoard + "/ai5", AITerminalConfiguration.Rse);              //Pin
            AddAnalogInputChannel("detector3", daqBoard + "/ai6", AITerminalConfiguration.Rse);              //Pin 34
            AddAnalogInputChannel("cavitylong", daqBoard + "/ai7", AITerminalConfiguration.Rse);             //Pin 28
            //AddAnalogInputChannel("cellTemperatureMonitor", daqBoard + "/ai8", AITerminalConfiguration.Rse);//Pin 60 used to be "cavityshort"

            // map the analog output channels for "daq" card
            AddAnalogOutputChannel("IRrampfb", daqBoard + "/ao0"); //Pin 22
            AddAnalogOutputChannel("v2laser", daqBoard + "/ao1");  //pin 21

            // map the analog input channels for the "UEDMHardwareControllerBoard" card
            AddAnalogInputChannel("cellTemperatureMonitor", UEDMHardwareControllerBoard + "/ai0", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("S1TemperatureMonitor", UEDMHardwareControllerBoard + "/ai1", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("S2TemperatureMonitor", UEDMHardwareControllerBoard + "/ai2", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("SF6TemperatureMonitor", UEDMHardwareControllerBoard + "/ai3", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("pressureGaugeSource", UEDMHardwareControllerBoard + "/ai4", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("pressureGaugeBeamline", UEDMHardwareControllerBoard + "/ai5", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("AI11", UEDMHardwareControllerBoard + "/ai11", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("AI12", UEDMHardwareControllerBoard + "/ai12", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("AI13", UEDMHardwareControllerBoard + "/ai13", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("AI14", UEDMHardwareControllerBoard + "/ai14", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("AI15", UEDMHardwareControllerBoard + "/ai15", AITerminalConfiguration.Rse);

            // map the digital channels of the "UEDMHardwareControllerBoard" card
            AddDigitalOutputChannel("Port00", UEDMHardwareControllerBoard, 0, 0);
            AddDigitalOutputChannel("Port01", UEDMHardwareControllerBoard, 0, 1);
            AddDigitalOutputChannel("Port02", UEDMHardwareControllerBoard, 0, 2);
            AddDigitalOutputChannel("Port03", UEDMHardwareControllerBoard, 0, 3);
            AddDigitalOutputChannel("heatersS2TriggerDigitalOutputTask", UEDMHardwareControllerBoard, 0, 4);
            AddDigitalOutputChannel("heatersS1TriggerDigitalOutputTask", UEDMHardwareControllerBoard, 0, 5);

            // map the analog output channels for the "UEDMHardwareControllerBoard" card
            //AddAnalogOutputChannel("laser", Unnamed + "/ao0");
            //AddAnalogOutputChannel("phaseLockAnalogOutput", Unnamed + "/ao1")

            // map the digital channels of the "UEDMHardwareControllerBoard" card
            //AddDigitalOutputChannel("cryoTriggerDigitalOutputTask", UEDMHardwareControllerBoard, 0, 0);// cryo cooler digital logic

            // map the analog input channels for the "tcl" card
            AddAnalogInputChannel("VISmaster", TCLBoard + "/ai0", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("VIScavityRampMonitor", TCLBoard + "/ai1", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("VISp1_v1laser", TCLBoard + "/ai2", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("VISp2_probelaser", TCLBoard + "/ai3", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("VISp3_v0laser", TCLBoard + "/ai4", AITerminalConfiguration.Rse);
            //AddAnalogInputChannel("xxx", TCLBoard + "/ai5", AITerminalConfiguration.Rse); unused
            //AddAnalogInputChannel("xxx", TCLBoard + "/ai6", AITerminalConfiguration.Rse); unused
            //AddAnalogInputChannel("xxx", TCLBoard + "/ai7", AITerminalConfiguration.Rse); unused
            //AddAnalogInputChannel("xxx", TCLBoard + "/ai8", AITerminalConfiguration.Rse); unused
            //AddAnalogInputChannel("xxx", TCLBoard + "/ai9", AITerminalConfiguration.Rse); unused
            AddAnalogInputChannel("IRp1_v2laser", TCLBoard + "/ai10", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("IRmaster", TCLBoard + "/ai11", AITerminalConfiguration.Rse);
            //AddAnalogInputChannel("xxx", TCLBoard + "/ai16", AITerminalConfiguration.Rse); unused
            //AddAnalogInputChannel("xxx", TCLBoard + "/ai17", AITerminalConfiguration.Rse); unused
            //AddAnalogInputChannel("xxx", TCLBoard + "/ai18", AITerminalConfiguration.Rse); unused
            //AddAnalogInputChannel("xxx", TCLBoard + "/ai19", AITerminalConfiguration.Rse); unused
            //AddAnalogInputChannel("xxx", TCLBoard + "/ai20", AITerminalConfiguration.Rse); unused

            // map the analog output channels for the tcl card
            AddAnalogOutputChannel("VISrampfb", TCLBoard + "/ao0");
            AddAnalogOutputChannel("v1laser", TCLBoard + "/ao1");
            AddAnalogOutputChannel("probelaser", TCLBoard + "/ao2", 0, 10);
            AddAnalogOutputChannel("v0laser", TCLBoard + "/ao3", 0, 10);

            // add the GPIB/RS232/USB instruments
            Instruments.Add("tempController", new LakeShore336TemperatureController("ASRL3::INSTR"));
            Instruments.Add("neonFlowController", new FlowControllerMKSPR4000B("ASRL4::INSTR"));


// TCL, we can now put many cavities in a single instance of TCL (thanks to Luke)
// multiple cavities share a single ramp (BaseRamp analog input) + trigger
// Hardware limitation that all read photodiode/ramp signals must share the same hardware card (hardware configured triggered read)
            TCLConfig tclConfig = new TCLConfig("TCL");

            tclConfig.Trigger                = TCLBoard + "/PFI0";
            tclConfig.BaseRamp               = "VIScavityRampMonitor";
            tclConfig.TCPChannel             = 1190;
            tclConfig.DefaultScanPoints      = 1000;
            tclConfig.AnalogSampleRate       = 15000;
            tclConfig.SlaveVoltageLowerLimit = 0.0;
            tclConfig.SlaveVoltageUpperLimit = 10.0;
            tclConfig.PointsToConsiderEitherSideOfPeakInFWHMs = 4;
            tclConfig.MaximumNLMFSteps = 20;

            string VISCavity = "VISCavity";

            tclConfig.AddCavity(VISCavity);
            tclConfig.Cavities[VISCavity].RampOffset  = "VISrampfb";
            tclConfig.Cavities[VISCavity].MasterLaser = "VISmaster";
            tclConfig.Cavities[VISCavity].AddDefaultGain("VISmaster", 0.2);
            tclConfig.Cavities[VISCavity].AddSlaveLaser("v1laser", "VISp1_v1laser");
            tclConfig.Cavities[VISCavity].AddDefaultGain("v1laser", 0.2);
            tclConfig.Cavities[VISCavity].AddFSRCalibration("v1laser", 3.84);
            tclConfig.Cavities[VISCavity].AddSlaveLaser("probelaser", "VISp2_probelaser");
            tclConfig.Cavities[VISCavity].AddDefaultGain("probelaser", 0.2);
            tclConfig.Cavities[VISCavity].AddFSRCalibration("probelaser", 3.84);
            tclConfig.Cavities[VISCavity].AddSlaveLaser("v0laser", "VISp3_v0laser");
            tclConfig.Cavities[VISCavity].AddDefaultGain("v0laser", 0.2);
            tclConfig.Cavities[VISCavity].AddFSRCalibration("v0laser", 3.84);


            string IRCavity = "IRCavity";

            tclConfig.AddCavity(IRCavity);
            tclConfig.Cavities[IRCavity].RampOffset  = "IRrampfb";
            tclConfig.Cavities[IRCavity].MasterLaser = "IRmaster";
            tclConfig.Cavities[IRCavity].AddDefaultGain("IRmaster", 0.2);
            tclConfig.Cavities[IRCavity].AddSlaveLaser("v2laser", "IRp1_v2laser");
            tclConfig.Cavities[IRCavity].AddDefaultGain("v2laser", 0.2);
            tclConfig.Cavities[IRCavity].AddFSRCalibration("v2laser", 3.84);

            Info.Add("TCLConfig", tclConfig);
            Info.Add("DefaultCavity", tclConfig);

            //These need to be activated for the phase lock
            //AddCounterChannel("phaseLockOscillator", daqBoard + "/ctr0"); //This should be the source pin of a counter PFI 8
            //AddCounterChannel("phaseLockReference", daqBoard + "/PFI9"); //This should be the gate pin of the same counter - need to check it's name
        }
示例#17
0
        public MoleculeMOTHardware()
        {
            //Boards
            string digitalPatternBoardName    = "digitalPattern";
            string digitalPatternBoardAddress = "/Dev1";

            Boards.Add(digitalPatternBoardName, digitalPatternBoardAddress);

            string analogPatternBoardName    = "analogPattern";
            string analogPatternBoardAddress = "/PXI1Slot2"; //7

            Boards.Add(analogPatternBoardName, analogPatternBoardAddress);

            string tclBoard1Name    = "tclBoard1";
            string tclBoard1Address = "/PXI1Slot3";

            Boards.Add(tclBoard1Name, tclBoard1Address);

            string tclBoard2Name    = "tclBoard2";
            string tclBoard2Address = "/PXI1Slot8";

            Boards.Add(tclBoard2Name, tclBoard2Address);

            string tclBoard3Name    = "tclBoard3";
            string tclBoard3Address = "/PXI1Slot6";

            Boards.Add(tclBoard3Name, tclBoard3Address);

            string usbBoard1Name    = "usbBoard1";
            string usbBoard1Address = "/Dev2";

            Boards.Add(usbBoard1Name, usbBoard1Address);

            string usbBoard2Name    = "usbBoard2";
            string usbBoard2Address = "/Dev3";

            Boards.Add(usbBoard2Name, usbBoard2Address);


            string digitalPatternBoardName2    = "digitalPattern2";
            string digitalPatternBoardAddress2 = "/PXI1Slot4";

            Boards.Add(digitalPatternBoardName2, digitalPatternBoardAddress2);


            // Channel Declarations

            AddAnalogInputChannel("ramp", tclBoard1Address + "/ai4", AITerminalConfiguration.Rse);

            // Hamish
            AddAnalogInputChannel("v00PD", tclBoard1Address + "/ai0", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("v10PD", tclBoard1Address + "/ai1", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("bXPD", tclBoard1Address + "/ai2", AITerminalConfiguration.Rse);
            AddDigitalInputChannel("bXLockBlockFlag", tclBoard1Address, 0, 0);
            AddDigitalInputChannel("v00LockBlockFlag", tclBoard1Address, 0, 1);
            AddAnalogInputChannel("refPDHamish", tclBoard1Address + "/ai3", AITerminalConfiguration.Rse);

            AddAnalogOutputChannel("v00Lock", tclBoard1Address + "/ao0");
            AddAnalogOutputChannel("v10Lock", tclBoard1Address + "/ao1");
            AddAnalogOutputChannel("bXLock", tclBoard3Address + "/ao2");
            AddAnalogOutputChannel("cavityLockHamish", tclBoard3Address + "/ao3");


            // Carlos
            AddAnalogInputChannel("v21PD", tclBoard1Address + "/ai5", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("v32PD", tclBoard1Address + "/ai6", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("refPDCarlos", tclBoard1Address + "/ai7", AITerminalConfiguration.Rse);

            AddAnalogOutputChannel("v21Lock", tclBoard2Address + "/ao0");
            AddAnalogOutputChannel("v32Lock", usbBoard1Address + "/ao0", 0, 5);
            AddAnalogOutputChannel("cavityLockCarlos", tclBoard2Address + "/ao1");


            // Digital Pattern
            AddDigitalOutputChannel("flashLamp", digitalPatternBoardAddress, 0, 0);
            AddDigitalOutputChannel("qSwitch", digitalPatternBoardAddress, 0, 1);
            AddDigitalOutputChannel("bXSlowingAOM", digitalPatternBoardAddress, 0, 2);
            AddDigitalOutputChannel("v00MOTAOM", digitalPatternBoardAddress, 0, 3);
            AddDigitalOutputChannel("v10SlowingAOM", digitalPatternBoardAddress, 0, 4);
            AddDigitalOutputChannel("microwaveA", digitalPatternBoardAddress, 0, 5);
            AddDigitalOutputChannel("microwaveB", digitalPatternBoardAddress, 0, 6);
            AddDigitalOutputChannel("cameraTrigger", digitalPatternBoardAddress, 0, 7);
            AddDigitalOutputChannel("cameraTrigger2", digitalPatternBoardAddress, 1, 7);
            AddDigitalOutputChannel("aoPatternTrigger", digitalPatternBoardAddress, 1, 0);
            AddDigitalOutputChannel("v00MOTShutter", digitalPatternBoardAddress, 1, 1);
            AddDigitalOutputChannel("bXSlowingShutter", digitalPatternBoardAddress, 1, 2);
            AddDigitalOutputChannel("bXLockBlock", digitalPatternBoardAddress, 1, 3);
            AddDigitalOutputChannel("v00LockBlock", digitalPatternBoardAddress, 2, 1);
            AddDigitalOutputChannel("topCoilDirection", digitalPatternBoardAddress, 1, 4);
            AddDigitalOutputChannel("bottomCoilDirection", digitalPatternBoardAddress, 1, 5);
            AddDigitalOutputChannel("rbCoolingAOM", digitalPatternBoardAddress, 1, 6);
            AddDigitalOutputChannel("v00Sidebands", digitalPatternBoardAddress, 2, 0);
            AddDigitalOutputChannel("heliumShutter", digitalPatternBoardAddress, 2, 2);
            AddDigitalOutputChannel("microwaveC", digitalPatternBoardAddress, 3, 2);


            // Rb Digital Pattern
            AddDigitalOutputChannel("rbPushBeam", digitalPatternBoardAddress, 1, 6);
            AddDigitalOutputChannel("rbOpticalPumpingAOM", digitalPatternBoardAddress, 2, 3);
            AddDigitalOutputChannel("rbAbsImagingBeam", digitalPatternBoardAddress, 2, 5);
            AddDigitalOutputChannel("rbRepump", digitalPatternBoardAddress, 2, 6);
            AddDigitalOutputChannel("rb2DCooling", digitalPatternBoardAddress, 2, 7);
            AddDigitalOutputChannel("rb3DCooling", digitalPatternBoardAddress, 3, 0);
            AddDigitalOutputChannel("rbAbsImgCamTrig", digitalPatternBoardAddress, 3, 1);
            // Rb shutters
            AddDigitalOutputChannel("rb3DMOTShutter", digitalPatternBoardAddress, 2, 4);
            AddDigitalOutputChannel("rb2DMOTShutter", digitalPatternBoardAddress, 3, 5);

            //AddDigitalOutputChannel("rbspeedbumpCoilsBamAbsorptionShutter", digitalPatternBoardAddress, 3, 6);
            AddDigitalOutputChannel("rbPushBamAbsorptionShutter", digitalPatternBoardAddress, 3, 6);

            AddDigitalOutputChannel("rbOPShutter", digitalPatternBoardAddress, 3, 7);
            AddDigitalOutputChannel("dipoleTrapAOM", digitalPatternBoardAddress, 3, 3);



            // tweezer new digital pattern board
            AddDigitalOutputChannel("test00", digitalPatternBoardAddress2, 0, 0);


            // Analog Pattern
            AddAnalogOutputChannel("slowingChirp", analogPatternBoardAddress + "/ao8");
            AddAnalogOutputChannel("v00Intensity", analogPatternBoardAddress + "/ao9");
            AddAnalogOutputChannel("v00EOMAmp", analogPatternBoardAddress + "/ao11");
            AddAnalogOutputChannel("v00Frequency", analogPatternBoardAddress + "/ao12");
            AddAnalogOutputChannel("MOTCoilsCurrent", analogPatternBoardAddress + "/ao13"); //13
            //AddAnalogOutputChannel("triggerDelay", analogPatternBoardAddress + "/ao15");
            AddAnalogOutputChannel("xShimCoilCurrent", analogPatternBoardAddress + "/ao17");
            AddAnalogOutputChannel("yShimCoilCurrent", analogPatternBoardAddress + "/ao16");
            AddAnalogOutputChannel("zShimCoilCurrent", analogPatternBoardAddress + "/ao21");
            AddAnalogOutputChannel("slowingCoilsCurrent", analogPatternBoardAddress + "/ao18");
            AddAnalogOutputChannel("v00Chirp", analogPatternBoardAddress + "/ao22");
            AddAnalogOutputChannel("topCoilShunt", analogPatternBoardAddress + "/ao26");

            // Old Rb Analog Pattern
            AddAnalogOutputChannel("rbCoolingIntensity", analogPatternBoardAddress + "/ao23"); // from old setup
            AddAnalogOutputChannel("rbCoolingFrequency", analogPatternBoardAddress + "/ao24"); // TTL in?


            // New Rb
            AddAnalogOutputChannel("rb3DCoolingFrequency", analogPatternBoardAddress + "/ao1");
            AddAnalogOutputChannel("rbRepumpFrequency", analogPatternBoardAddress + "/ao3");
            AddAnalogOutputChannel("rbAbsImagingFrequency", analogPatternBoardAddress + "/ao4");
            AddAnalogOutputChannel("rb3DCoolingAttenuation", analogPatternBoardAddress + "/ao0");
            AddAnalogOutputChannel("rbRepumpAttenuation", analogPatternBoardAddress + "/ao5");
            AddAnalogOutputChannel("rbOffsetLock", analogPatternBoardAddress + "/ao15");

            // Transfer coil
            AddAnalogOutputChannel("transferCoils", analogPatternBoardAddress + "/ao6");
            AddAnalogOutputChannel("transferCoilsShunt1", analogPatternBoardAddress + "/ao7");
            AddAnalogOutputChannel("transferCoilsShunt2", analogPatternBoardAddress + "/ao27");

            // Tweezer MOT coils

            AddAnalogOutputChannel("speedbumpCoils", analogPatternBoardAddress + "/ao20");
            AddAnalogOutputChannel("DipoleTrapLaserControl", analogPatternBoardAddress + "/ao29");
            AddAnalogOutputChannel("TweezerMOTCoils", analogPatternBoardAddress + "/ao28");

            // Source
            AddDigitalOutputChannel("cryoCooler", usbBoard2Address, 0, 0);
            AddDigitalOutputChannel("sourceHeater", usbBoard2Address, 0, 1);
            AddAnalogInputChannel("sourceTemp", usbBoard2Address + "/ai0", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("sf6Temp", tclBoard2Address + "/ai0", AITerminalConfiguration.Rse);


            // TCL Config
            //TCLConfig tcl1 = new TCLConfig("Hamish");
            //tcl1.AddLaser("v00Lock", "v00PD");
            //tcl1.AddLaser("v10Lock", "v10PD");
            //tcl1.AddLaser("bXLock", "bXPD");
            //tcl1.Trigger = tclBoard1Address + "/PFI0";
            //tcl1.Cavity = "rampHamish";
            //tcl1.MasterLaser = "refPDHamish";
            //tcl1.Ramp = "cavityLockHamish";
            //tcl1.TCPChannel = 1190;
            //tcl1.AddDefaultGain("Master", 1.0);
            //tcl1.AddDefaultGain("v00Lock", 2);
            //tcl1.AddDefaultGain("v10Lock", 0.5);
            //tcl1.AddDefaultGain("bXLock", -2);
            //tcl1.AddFSRCalibration("v00Lock", 3.95); //This is an approximate guess
            //tcl1.AddFSRCalibration("v10Lock", 4.15);
            //tcl1.AddFSRCalibration("bXLock", 3.9);
            //tcl1.DefaultScanPoints = 850;
            //tcl1.PointsToConsiderEitherSideOfPeakInFWHMs = 3;
            //Info.Add("Hamish", tcl1);

            //TCLConfig tcl2 = new TCLConfig("Carlos");
            //tcl2.AddLaser("v21Lock", "v21PD");
            //tcl2.AddLaser("v32Lock", "v32PD");
            //tcl2.Trigger = tclBoard2Address + "/PFI0";
            //tcl2.Cavity = "rampCarlos";
            //tcl2.MasterLaser = "refPDCarlos";
            //tcl2.Ramp = "cavityLockCarlos";
            //tcl2.TCPChannel = 1191;
            //tcl2.AddDefaultGain("Master", 1.0);
            //tcl2.AddDefaultGain("v21Lock", -0.4);
            //tcl2.AddDefaultGain("v32Lock", 0.2);
            //tcl2.AddFSRCalibration("v21Lock", 3.7); //This is an approximate guess
            //tcl2.AddFSRCalibration("v32Lock", 3.7);
            //tcl2.DefaultScanPoints = 900;
            //tcl2.PointsToConsiderEitherSideOfPeakInFWHMs = 3;
            //Info.Add("Carlos", tcl2);

            TCLConfig tclConfig = new TCLConfig("Hamish & Carlos");

            tclConfig.Trigger           = tclBoard1Address + "/PFI0";
            tclConfig.BaseRamp          = "ramp";
            tclConfig.TCPChannel        = 1190;
            tclConfig.DefaultScanPoints = 1000;
            tclConfig.PointsToConsiderEitherSideOfPeakInFWHMs = 4;
            tclConfig.AnalogSampleRate = 62000;
            string hamish = "Hamish";
            string carlos = "Carlos";

            tclConfig.AddCavity(hamish);
            tclConfig.Cavities[hamish].AddSlaveLaser("v00Lock", "v00PD");
            tclConfig.Cavities[hamish].AddLockBlocker("v00Lock", "v00LockBlockFlag");
            tclConfig.Cavities[hamish].AddSlaveLaser("v10Lock", "v10PD");
            tclConfig.Cavities[hamish].AddSlaveLaser("bXLock", "bXPD");
            tclConfig.Cavities[hamish].AddLockBlocker("bXLock", "bXLockBlockFlag");
            tclConfig.Cavities[hamish].MasterLaser = "refPDHamish";
            tclConfig.Cavities[hamish].RampOffset  = "cavityLockHamish";
            tclConfig.Cavities[hamish].AddDefaultGain("Master", 1.0);
            tclConfig.Cavities[hamish].AddDefaultGain("v00Lock", 2);
            tclConfig.Cavities[hamish].AddDefaultGain("v10Lock", 0.5);
            tclConfig.Cavities[hamish].AddDefaultGain("bXLock", -2);
            tclConfig.Cavities[hamish].AddFSRCalibration("v00Lock", 3.95); //This is an approximate guess
            tclConfig.Cavities[hamish].AddFSRCalibration("v10Lock", 4.15);
            tclConfig.Cavities[hamish].AddFSRCalibration("bXLock", 3.9);

            tclConfig.AddCavity(carlos);
            tclConfig.Cavities[carlos].AddSlaveLaser("v21Lock", "v21PD");
            tclConfig.Cavities[carlos].AddSlaveLaser("v32Lock", "v32PD");
            tclConfig.Cavities[carlos].MasterLaser = "refPDCarlos";
            tclConfig.Cavities[carlos].RampOffset  = "cavityLockCarlos";
            tclConfig.Cavities[carlos].AddDefaultGain("Master", 1.0);
            tclConfig.Cavities[carlos].AddDefaultGain("v21Lock", -0.2);
            tclConfig.Cavities[carlos].AddDefaultGain("v32Lock", 1.0);
            tclConfig.Cavities[carlos].AddFSRCalibration("v21Lock", 3.7); //This is an approximate guess
            tclConfig.Cavities[carlos].AddFSRCalibration("v32Lock", 3.7);

            Info.Add("TCLConfig", tclConfig);



            // MOTMaster configuration
            MMConfig mmConfig = new MMConfig(false, false, true, false);

            mmConfig.ExternalFilePattern = "*.tif";
            Info.Add("MotMasterConfiguration", mmConfig);
            Info.Add("AOPatternTrigger", analogPatternBoardAddress + "/PFI4"); //PFI6
            Info.Add("PatternGeneratorBoard", digitalPatternBoardAddress);
            Info.Add("PGType", "dedicated");
            Info.Add("Element", "CaF");
            //Info.Add("PGTrigger", Boards["pg"] + "/PFI2");   // trigger from "cryocooler sync" box, delay controlled from "triggerDelay" analog output


            // ScanMaster configuration
            //Info.Add("defaultTOFRange", new double[] { 4000, 12000 }); // these entries are the two ends of the range for the upper TOF graph
            //Info.Add("defaultTOF2Range", new double[] { 0, 1000 }); // these entries are the two ends of the range for the middle TOF graph
            //Info.Add("defaultGate", new double[] { 6000, 2000 }); // the first entry is the centre of the gate, the second is the half width of the gate (upper TOF graph)


            // Instruments
            Instruments.Add("windfreak", new WindfreakSynth("ASRL8::INSTR"));
            Instruments.Add("gigatronics 1", new Gigatronics7100Synth("GPIB0::19::INSTR"));
            Instruments.Add("gigatronics 2", new Gigatronics7100Synth("GPIB0::6::INSTR"));


            // Calibrations
            //AddCalibration("freqToVoltage", new PolynomialCalibration(new double[] { -9.7727, 0.16604, -0.0000272 }, 70, 130)); //this is a quadratic fit to the manufacturer's data for a POS-150
            //AddCalibration("motAOMAmp", new PolynomialCalibration(new double[] {6.2871, -0.5907, -0.0706, -0.0088, -0.0004}, -12, 4)); // this is a polynomial fit (up to quartic) to measured behaviour
        }
示例#18
0
        public AddInstrumentQuandlViewModel(IDataClient client, IDialogCoordinator dialogCoordinator, string authToken)
        {
            _client            = client;
            _dialogCoordinator = dialogCoordinator;

            //Create commands
            Load = ReactiveCommand.CreateFromTask(async _ =>
            {
                var dsResult = await _client.GetDatasources().ConfigureAwait(true);
                if (dsResult.WasSuccessful)
                {
                    _thisDS = dsResult.Result.FirstOrDefault(x => x.Name == "Quandl");
                }
                else
                {
                    _logger.Error("Could not find FRED datasource");
                }
            });

            var canSearch = this.WhenAnyValue(x => x.Symbol).Select(x => !string.IsNullOrEmpty(x));

            Search = ReactiveCommand.CreateFromTask(async _ =>
            {
                Status = "Searching...";

                Instruments.Clear();
                QuandlUtils.QuandlInstrumentSearchResult foundInstruments;
                try
                {
                    foundInstruments = await QuandlUtils.FindInstruments(Symbol, authToken, CurrentPage ?? 1).ConfigureAwait(true);
                }
                catch (Exception ex)
                {
                    await _dialogCoordinator.ShowMessageAsync(this, "Error", ex.Message).ConfigureAwait(true);
                    return;
                }

                foreach (var i in foundInstruments.Instruments)
                {
                    i.Datasource   = _thisDS;
                    i.DatasourceID = _thisDS.ID;
                    i.Multiplier   = 1;
                    Instruments.Add(i);
                }

                Status = foundInstruments.Count + " contracts found";

                CurrentPage = CurrentPage ?? 1;
            }, canSearch);

            Add = ReactiveCommand.CreateFromTask <IList>(async selectedInstruments =>
            {
                int count = 0;

                foreach (Instrument instrument in selectedInstruments)
                {
                    instrument.Datasource   = _thisDS;
                    instrument.DatasourceID = _thisDS.ID;

                    var result = await _client.AddInstrument(instrument).ConfigureAwait(true);
                    if (await result.DisplayErrors(this, _dialogCoordinator).ConfigureAwait(true))
                    {
                        continue;
                    }

                    count++;
                    AddedInstruments.Add(result.Result);
                }

                Status = string.Format("{0}/{1} instruments added.", count, selectedInstruments.Count);
            });

            this.WhenAny(x => x.CurrentPage, x => x)
            .Select(x => new Unit())     //hack
            .InvokeCommand(Search);

            IncrementPage = ReactiveCommand.Create(() => CurrentPage == null ? 1 : CurrentPage++);
            DecrementPage = ReactiveCommand.Create(() => Math.Max(1, CurrentPage == null ? 1 : (int)CurrentPage--));
        }
        public override void Refresh()
        {
            //tags
            var selectedTags = Tags
                               .Where(x => x.IsChecked)
                               .Select(x => x.Item)
                               .ToList();

            Tags.Clear();

            foreach (var checkItem in Context
                     .Tags
                     .OrderBy(x => x.Name)
                     .ToList()
                     .Select(x => new CheckListItem <Tag>(x, selectedTags.Contains(x))))
            {
                Tags.Add(checkItem);
            }

            //strategies
            var selectedStrats = Strategies
                                 .Where(x => x.IsChecked)
                                 .Select(x => x.Item)
                                 .ToList();

            Strategies.Clear();

            foreach (var checkItem in Context
                     .Strategies
                     .OrderBy(x => x.Name)
                     .ToList()
                     .Select(x => new CheckListItem <Strategy>(x, selectedStrats.Contains(x))))
            {
                Strategies.Add(checkItem);
            }

            //Instruments
            if (Instruments.Count == 0)
            {
                //on first load we want all instruments selected, otherwise remember previous selection
                foreach (var checkItem in Context
                         .Instruments
                         .OrderBy(x => x.Symbol)
                         .ToList()
                         .Select(x => new CheckListItem <Instrument>(x, true)))
                {
                    Instruments.Add(checkItem);
                }
            }
            else
            {
                var selectedInstruments = Instruments
                                          .Where(x => x.IsChecked)
                                          .Select(x => x.Item)
                                          .ToList();
                Instruments.Clear();

                foreach (var checkItem in Context
                         .Instruments
                         .OrderBy(x => x.Symbol)
                         .ToList()
                         .Select(x => new CheckListItem <Instrument>(x, selectedInstruments.Contains(x))))
                {
                    Instruments.Add(checkItem);
                }
            }

            //benchmarks
            Benchmarks.Clear();
            foreach (Benchmark b in Context.Benchmarks.OrderBy(x => x.Name))
            {
                Benchmarks.Add(b);
            }

            //backtest results from the external data source
            BacktestSeries.Clear();
            if (Datasourcer.ExternalDataSource.Connected)
            {
                BacktestSeries.AddRange(
                    Datasourcer
                    .ExternalDataSource
                    .GetBacktestSeries());
            }
        }
示例#20
0
        public AddInstrumentBinanceViewModel(IDataClient client, IDialogCoordinator dialogCoordinator)
        {
            _client            = client;
            _dialogCoordinator = dialogCoordinator;

            //Create commands
            Load = ReactiveCommand.CreateFromTask(async _ =>
            {
                //load datasource
                var dsResult = await _client.GetDatasources().ConfigureAwait(true);
                if (dsResult.WasSuccessful)
                {
                    _thisDS = dsResult.Result.FirstOrDefault(x => x.Name == "Binance");
                }
                else
                {
                    _logger.Error("Could not find Binance datasource");
                    return;
                }

                //load instruments
                try
                {
                    var instruments = await BinanceUtils.GetInstruments(_thisDS);
                    foreach (var inst in instruments)
                    {
                        Instruments.Add(inst);
                        _allInstruments.Add(inst);
                    }
                }
                catch (Exception ex)
                {
                    _logger.Error(ex, "Could not load symbols from binance");
                }
            });

            Search = ReactiveCommand.Create(() =>
            {
                Instruments.Clear();
                foreach (var i in _allInstruments.Where(x => string.IsNullOrEmpty(Symbol) || //case-insensitive Contains()
                                                        x.Symbol.IndexOf(Symbol, StringComparison.OrdinalIgnoreCase) >= 0))
                {
                    Instruments.Add(i);
                }
            });

            Add = ReactiveCommand.CreateFromTask <IList>(async selectedInstruments =>
            {
                int count = 0;

                foreach (Instrument instrument in selectedInstruments)
                {
                    instrument.Datasource   = _thisDS;
                    instrument.DatasourceID = _thisDS.ID;

                    var result = await _client.AddInstrument(instrument).ConfigureAwait(true);
                    if (await result.DisplayErrors(this, _dialogCoordinator).ConfigureAwait(true))
                    {
                        continue;
                    }

                    count++;
                    AddedInstruments.Add(result.Result);
                }

                Status = string.Format("{0}/{1} instruments added.", count, selectedInstruments.Count);
            });

            this.WhenAny(x => x.Symbol, x => x)
            .Select(x => new Unit())     //hack
            .InvokeCommand(Search);
        }
示例#21
0
        public DecelerationHardware()
        {
            // YAG laser
            yag = new MiniliteLaser();

            // add the boards
            Boards.Add("daq", "/dev2");
            Boards.Add("multiDAQ", "/dev1");
            Boards.Add("pg", "/dev1");
            Boards.Add("aoBoard", "/PXI1Slot5");
            Boards.Add("usbDev", "/dev4");
            //Boards.Add("PXI6", "/PXI1Slot6_4");
            Boards.Add("PXI6", "/PXI1Slot6");
            Boards.Add("PXI4", "/PXI1Slot4");
            Boards.Add("PXI5", "/PXI1Slot5");
            string pgBoard   = (string)Boards["pg"];
            string usbBoard  = (string)Boards["usbDev"];
            string daqBoard  = (string)Boards["daq"];
            string PXIBoard  = (string)Boards["PXI6"];
            string TCLBoard  = (string)Boards["PXI4"];
            string TCLBoard2 = (string)Boards["PXI6"];
            string aoBoard   = (string)Boards["aoBoard"];

            //configure instance 1 of transfer cavity lock
            TCLConfig tcl1 = new TCLConfig("Hamish McCavity");

            tcl1.AddLaser("v00cooling", "p1");
            tcl1.AddLaser("v10repump", "p2");
            tcl1.AddLaser("eylsa", "p3");
            tcl1.Trigger     = TCLBoard + "/PFI0";
            tcl1.Cavity      = "cavity";
            tcl1.MasterLaser = "master";
            tcl1.Ramp        = "rampfb";
            tcl1.TCPChannel  = 1190;
            Info.Add("Hamish", tcl1);

            //configure instance 2 of transfer cavity lock
            TCLConfig tcl2 = new TCLConfig("Carlos the Cavity");

            tcl2.AddLaser("v21repump", "p12");
            tcl2.AddLaser("v32repump", "p22");
            tcl2.Trigger     = TCLBoard2 + "/PFI0";
            tcl2.Cavity      = "cavity2";
            tcl2.MasterLaser = "master2";
            tcl2.Ramp        = "rampfb2";
            tcl2.TCPChannel  = 1191;
            Info.Add("Carlos", tcl2);

            //MotMaster configuration
            MMConfig mmConfig = new MMConfig(false, false, false, false);

            mmConfig.ExternalFilePattern = "*.tif";
            Info.Add("MotMasterConfiguration", mmConfig);


            Instruments.Add("synth", new HP8673BSynth("GPIB0::19::INSTR"));
            //Instruments.Add("counter", new HP5350BCounter("GPIB0::14::INSTR"));

            //Instruments.Add("flowmeter", new FlowMeter("ASRL1::INSTR"));


            //VCO lock
            //AddAnalogOutputChannel("VCO_Out", PXIBoard + "/ao12", 0.0, 10.0);

            // add things to the info
            Info.Add("PGTrigger", Boards["pg"] + "/PFI2");          // trigger from "cryocooler sync" box, delay controlled from "triggerDelay" analog output
            //Info.Add("PGClockLine", Boards["pg"] + "/PFI2");
            Info.Add("PatternGeneratorBoard", pgBoard);
            Info.Add("PGType", "dedicated");
            Info.Add("AOPatternTrigger", aoBoard + "/PFI0");

            Info.Add("defaultTOFRange", new double[] { 4000, 12000 }); // these entries are the two ends of the range for the upper TOF graph
            Info.Add("defaultTOF2Range", new double[] { 0, 1000 });    // these entries are the two ends of the range for the middle TOF graph
            Info.Add("defaultGate", new double[] { 6000, 2000 });      // the first entry is the centre of the gate, the second is the half width of the gate (upper TOF graph)


            // the analog triggers
            Info.Add("analogTrigger0", (string)Boards["daq"] + "/PFI0"); // pin 11
            Info.Add("analogTrigger1", (string)Boards["daq"] + "/PFI1"); // pin 10
            //Info.Add("TCLTrigger", (string)Boards["PXI4"] + "/PFI0");
            //Info.Add("analogTrigger2", (string)Boards["usbDev"] + "/PFI0"); //Pin 29
            Info.Add("analogTrigger3", (string)Boards["daq"] + "/PFI6"); //Pin 5 - breakout 31
            Info.Add("usbAnalogTrigger", usbBoard + "/PFI0");
            //distance information
            Info.Add("sourceToDetect", 0.535);             //in m
            Info.Add("sourceToSoftwareDecelerator", 0.12); //in m
            //information about the molecule
            Info.Add("molecule", "caf");
            Info.Add("Element", "CaF");
            Info.Add("moleculeMass", 58.961);                   // this is 40CaF in atomic mass units
            Info.Add("moleculeRotationalConstant", 1.02675E10); //in Hz
            Info.Add("moleculeDipoleMoment", 15400.0);          //in Hz/(V/m)
            //information about the decelerator

            //These settings for WF
            Info.Add("deceleratorStructure", DecelerationConfig.DecelerationExperiment.SwitchStructure.V_H);             //Vertical first
            Info.Add("deceleratorLensSpacing", 0.006);
            Info.Add("deceleratorFieldMap", "RodLayout3_EonAxis.dat");
            Info.Add("mapPoints", 121);
            Info.Add("mapStartPoint", 0.0);
            Info.Add("mapResolution", 0.0001);

            // These settings for AG
            //	Info.Add("deceleratorStructure", DecelerationConfig.DecelerationExperiment.SwitchStructure.H_V); //Horizontal first
            //  Info.Add("deceleratorLensSpacing", 0.024);
            //  Info.Add("deceleratorFieldMap", "Section1v1_onAxisFieldTemplate.dat");
            //  Info.Add("mapPoints", 481);
            //  Info.Add("mapStartPoint", 0.0);
            //  Info.Add("mapResolution", 0.0001);

            //Here are constants for 174YbF for future reference
            //Info.Add("molecule", "ybf");
            //Info.Add("moleculeMass", 192.937); // this is 174YbF in atomic mass units
            //Info.Add("moleculeRotationalConstant", 7.2338E9); //in Hz
            //Info.Add("moleculeDipoleMoment", 19700.0); //in Hz/(V/m)

            // map the digital channels
            AddDigitalOutputChannel("valve", pgBoard, 0, 6);
            AddDigitalOutputChannel("tclBlock", pgBoard, 0, 6); //Same as valve; deliberately!
            AddDigitalOutputChannel("flash", pgBoard, 0, 0);    //Changed from pg board P.0.5 because that appears to have died mysteriously (line dead in ribbon cable?) TEW 06/04/09
            AddDigitalOutputChannel("q", pgBoard, 0, 2);
            AddDigitalOutputChannel("chirpTrigger", pgBoard, 1, 0);
            AddDigitalOutputChannel("detector", pgBoard, 3, 7);
            AddDigitalOutputChannel("detectorprime", pgBoard, 3, 6);
            AddDigitalOutputChannel("aom", pgBoard, 2, 1);  //Same channel as "ttl2" as used by the AomLevelControlPlugin. Now commented out.
            AddDigitalOutputChannel("aom2", pgBoard, 1, 6); // Pin 21 of PG board. Output 31 of front panel
            AddDigitalOutputChannel("v00Shutter", pgBoard, 2, 2);
            //AddDigitalOutputChannel("digitalSwitchChannel", pgBoard, 2, 2);
            AddDigitalOutputChannel("v00AOM", pgBoard, 1, 1);               //Pin 17
            AddDigitalOutputChannel("shimCoilSwitch", pgBoard, 1, 2);       //Pin 51
            AddDigitalOutputChannel("bXShutter", pgBoard, 1, 3);            //Pin 52
            AddDigitalOutputChannel("cameraTrigger", pgBoard, 0, 4);        // Pin 13
            AddDigitalOutputChannel("AnalogPatternTrigger", pgBoard, 3, 3); //Pin 31

            // map the analog channels
            AddAnalogInputChannel("pmt", daqBoard + "/ai0", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("pmt2", daqBoard + "/ai1", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("refcavity", daqBoard + "/ai1", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("lockcavity", daqBoard + "/ai2", AITerminalConfiguration.Rse);

            AddAnalogInputChannel("master", TCLBoard + "/ai1", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("cavity", TCLBoard + "/ai15", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("p1", TCLBoard + "/ai3", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("p2", TCLBoard + "/ai10", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("p3", TCLBoard + "/ai4", AITerminalConfiguration.Rse);

            AddAnalogOutputChannel("v10repump", TCLBoard + "/ao0");
            AddAnalogOutputChannel("rampfb", TCLBoard + "/ao1");

            AddAnalogOutputChannel("v00cooling", TCLBoard2 + "/ao2");
            AddAnalogOutputChannel("eylsa", TCLBoard2 + "/ao3");

            AddAnalogOutputChannel("slowingChirp", aoBoard + "/ao8");

            AddAnalogOutputChannel("v00Intensity", aoBoard + "/ao9");
            AddAnalogOutputChannel("v00Frequency", aoBoard + "/ao12");

            AddAnalogOutputChannel("MOTCoilsCurrent", aoBoard + "/ao13");

            AddAnalogOutputChannel("xShimCoilCurrent", aoBoard + "/ao17");
            AddAnalogOutputChannel("yShimCoilCurrent", aoBoard + "/ao16");
            AddAnalogOutputChannel("zShimCoilCurrent", aoBoard + "/ao14");

            AddAnalogOutputChannel("slowingCoilsCurrent", aoBoard + "/ao18");

            //second cavity

            AddAnalogInputChannel("master2", TCLBoard2 + "/ai0", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("cavity2", TCLBoard2 + "/ai4", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("p12", TCLBoard2 + "/ai1", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("p22", TCLBoard2 + "/ai2", AITerminalConfiguration.Rse);
            AddAnalogOutputChannel("v21repump", TCLBoard2 + "/ao0");
            AddAnalogOutputChannel("v32repump", usbBoard + "/ao0", 0, 5);
            AddAnalogOutputChannel("rampfb2", TCLBoard2 + "/ao1");



            // map the counter channels
            AddCounterChannel("pmt", daqBoard + "/ctr0");
            AddCounterChannel("sample clock", daqBoard + "/ctr1");

            //map the monitoring source chamber in deceleration hardware
            // AddAnalogInputChannel("RoughVacuum", PXIBoard + "/ai0", AITerminalConfiguration.Rse);
            //  AddAnalogInputChannel("PressureSourceChamber", PXIBoard + "/ai1", AITerminalConfiguration.Rse);
            //  AddAnalogInputChannel("VoltageReference", PXIBoard + "/ai2", AITerminalConfiguration.Rse);
            //  AddAnalogInputChannel("10KThermistor30KPlate", PXIBoard + "/ai3", AITerminalConfiguration.Rse);
            //  AddAnalogInputChannel("30KShield", PXIBoard + "/ai4", AITerminalConfiguration.Rse);
            //  AddAnalogInputChannel("4KCell", PXIBoard + "/ai5", AITerminalConfiguration.Rse);

            //map the channels to monitor the sidebands in deceleration hardware
            AddAnalogInputChannel("cavityVoltage", usbBoard + "/ai0", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("mot606", usbBoard + "/ai1", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("mot628V1", usbBoard + "/ai2", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("mot628V2", usbBoard + "/ai3", AITerminalConfiguration.Rse);
            //AddAnalogInputChannel("mot628V3", usbBoard + "/ai4", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("slowing531", usbBoard + "/ai4", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("slowing628V1", usbBoard + "/ai7", AITerminalConfiguration.Rse);

            //analog output channels controlled by the hardware controller and/or MOTMaster
            AddAnalogOutputChannel("motAOMFreq", aoBoard + "/ao10");
            AddAnalogOutputChannel("v00EOMAmp", aoBoard + "/ao11");
            AddAnalogOutputChannel("triggerDelay", aoBoard + "/ao15");

            //   AddCalibration("freqToVoltage", new PolynomialCalibration(new double[] { -9.7727, 0.16604, -0.0000272 }, 70, 130)); //this is a quadratic fit to the manufacturer's data for a POS-150
            //AddCalibration("motAOMAmp", new PolynomialCalibration(new double[] {6.2871, -0.5907, -0.0706, -0.0088, -0.0004}, -12, 4)); // this is a polynomial fit (up to quartic) to measured behaviour
        }
示例#22
0
        public PXIEDMHardware()
        {
            // add the boards
            Boards.Add("rfPulseGenerator", "PXI1Slot4");
            Boards.Add("daq", "/PXI1Slot18");
            Boards.Add("pg", "/PXI1Slot10");
            Boards.Add("counter", "/PXI1Slot16");
            Boards.Add("aoBoard", "/PXI1Slot2");
            // this drives the rf attenuators
            Boards.Add("usbDAQ1", "/Dev6");
            Boards.Add("analogIn", "/PXI1Slot15");
            Boards.Add("usbDAQ2", "/Dev1");
            Boards.Add("usbDAQ3", "/Dev2");
            Boards.Add("usbDAQ4", "/Dev5");
            Boards.Add("tclBoardPump", "/PXI1Slot17");
            Boards.Add("tclBoardProbe", "/PXI1Slot9");
            string rfPulseGenerator = (string)Boards["rfPulseGenerator"];
            string pgBoard          = (string)Boards["pg"];
            string daqBoard         = (string)Boards["daq"];
            string counterBoard     = (string)Boards["counter"];
            string aoBoard          = (string)Boards["aoBoard"];
            string usbDAQ1          = (string)Boards["usbDAQ1"];
            string analogIn         = (string)Boards["analogIn"];
            string usbDAQ2          = (string)Boards["usbDAQ2"];
            string usbDAQ3          = (string)Boards["usbDAQ3"];
            string usbDAQ4          = (string)Boards["usbDAQ4"];
            string tclBoardPump     = (string)Boards["tclBoardPump"];
            string tclBoardProbe    = (string)Boards["tclBoardProbe"];

            // add things to the info
            // the analog triggersf
            Info.Add("analogTrigger0", (string)Boards["analogIn"] + "/PFI0");
            Info.Add("analogTrigger1", (string)Boards["analogIn"] + "/PFI1");

            Info.Add("sourceToDetect", 1.3);
            Info.Add("moleculeMass", 193.0);
            Info.Add("machineLengthRatio", 3.842);
            Info.Add("defaultGate", new double[] { 2190, 80 });


            Info.Add("phaseLockControlMethod", "synth");
            Info.Add("PGClockLine", pgBoard + "/PFI4"); //Mapped to PFI2 on 6533 connector
            Info.Add("PatternGeneratorBoard", pgBoard);
            Info.Add("PGType", "dedicated");
            // rf counter switch control seq``
            Info.Add("IodineFreqMon", new bool[] { false, false });      // IN 1
            Info.Add("pumpAOMFreqMon", new bool[] { false, true });      // IN 2
            Info.Add("FLModulationFreqMon", new bool[] { true, false }); // IN 3

            Info.Add("PGTrigger", pgBoard + "/PFI5");                    //Mapped to PFI7 on 6533 connector

            // YAG laser
            yag = new BrilliantLaser("ASRL21::INSTR");

            // add the GPIB/RS232 instruments
            Instruments.Add("green", new HP8657ASynth("GPIB0::7::INSTR"));
            Instruments.Add("gigatronix", new Gigatronics7100Synth("GPIB0::19::INSTR"));
            Instruments.Add("red", new HP3325BSynth("GPIB0::12::INSTR"));
            Instruments.Add("4861", new ICS4861A("GPIB0::4::INSTR"));
            Instruments.Add("bCurrentMeter", new HP34401A("GPIB0::22::INSTR"));
            Instruments.Add("rfCounter", new Agilent53131A("GPIB0::3::INSTR"));
            //Instruments.Add("rfCounter2", new Agilent53131A("GPIB0::5::INSTR"));
            Instruments.Add("rfPower", new HP438A("GPIB0::13::INSTR"));
            Instruments.Add("BfieldController", new SerialDAQ("ASRL19::INSTR"));
            Instruments.Add("rfCounter2", new SerialAgilent53131A("ASRL17::INSTR"));
            Instruments.Add("probePolControl", new SerialMotorControllerBCD("ASRL8::INSTR"));
            Instruments.Add("pumpPolControl", new SerialMotorControllerBCD("ASRL11::INSTR"));


            // map the digital channels
            // these channels are generally switched by the pattern generator
            // they're all in the lower half of the pg
            AddDigitalOutputChannel("valve", pgBoard, 0, 0);
            AddDigitalOutputChannel("flash", pgBoard, 0, 1);
            AddDigitalOutputChannel("q", pgBoard, 0, 2);
            AddDigitalOutputChannel("detector", pgBoard, 0, 3);
            AddDigitalOutputChannel("detectorprime", pgBoard, 1, 2); // this trigger is for switch scanning
            // see ModulatedAnalogShotGatherer.cs
            // for details.
            AddDigitalOutputChannel("rfSwitch", pgBoard, 0, 4);
            AddDigitalOutputChannel("pumprfSwitch", pgBoard, 3, 4);
            AddDigitalOutputChannel("fmSelect", pgBoard, 1, 0);         // This line selects which fm voltage is
            // sent to the synth.
            AddDigitalOutputChannel("attenuatorSelect", pgBoard, 0, 5); // This line selects the attenuator voltage
            // sent to the voltage-controlled attenuator.
            AddDigitalOutputChannel("piFlip", pgBoard, 1, 1);
            AddDigitalOutputChannel("ttlSwitch", pgBoard, 1, 3);        // This is the output that the pg
            // will switch if it's switch scanning.
            AddDigitalOutputChannel("scramblerEnable", pgBoard, 1, 4);

            //RF Counter Control (single pole 4 throw)
            //AddDigitalOutputChannel("rfCountSwBit1", pgBoard, 3, 5);
            //AddDigitalOutputChannel("rfCountSwBit2", pgBoard, 3, 6);

            // new rf amp blanking
            AddDigitalOutputChannel("rfAmpBlanking", pgBoard, 1, 5);

            // these channel are usually software switched - they should not be in
            // the lower half of the pattern generator
            AddDigitalOutputChannel("b", pgBoard, 2, 0);
            AddDigitalOutputChannel("notB", pgBoard, 2, 1);
            AddDigitalOutputChannel("db", pgBoard, 2, 2);
            AddDigitalOutputChannel("notDB", pgBoard, 2, 3);
            //			AddDigitalOutputChannel("notEOnOff", pgBoard, 2, 4);  // this line seems to be broken on our pg board
            //          AddDigitalOutputChannel("eOnOff", pgBoard, 2, 5);  // this and the above are not used now we have analog E control

            AddDigitalOutputChannel("ePol", pgBoard, 2, 6);
            AddDigitalOutputChannel("notEPol", pgBoard, 2, 7);
            AddDigitalOutputChannel("eBleed", pgBoard, 3, 0);
            AddDigitalOutputChannel("eSwitching", aoBoard, 0, 3);
            AddDigitalOutputChannel("piFlipEnable", pgBoard, 3, 1);
            AddDigitalOutputChannel("notPIFlipEnable", pgBoard, 3, 5);
            AddDigitalOutputChannel("mwEnable", pgBoard, 3, 3);
            AddDigitalOutputChannel("mwSelectPumpChannel", pgBoard, 3, 6);
            AddDigitalOutputChannel("mwSelectTopProbeChannel", pgBoard, 3, 2);
            AddDigitalOutputChannel("mwSelectBottomProbeChannel", pgBoard, 2, 4);

            // these digitial outputs are are not switched during the pattern
            AddDigitalOutputChannel("argonShutter", aoBoard, 0, 0);
            AddDigitalOutputChannel("patternTTL", aoBoard, 0, 7);
            AddDigitalOutputChannel("rfPowerAndFreqSelectSwitch", aoBoard, 0, 1);
            AddDigitalOutputChannel("targetStepper", aoBoard, 0, 2);;


            // map the analog channels
            // These channels are on the daq board. Used mainly for diagnostic purposes.
            AddAnalogInputChannel("iodine", daqBoard + "/ai2", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("cavity", daqBoard + "/ai3", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("probePD", daqBoard + "/ai4", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("pumpPD", daqBoard + "/ai5", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("northLeakage", daqBoard + "/ai6", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("southLeakage", daqBoard + "/ai7", AITerminalConfiguration.Nrse);
            //AddAnalogInputChannel("northLeakage", usbDAQ4 + "/ai0", AITerminalConfiguration.Rse);
            //AddAnalogInputChannel("southLeakage", usbDAQ4 + "/ai1", AITerminalConfiguration.Rse);

            // Used ai13,11 & 12 over 6,7 & 8 for miniFluxgates, because ai8, 9 have an isolated ground.
            AddAnalogInputChannel("miniFlux1", daqBoard + "/ai13", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("miniFlux2", daqBoard + "/ai11", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("miniFlux3", daqBoard + "/ai12", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("ground", daqBoard + "/ai14", AITerminalConfiguration.Nrse);
            AddAnalogInputChannel("piMonitor", daqBoard + "/ai10", AITerminalConfiguration.Nrse);
            //AddAnalogInputChannel("diodeLaserRefCavity", daqBoard + "/ai13", AITerminalConfiguration.Nrse);
            // Don't use ai10, cross talk with other channels on this line

            // high quality analog inputs (will be) on the S-series analog in board
            // The last number in AddAnalogInputChannel is an optional calibration which turns VuS and MHz
            AddAnalogInputChannel("topProbe", analogIn + "/ai0", AITerminalConfiguration.Differential, 0.1);
            AddAnalogInputChannel("bottomProbe", analogIn + "/ai1", AITerminalConfiguration.Differential, 0.02);
            AddAnalogInputChannel("magnetometer", analogIn + "/ai2", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("gnd", analogIn + "/ai3", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("battery", analogIn + "/ai4", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("piMonitor", analogIn + "/ai5", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("bFieldCurrentMonitor", analogIn + "/ai6", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("reflectedrf1Amplitude", analogIn + "/ai5", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("reflectedrf2Amplitude", analogIn + "/ai6", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("rfCurrent", analogIn + "/ai7 ", AITerminalConfiguration.Differential);

            AddAnalogOutputChannel("phaseScramblerVoltage", aoBoard + "/ao10");
            AddAnalogOutputChannel("b", aoBoard + "/ao2");


            // rf rack control
            //AddAnalogInputChannel("rfPower", usbDAQ1 + "/ai0", AITerminalConfiguration.Rse);

            AddAnalogOutputChannel("rf1Attenuator", usbDAQ1 + "/ao0", 0, 5);
            AddAnalogOutputChannel("rf2Attenuator", usbDAQ1 + "/ao1", 0, 5);
            AddAnalogOutputChannel("rf1FM", usbDAQ2 + "/ao0", 0, 5);
            AddAnalogOutputChannel("rf2FM", usbDAQ2 + "/ao1", 0, 5);

            // E field control and monitoring
            //AddAnalogInputChannel("cPlusMonitor", usbDAQ3 + "/ai1", AITerminalConfiguration.Differential);
            //AddAnalogInputChannel("cMinusMonitor", usbDAQ3 + "/ai2", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("cPlusMonitor", daqBoard + "/ai0", AITerminalConfiguration.Differential);
            AddAnalogInputChannel("cMinusMonitor", daqBoard + "/ai1", AITerminalConfiguration.Differential);

            AddAnalogOutputChannel("cPlus", usbDAQ3 + "/ao0", 0, 10);
            AddAnalogOutputChannel("cMinus", usbDAQ3 + "/ao1", 0, 10);



            // B field control
            //AddAnalogOutputChannel("steppingBBias", usbDAQ4 + "/ao0", 0, 5);


            // map the counter channels
            AddCounterChannel("phaseLockOscillator", counterBoard + "/ctr7");
            AddCounterChannel("phaseLockReference", counterBoard + "/pfi10");
            //AddCounterChannel("northLeakage", counterBoard + "/ctr0");
            //AddCounterChannel("southLeakage", counterBoard + "/ctr1");


            // Cavity inputs for the cavity that controls the Pump lasers
            AddAnalogInputChannel("PumpCavityRampVoltage", tclBoardPump + "/ai8", AITerminalConfiguration.Rse); //tick
            AddAnalogInputChannel("Pumpmaster", tclBoardPump + "/ai1", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("Pumpp1", tclBoardPump + "/ai2", AITerminalConfiguration.Rse);
            AddAnalogInputChannel("Pumpp2", tclBoardPump + "/ai3", AITerminalConfiguration.Rse);

            // Lasers locked to pump cavity
            AddAnalogOutputChannel("KeopsysDiodeLaser", tclBoardPump + "/ao2", -4, 4); //tick
            AddAnalogOutputChannel("MenloPZT", tclBoardPump + "/ao0", 0, 10);          //tick

            // Length stabilisation for pump cavity
            AddAnalogOutputChannel("PumpCavityLengthVoltage", tclBoardPump + "/ao1", -10, 10); //tick

            //TCL configuration for pump cavity
            TCLConfig tcl1 = new TCLConfig("Pump Cavity");

            tcl1.AddLaser("MenloPZT", "Pumpp1");
            tcl1.AddLaser("KeopsysDiodeLaser", "Pumpp2");
            tcl1.Trigger           = tclBoardPump + "/PFI0";
            tcl1.Cavity            = "PumpCavityRampVoltage";
            tcl1.MasterLaser       = "Pumpmaster";
            tcl1.Ramp              = "PumpCavityLengthVoltage";
            tcl1.TCPChannel        = 1190;
            tcl1.AnalogSampleRate  = 61250;
            tcl1.DefaultScanPoints = 500;
            tcl1.MaximumNLMFSteps  = 20;
            tcl1.PointsToConsiderEitherSideOfPeakInFWHMs = 2.5;
            tcl1.TriggerOnRisingEdge = false;
            tcl1.AddFSRCalibration("MenloPZT", 3.84);
            tcl1.AddFSRCalibration("KeopsysDiodeLaser", 3.84);
            tcl1.AddDefaultGain("Master", 0.3);
            tcl1.AddDefaultGain("MenloPZT", -0.2);
            tcl1.AddDefaultGain("KeopsysDiodeLaser", 4);
            Info.Add("PumpCavity", tcl1);
            Info.Add("DefaultCavity", tcl1);

            // Probe cavity inputs
            AddAnalogInputChannel("ProbeRampVoltage", tclBoardProbe + "/ai0", AITerminalConfiguration.Rse); //tick
            AddAnalogInputChannel("Probemaster", tclBoardProbe + "/ai1", AITerminalConfiguration.Rse);      //tick
            AddAnalogInputChannel("Probep1", tclBoardProbe + "/ai2", AITerminalConfiguration.Rse);          //tick

            // Lasers locked to Probe cavity
            AddAnalogOutputChannel("TopticaSHGPZT", tclBoardProbe + "/ao0", -4, 4);              //tick
            AddAnalogOutputChannel("ProbeCavityLengthVoltage", tclBoardProbe + "/ao1", -10, 10); //tick

            // TCL configuration for Probe cavity
            TCLConfig tcl2 = new TCLConfig("Probe Cavity");

            tcl2.AddLaser("TopticaSHGPZT", "Probep1");
            tcl2.Trigger           = tclBoardProbe + "/PFI0";
            tcl2.Cavity            = "ProbeRampVoltage";
            tcl2.MasterLaser       = "Probemaster";
            tcl2.Ramp              = "ProbeCavityLengthVoltage";
            tcl2.TCPChannel        = 1191;
            tcl2.AnalogSampleRate  = 61250 / 2;
            tcl2.DefaultScanPoints = 250;
            tcl2.MaximumNLMFSteps  = 20;
            tcl2.PointsToConsiderEitherSideOfPeakInFWHMs = 12;
            tcl2.AddFSRCalibration("TopticaSHGPZT", 3.84);
            tcl2.TriggerOnRisingEdge = false;
            tcl2.AddDefaultGain("Master", 0.4);
            tcl2.AddDefaultGain("TopticaSHGPZT", 0.04);
            Info.Add("ProbeCavity", tcl2);
            //Info.Add("DefaultCavity", tcl2);


            // Obsolete Laser control
            AddAnalogOutputChannel("probeAOM", aoBoard + "/ao19", 0, 10);
            AddAnalogOutputChannel("pumpAOM", aoBoard + "/ao20", 0, 10);
            AddAnalogOutputChannel("fibreAmpPwr", aoBoard + "/ao3");
            AddAnalogOutputChannel("I2LockBias", aoBoard + "/ao5", 0, 5);

            //Microwave Control Channels
            AddAnalogOutputChannel("uWaveDCFM", aoBoard + "/ao11", -2.5, 2.5);
            //AddAnalogOutputChannel("uWaveMixerV", aoBoard + "/ao12", 0, 10);
            AddAnalogOutputChannel("pumpMixerV", aoBoard + "/ao19", 0, 5);
            AddAnalogOutputChannel("bottomProbeMixerV", aoBoard + "/ao24", 0, 5);
            AddAnalogOutputChannel("topProbeMixerV", aoBoard + "/ao25", 0, 5);



            //RF control Channels
            AddAnalogOutputChannel("VCO161Amp", aoBoard + "/ao13", 0, 10);
            AddAnalogOutputChannel("VCO161Freq", aoBoard + "/ao14", 0, 10);
            AddAnalogOutputChannel("VCO30Amp", aoBoard + "/ao15", 0, 10);
            AddAnalogOutputChannel("VCO30Freq", aoBoard + "/ao16", 0, 10);
            AddAnalogOutputChannel("VCO155Amp", aoBoard + "/ao17", 0, 10);
            AddAnalogOutputChannel("VCO155Freq", aoBoard + "/ao18", 0, 10);
        }