Quantcast
Channel: Digital I/O topics
Viewing all articles
Browse latest Browse all 2167

Digital output line remains high after digital waveform output

$
0
0

Hello,

 

I am using a NI USB-6229 device and working on outputting an arbitrary sequence of low's (0V) and high's (5V) on one of the digital output lines.The problem I am experiencing is after the digital waveform is output, the line the waveform was output on remains in the high state. This happens regardless of whether the last sample in the digital waveform is a 1 or a 0. My digital waveform output task is configured as shown below.

_digitalWaveformTask = new Task("DigitalOutputTask");            
_digitalWaveformTask.DOChannels.CreateChannel("Dev4/port0/line0", "do0", ChannelLineGrouping.OneChannelForEachLine); _digitalWaveformTask.Timing.ConfigureSampleClock("/Dev4/ao/SampleClock", 5000, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, 1000); _digitalWaveformTask.Done += delegate { _digitalWaveformTask.Stop(); _digitalWaveformTask.Control(TaskAction.Unreserve); }; _digitalWaveformTask.Control(TaskAction.Verify);
_digitalWaveformSingleChannelWriter = new DigitalSingleChannelWriter(_digitalWaveformTask.Stream); _digitalWaveformSingleChannelWriter.WriteMultiSamplePort(false, GenerateDigitalWaveformData());

The GenerateDigitalWaveformData method generates a digital waveform of arbitrary length that alternates between high & low states. Before returning an int[] it makes sure that the last sample in the array has a value of 0, I thought that this would force the line back to a low state but it doesn't.

 

Edit: The digital waveform is getting output correctly from what I can tell, the line it is getting output on is simply not returning to a low state afterwards.

 

What am I doing wrong?


Viewing all articles
Browse latest Browse all 2167

Trending Articles