示例#1
0
        public Form1()
        {
            InitializeComponent();

            tempSafety = new TemperatureWatch(Properties.Settings.Default.MaxTemperature);

            pidCurrent.relay = relayCurrent;

            pidCurrent.psuInterface = psuCP400;

            relayCurrent.USBRelayControl_Load();

            GPIBPSUDriverInstrumentSettings setts = new GPIBPSUDriverInstrumentSettings("GPIB0::11::INSTR");

            setts.outputEnabledChan1 = false;
            setts.outputEnabledChan2 = false;
            CPX400SPPSUDriver drv_cpx = new CPX400SPPSUDriver(setts);

            drv_cpx.SaveSettingsHandler += Instek_SaveSettingsHandler;
            psuCP400.initializeInstrument(drv_cpx, "CP400SP PSU");


            pidCurrent.psuInterface = psuCP400;
            pidCurrent.setTitle("Peltier controller");
            pidCurrent.setDefaultPSUPort(Properties.Settings.Default.PIDPeltierPSUPort);
            pidCurrent.setDefaultReadingPort(Properties.Settings.Default.PIDPeltierReadingsPort);
            pidCurrent.setMaxVoltage(Properties.Settings.Default.PIDPeltierMaxVoltage);
            pidCurrent.setMaxCurrent(Properties.Settings.Default.PIDPeltierMaxCurrent);
            pidCurrent.relay = relayCurrent;


            tempRampCtrl.pid_Tset    = pidCurrent;
            temperatureProf.pid_Tset = pidCurrent;

            ke2700.ReadingsUpdate += pidCurrent.readingsUpdate;
            ke2700.ReadingsUpdate += grphTemp.readingsUpdate;

            ke2700.ReadingsUpdate += tempSafety.readingsUpdate;

            ke2700.KeithleySourceNamesChanged += grphTemp.dataNamesUpdate;

            temperatureProf.TemperatureSetPointChanged += ke2700.setTemperatureUpdated;


            /*dataFilter.FilterReadingsUpdate += grphHallprobes.readingsUpdate;
             * dataFilter.FilterReadingsUpdate += grphPeltier.readingsUpdate;
             * dataFilter.FilterReadingsUpdate += peltStab.readingsUpdate;
             * dataFilter.FilterReadingsUpdate += magDrive.readingsUpdate;
             * dataFilter.FilterReadingsUpdate += expFlow.readingsUpdate;
             *
             * dataFilter.FilterNamesChanged += grphHallprobes.dataNamesUpdate;
             * dataFilter.FilterNamesChanged += grphPeltier.dataNamesUpdate;
             * dataFilter.FilterNamesChanged += peltStab.dataNamesUpdate;
             * dataFilter.FilterNamesChanged += magDrive.dataNamesUpdate;
             * dataFilter.FilterNamesChanged += expFlow.dataNamesUpdate;
             */
            grphTemp.setPlotName("Temperature");

            outputFile.OutputFilenameChanged += ke2700.userfilenameChanged;
            outputFile.OutputFilenameChanged += temperatureProf.userfilenameChanged;
            outputFile.loadSettings();

            //tempSafety.SafetyCloseInstrument += psuCP400.safetyCloseInstrument;
        }
示例#2
0
        public IRInterface()
        {
            InitializeComponent();



            tempSafety = new TemperatureWatch(Properties.Settings.Default.MaxTemperature);

            pidCurrent.relay = relayCurrent;

            pidCurrent.psuInterface = psuInstek;

            relayCurrent.USBRelayControl_Load();

            GPIBPSUDriverInstrumentSettings psuCPXSetts = new GPIBPSUDriverInstrumentSettings("COM4");

            psuCPXSetts.outputEnabledChan1 = false;
            psuCPXSetts.outputEnabledChan2 = false;
            CPX400SPPSUDriverSerial drv_instek = new CPX400SPPSUDriverSerial(psuCPXSetts);

            drv_instek.SaveSettingsHandler += Instek_SaveSettingsHandler;
            psuInstek.initializeInstrument(drv_instek, "CPX400SP PSU");

            /*
             *
             * IsoTech3303PSUDriverInstrumentSettings isotech_setts =
             * new IsoTech3303PSUDriverInstrumentSettings(Properties.IsoTechPSUSettings.Default.IsoTechPSUComPort,
             *                                       Properties.IsoTechPSUSettings.Default.IsoTechPSUBaudRate,
             *                                       Properties.IsoTechPSUSettings.Default.IsoTechPSUParity,
             *                                       Properties.IsoTechPSUSettings.Default.IsoTechPSUDataBits,
             *                                       Properties.IsoTechPSUSettings.Default.IsoTechPSUStopBits);
             *
             * isotech_setts.outputEnabledChan1 = Properties.IsoTechPSUSettings.Default.Chan1Enabled;
             * isotech_setts.setCurrentChan1 = Properties.IsoTechPSUSettings.Default.Chan1Current;
             * isotech_setts.setVoltageChan1 = Properties.IsoTechPSUSettings.Default.Chan1Voltage;
             *
             * isotech_setts.outputEnabledChan2 = Properties.IsoTechPSUSettings.Default.Chan2Enabled;
             * isotech_setts.setCurrentChan2 = Properties.IsoTechPSUSettings.Default.Chan2Current;
             * isotech_setts.setVoltageChan2 = Properties.IsoTechPSUSettings.Default.Chan2Voltage;
             *
             * IsoTech3303PSUDriver drv_iso = new IsoTech3303PSUDriver(isotech_setts);
             * drv_iso.SaveSettingsHandler += IsoTech_SaveSettingsHandler;
             * psuIsotech.initializeInstrument(drv_iso, "IsoTech PSU");*/



            pidCurrent.psuInterface = psuInstek;
            pidCurrent.setTitle("Peltier controller");
            pidCurrent.setDefaultPSUPort(Properties.Settings.Default.PIDPeltierPSUPort);
            pidCurrent.setDefaultReadingPort(Properties.Settings.Default.PIDPeltierReadingsPort);
            pidCurrent.setMaxVoltage(Properties.Settings.Default.PIDPeltierMaxVoltage);
            pidCurrent.setMaxCurrent(Properties.Settings.Default.PIDPeltierMaxCurrent);
            pidCurrent.relay = relayCurrent;


            tempRampCtrl.pid_Tset = pidCurrent;

            ke2700.ReadingsUpdate += pidCurrent.readingsUpdate;
            ke2700.ReadingsUpdate += grphTemp.readingsUpdate;
            //ke2700.ReadingsUpdate += grphHallprobes.readingsUpdate;
            //ke2700.ReadingsUpdate += grphPeltier.readingsUpdate;
            ke2700.ReadingsUpdate += tempSafety.readingsUpdate;
            //ke2700.ReadingsUpdate += peltStab.readingsUpdate;
            ke2700.ReadingsUpdate += dataFilter.readingsUpdate;
            ke2700.ReadingsUpdate += magDrive.readingsUpdate;

            ke2700.KeithleySourceNamesChanged += grphTemp.dataNamesUpdate;
            //ke2700.KeithleySourceNamesChanged += grphHallprobes.dataNamesUpdate;
            //ke2700.KeithleySourceNamesChanged += grphPeltier.dataNamesUpdate;
            //ke2700.KeithleySourceNamesChanged += peltStab.dataNamesUpdate;
            ke2700.KeithleySourceNamesChanged += dataFilter.dataNamesUpdate;

            dataFilter.FilterReadingsUpdate += grphHallprobes.readingsUpdate;
            dataFilter.FilterReadingsUpdate += grphPeltier.readingsUpdate;
            dataFilter.FilterReadingsUpdate += peltStab.readingsUpdate;
            dataFilter.FilterReadingsUpdate += magDrive.readingsUpdate;
            dataFilter.FilterReadingsUpdate += expFlow.readingsUpdate;
            dataFilter.FilterReadingsUpdate += DataFilter_FilterReadingsUpdate;

            string[] header = new string[1];
            header[0] = "%dummy";

            string file = "processed";

            dataSaver = new Keithley2700DataSaver(file, header, DateTime.Now);

            dataFilter.FilterNamesChanged += grphHallprobes.dataNamesUpdate;
            dataFilter.FilterNamesChanged += grphPeltier.dataNamesUpdate;
            dataFilter.FilterNamesChanged += peltStab.dataNamesUpdate;
            dataFilter.FilterNamesChanged += magDrive.dataNamesUpdate;
            dataFilter.FilterNamesChanged += expFlow.dataNamesUpdate;


            grphHallprobes.setPlotName("Hall probe graph");
            grphPeltier.setPlotName("Peltier difference");
            grphTemp.setPlotName("Temperature");

            outfile.OutputFilenameChanged += ke2700.userfilenameChanged;
            outfile.OutputFilenameChanged += Outfile_OutputFilenameChanged;
            outfile.loadSettings();

            tempSafety.SafetyCloseInstrument += psuInstek.safetyCloseInstrument;

            expFlow.rampCtrl  = tempRampCtrl;
            expFlow.stabCtrl  = peltStab;
            expFlow.fieldCtrl = magDrive;
            expFlow.pidCtrl   = pidCurrent;
            expFlow.pathCtrl  = outfile;
        }