private bool InitializeNrpNonBurstedMode(string ResourceName) { try { m_sensor = new rsnrpz(ResourceName, m_nrpNonBurstedSettings.IDChecked, m_nrpNonBurstedSettings.ResetDevice); // Deactivates automatic determination of filter bandwidth m_sensor.avg_setAutoEnabled(m_Channel, m_nrpNonBurstedSettings.AutoEnabled); // Number of averages m_sensor.avg_setCount(m_Channel, m_nrpNonBurstedSettings.averageCount); // Set corr frequency m_sensor.chan_setCorrectionFrequency(m_Channel, m_nrpNonBurstedSettings.correctionFrequency * 1000000.0); // Set trigger source to immediate m_sensor.trigger_setSource(m_Channel, m_nrpNonBurstedSettings.TriggerSourceImmediate); m_sensor.chan_setContAvAperture(m_Channel, m_nrpNonBurstedSettings.integrationTime / 1000.0); // Averaging Manual 1, increase number for better repeatability m_sensor.avg_configureAvgManual(m_Channel, m_nrpNonBurstedSettings.averageCount); // Smoothing off m_sensor.chan_setContAvSmoothingEnabled(m_Channel, false); m_sensor.errorCheckState(m_nrpNonBurstedSettings.CheckState); m_initialize = true; } catch (Exception err) { throw (new SystemException("Error initialize Nrp Power meter" + err.Message)); } return(true); }
bool InitializeNrpBurstedMode(string ResourceName) { try { if (m_sensor == null) { m_sensor = new rsnrpz(ResourceName, m_nrpBurstedSettings.IDChecked, m_nrpBurstedSettings.ResetDevice); double triggerLevel_W; //sensor = new rsnrpz(ResourceDescriptor.Text, IDQuery.Checked, ResetDevice.Checked); // Timeslot: The power is measured simultaneously in a number of timeslots m_sensor.chan_mode(m_Channel, rsnrpzConstants.SensorModeTimeslot); // Set corr frequency m_sensor.chan_setCorrectionFrequency(m_Channel, m_nrpBurstedSettings.correctionFrequency * 1000000.0); // Set trigger source to internal m_sensor.trigger_setSource(m_Channel, rsnrpzConstants.TriggerSourceImmediate); m_sensor.tslot_configureTimeSlot(m_Channel, 1, m_nrpBurstedSettings.timeslotWidth / 1000000.0); m_sensor.timing_configureExclude(m_Channel, m_nrpBurstedSettings.excludeStart / 1000000.0, m_nrpBurstedSettings.excludeStop / 1000000.0); // Set trigger level triggerLevel_W = Math.Pow(10, (m_nrpBurstedSettings.triggerLevel) / 10.0) / 1000.0; m_sensor.trigger_setLevel(m_Channel, triggerLevel_W); // Averaging Manual 1, increase number for better repeatability m_sensor.avg_configureAvgManual(m_Channel, m_nrpBurstedSettings.averageCount); m_sensor.errorCheckState(m_nrpBurstedSettings.errorCheckState); m_initialize = true; } else { throw (new SystemException("Sensor already initialized")); } } catch (Exception err) { throw (new SystemException(err.Message)); } return(true); }