I have a DigitalMultiChannelReader that I need to start reading a waveform when an external line changes. For example, I want to read Port3 lines 3 and 4 when PFI5 goes high, for a certain number of samples.
readWaveformTask = new NationalInstruments.DAQmx.Task(); readWaveformTask.DIChannels.CreateChannel("PXI1Slot6/Port3/Line3, PXI1Slot6/Port3/Line4", "", ChannelLineGrouping.OneChannelForEachLine); readWaveformTask.Timing.ConfigureSampleClock( "", samplesPerSecond, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, samplesToCollect); readWaveformTask.Stream.Timeout = 1000; readWaveformTask.Triggers.StartTrigger.ConfigureDigitalEdgeTrigger("PXI1Slot6/PFI5", DigitalEdgeStartTriggerEdge.Rising); DigitalMultiChannelReader reader = new DigitalMultiChannelReader(readWaveformTask.Stream); //TODO: How do I make the reader not start the task here? reader.ReadWaveform(samplesToCollect);
The code above will start the task and start reading the waveform as soon as "reader.ReadWaveform(samplesToCollect)" is called.
How can I trigger a waveform aquisition using an external trigger?