07-31-2009 10:00 AM
All I want to do is write a half-second pulse on a single digital line of a PCI-6515 board. I figure I should be able to use DigitalMultiChannelWriter.WriteWaveform with the waveform being a simple pair of 0 and 1 values. Going through NI Measurement Studio help I see I'm going to need to use DigitalWaveform which then leads to a whole bunch of other things. Before I spend a full day playing around with this, does anyone have any example code of a very simple application such as mine?
Tim
08-03-2009 02:55 PM
Hello Tim,
When you install DAQmx after Measurement Studio, you should have a number of examples installed with it. By default, this is located C:\Documents and Settings\All Users\Documents\National Instruments\MStudioVS2008\DotNET\Examples. You can then open up NI-DAQ and look for Digital I/O. This will most likely be in this folder: C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DotNETx.x\Digital\Generate Values\WriteDigChan where the "x.x" will be whatever version of .NET you have installed. Hope this helps!
08-03-2009 03:28 PM
Cole,
Actually, no it doesn't help. That example doesn't involve the WriteWaveform function at all. In fact, I can't find any examples in the folder that do.
Tim
08-04-2009 02:36 PM
Hello Tim,
You actually won't have to write a waveform. You can just use the function writer.WriteSingleSampleMultiLine() to set your line to high and then 1 half second later, write it back to zero. If you require this to happen multiple times you can loop it. If you need a very exact half second (within µs), then you should just use a counter to output a pulse.
As this is just a high and then a low, you won't really need to output a digital waveform. Waveforms are more generally used when you have a specific pattern that you want to output.