public override void TryInitialize() { try { _daqTask.AIChannels.CreateVoltageChannel(PhysicalChannelName, nameToAssignChannel: PhysicalChannelName, ReaderSpecs.TerminalConfig, ReaderSpecs.Range.MinimumValue, ReaderSpecs.Range.MaximumValue, units); _daqTask.Timing.ConfigureSampleClock("", ReaderSpecs.TimingConfig.SampleRate, ReaderSpecs.TimingConfig.ActiveEdge, SampleQuantityMode.FiniteSamples, ReaderSpecs.TimingConfig.SampleSize); DaqStream stream = _daqTask.Stream ?? throw new DaqException(Constants.ErrorMessages.INVALID_STREAM); _reader = new AnalogSingleChannelReader(stream); this.IsInitialized = true; } catch (DaqException ex) { // Log Exception Stop(ex); } }
public override void TryInitialize() { try { _daqTask.AOChannels.CreateVoltageChannel(PhysicalChannelName, nameToAssignChannel: PhysicalChannelName, minimumValue, maximumValue, units); DaqStream stream = _daqTask.Stream ?? throw new DaqException(Constants.ErrorMessages.INVALID_STREAM); _writer = new AnalogSingleChannelWriter(stream); this.IsInitialized = true; } catch (DaqException ex) { Stop(ex); } }
public override void TryInitialize() { try { if (string.IsNullOrWhiteSpace(PhysicalChannelName)) { throw new ArgumentException(Constants.ErrorMessages.INVALID_CHANNEL, nameof(PhysicalChannelName)); } _daqTask.DOChannels.CreateChannel(PhysicalChannelName, nameToAssign: PhysicalChannelName, ChannelLineGrouping.OneChannelForEachLine); DaqStream stream = _daqTask.Stream ?? throw new DaqException(Constants.ErrorMessages.INVALID_STREAM); _writer = new DigitalSingleChannelWriter(stream); this.IsInitialized = true; } catch (DaqException ex) { Stop(ex); } }