Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Any examples using DigitalMultiChannelWriter.WriteWaveform available?

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

0 Kudos
Message 1 of 4
(3,834 Views)

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!

 

ColeR
Field Engineer
0 Kudos
Message 2 of 4
(3,809 Views)

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

0 Kudos
Message 3 of 4
(3,806 Views)

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. 

ColeR
Field Engineer
0 Kudos
Message 4 of 4
(3,795 Views)