/** * Add a DSC experiment to the experiment list * */ private void cmdAddDSCExperiment_Click(object sender, EventArgs e) { //setup the settings first EFMExperimentSettingsDSC setts = new EFMExperimentSettingsDSC((double)nudTminDSC.Value, (double)nudTmaxDSC.Value, (double)nudTrate.Value, (double)nudAppliedField.Value, (double)nudStabilization.Value); EFMExperimentDSC exp = new EFMExperimentDSC(setts, stabCtrl, rampCtrl, fieldCtrl, pidCtrl, pathCtrl, this, header); control.addExperiment(exp); }
private void makeDSCSequence(EFMExperimentSettingsDSC setts) { /*The procedure for a DSC run, i.e. getting the specific heat as a function of temperature for a given constant field is as follows * 1. Set the desired magnetic field * 2. Got to the starting temperature * 3. Wait for half a minute to make sure the stabilization criterion is not met (if the system has been completely stable it takes a few data cycles to realize a change is happening) * 4. Wait for stabilization * 5. Open separate data file * 6. Start the temperature ramp * 7. Finish experiment (close data file) * */ //1. Set the required field SetFieldTask setField = new SetFieldTask(); setField.field = setts.H; setField.rampRate = 0.1;//T/s setField.fieldCtrl = fieldCtrl; taskList.Add(setField); //2. set the starting temperature double Tmin = setts.Tmin; double Tmax = setts.Tmax; double Tstart = Tmin; if (setts.Tramp < 0) { Tstart = setts.Tmax; } SetTemperatureTask setT = new SetTemperatureTask(); setT.Tset = Tstart; setT.tempCtrl = pidCtrl; taskList.Add(setT); //3. Wait for a little time WaitTimeTask wt = new WaitTimeTask(); wt.waitTime = 10;//seconds taskList.Add(wt); //4. wait for stabilization WaitStabilizeTask wtS = new WaitStabilizeTask(); wtS.criterion = setts.stabilizeCriterium; wtS.stabCtrl = stabCtrl; taskList.Add(wtS); //5. open separate data file SeparateDatafileTask opTask = new SeparateDatafileTask(); opTask.filename = "dsc_Tstart_" + Tmin.ToString() + "_Tend_" + Tmax.ToString() + "_Tramp_" + setts.Tramp.ToString() + "_Happ_" + setts.H.ToString(); experimentReadingsUpdate += opTask.readingsUpdate; opTask.filePath = datasaveCtrl; opTask.header = header; taskList.Add(opTask); //6. start the ramp SetTemperatureRampTask tRamp = new SetTemperatureRampTask(); tRamp.Tmin = Tmin; tRamp.Tmax = Tmax; tRamp.Tramp = setts.Tramp; tRamp.tempRampCtrl = rampCtrl; taskList.Add(tRamp); //7. finish the experiment, i.e. close the file ExperimentFinishedTask expF = new ExperimentFinishedTask(); taskList.Add(expF); //set the descriptor text of this experiment experimentDescriptor = "DSC_Tmin_" + Tmin.ToString() + "_Tmax_" + Tmax.ToString() + "_Tramp_" + setts.Tramp.ToString() + "_H_" + setts.H.ToString(); }
public EFMExperimentDSC(EFMExperimentSettingsDSC setts, StabilityCtrl sCtrl, SetTemperatureRampCtrl rCtrl, SetFieldControl fCtrl, PIDControl_Tset pCtrl, DatasaveFilePath datCtrl, ExperimentStatusUpdate stCtrl, string[] header_) : base(sCtrl, rCtrl, fCtrl, pCtrl, datCtrl, stCtrl, header_) { taskList = new List <ExperimentTask>(); makeDSCSequence(setts); }