public override void AcquisitionStarting() { //connect to the hardware controller hardwareControl = new DecelerationHardwareControl.Controller(); // initialise the output hardware, full scale -10 to 10 volts outputTask = new Task("analog output"); if (!Environs.Debug) { AnalogOutputChannel oc = (AnalogOutputChannel)Environs.Hardware.AnalogOutputChannels[(string)settings["channel"]]; oc.AddToTask(outputTask, -10, 10); writer = new AnalogSingleChannelWriter(outputTask.Stream); if (!Blocked()) { writer.WriteSingleSample(true, 0); } } scanParameter = 0; //go gently to the correct start position if (((string)settings["scanMode"] == "up" || (string)settings["scanMode"] == "updown") && !Blocked()) { rampOutputToVoltage((double)settings["start"]); } if (((string)settings["scanMode"] == "down" || (string)settings["scanMode"] == "downup") && !Blocked()) { rampOutputToVoltage((double)settings["end"]); } }
public override void AcquisitionStarting() { // initialise the output hardware outputTask = new Task("analog output"); if (!Environs.Debug) { AnalogOutputChannel oc = (AnalogOutputChannel)Environs.Hardware.AnalogOutputChannels[(string)settings["channel"]]; oc.AddToTask(outputTask, oc.RangeLow, oc.RangeHigh); writer = new AnalogSingleChannelWriter(outputTask.Stream); writer.WriteSingleSample(true, 0); } scanParameter = 0; //go gently to the correct start position if ((string)settings["scanMode"] == "up" || (string)settings["scanMode"] == "updown") { if ((string)settings["flyback"] == "overshoot") { rampOutputToVoltage((double)settings["overshootVoltage"]); } rampOutputToVoltage((double)settings["start"]); } if ((string)settings["scanMode"] == "down" || (string)settings["scanMode"] == "downup") { if ((string)settings["flyback"] == "overshoot") { rampOutputToVoltage((double)settings["overshootVoltage"]); } rampOutputToVoltage((double)settings["end"]); } }
public void setupMasterVoltageOut() { masterOutputTask = new Task("rampfeedback"); masterChannel = (AnalogOutputChannel)Environs.Hardware.AnalogOutputChannels["rampfb"]; masterChannel.AddToTask(masterOutputTask, masterChannel.RangeLow, masterChannel.RangeHigh); masterOutputTask.Control(TaskAction.Verify); masterWriter = new AnalogSingleChannelWriter(masterOutputTask.Stream); }
public void ConfigureCavityScan(int numberOfSteps, bool autostart) { outputCavityTask = new Task("CavityPiezoVoltage"); cavityChannel = (AnalogOutputChannel)Environs.Hardware.AnalogOutputChannels[cavityChannelName]; cavityChannel.AddToTask(outputCavityTask, 0, 10); outputCavityTask.Control(TaskAction.Verify); cavityWriter = new AnalogSingleChannelWriter(outputCavityTask.Stream); }
private void configureAnalogOutput() { analogOutputTask = new Task("phase lock analog output"); AnalogOutputChannel outputChannel = (AnalogOutputChannel)Environs.Hardware.AnalogOutputChannels["phaseLockAnalogOutput"]; outputChannel.AddToTask(analogOutputTask, VCO_LOW, VCO_HIGH); analogWriter = new AnalogSingleChannelWriter(analogOutputTask.Stream); analogWriter.WriteSingleSample(true, VCO_CENTRAL); // start out with the central value }
//This takes in a voltage. A bit cheezy, but I needed the laser // voltage to be set as soon value as soon as it gets configured. public void ConfigureSetLaserVoltage(double voltage) { outputLaserTask = new Task("FeedbackToLaser"); laserChannel = (AnalogOutputChannel)Environs.Hardware.AnalogOutputChannels[laserChannelName]; laserChannel.AddToTask(outputLaserTask, -10, 10); outputLaserTask.Control(TaskAction.Verify); laserWriter = new AnalogSingleChannelWriter(outputLaserTask.Stream); laserWriter.WriteSingleSample(true, voltage); outputLaserTask.Start(); }
private void CreateAnalogOutputTask(string channel) { analogTasks[channel] = new Task(channel); AnalogOutputChannel c = ((AnalogOutputChannel)Environs.Hardware.AnalogOutputChannels[channel]); c.AddToTask( analogTasks[channel], c.RangeLow, c.RangeHigh ); analogTasks[channel].Control(TaskAction.Verify); }
/// <summary> /// Method to create a analog output task /// </summary> /// <param name="channel">Channel name as defined in Hardware class</param> /// <returns>The output task</returns> private Task CreateAnalogOutputTask(string channel) { Task task = new Task(channel); AnalogOutputChannel c = ((AnalogOutputChannel)Environs.Hardware.AnalogOutputChannels[channel]); c.AddToTask( task, c.RangeLow, c.RangeHigh ); task.Control(TaskAction.Verify); return(task); }
public void Start() { proportionalGain = 0; integralGain = 0; // derivativeGain = 0; ui = new MainForm(); ui.controller = this; // get access to ScanMaster and the DecelerationHardwareController RemotingHelper.ConnectScanMaster(); RemotingHelper.ConnectMoleculeMOTHardwareControl(); scanMaster = new ScanMaster.Controller(); hardwareControl = new MoleculeMOTHardwareControl.Controller(); fitter = new DAQ.Analyze.GaussianFitter(); if (!Environs.Debug) { outputTask = new Task("LaserControllerOutput"); laserChannel = (AnalogOutputChannel)Environs.Hardware.AnalogOutputChannels["laser"]; laserChannel.AddToTask(outputTask, -10, 10); outputTask.Control(TaskAction.Verify); laserWriter = new AnalogSingleChannelWriter(outputTask.Stream); inputTask = new Task("LaserControllerInput"); cavityChannel = (AnalogInputChannel)Environs.Hardware.AnalogInputChannels["lockcavity"]; cavityChannel.AddToTask(inputTask, -10, 10); cavityReader = new AnalogSingleChannelReader(inputTask.Stream); inputrefTask = new Task("ReferenceLaserControllerInput"); cavityrefChannel = (AnalogInputChannel)Environs.Hardware.AnalogInputChannels["refcavity"]; cavityrefChannel.AddToTask(inputrefTask, -10, 10); cavityrefReader = new AnalogSingleChannelReader(inputrefTask.Stream); } timerDelegate = new TimerCallback(TalkToHardwareControl); hardwareControlTimer = new System.Threading.Timer(timerDelegate, null, 5000, HARDWARE_CONTROL_TALK_PERIOD); Application.Run(ui); }
public void ConfigureCavityScan(int numberOfSteps, bool autostart) { outputCavityTask = new Task("CavityPiezoVoltage"); cavityChannel = (AnalogOutputChannel)Environs.Hardware.AnalogOutputChannels[cavityChannelName]; cavityChannel.AddToTask(outputCavityTask, 0, 10); outputCavityTask.AOChannels[0].DataTransferMechanism = AODataTransferMechanism.Dma; if (!autostart) { outputCavityTask.Timing.ConfigureSampleClock("", 500, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, 2 * numberOfSteps); outputCavityTask.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger( (string)Environs.Hardware.GetInfo(cavityTriggerInputName), DigitalEdgeStartTriggerEdge.Rising); } outputCavityTask.Control(TaskAction.Verify); cavityWriter = new AnalogSingleChannelWriter(outputCavityTask.Stream); }
public void AddAnalogOutput(Task task, AnalogOutputChannel channel, string channelName, double lowLimit, double highLimit) { channel.AddToTask(task, lowLimit, highLimit); task.Control(TaskAction.Verify); analogTasks.Add(channelName, task); }
private void AddToAnalogOutputTask(Task task, string channel) { AnalogOutputChannel c = ((AnalogOutputChannel)Environs.Hardware.AnalogOutputChannels[channel]); c.AddToTask(task, c.RangeLow, c.RangeHigh); }