LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nsamples digital output

Hi, I'm new to DAQmx. I have a PCI-6514 & need to send out a digital pulse train through one of the lines.
Attached is a simple VI I thought would work. I use the 1D U8 1Ch Nsample instance & supply an U8 numeric array of data to send.
Based on the samples written output, it seems to send it, but I don't seem to get anything but a single spike on the Oscope.

Contrast this with a similar VI using the 1Ch 1 sample instance where each element of the data array is read into a for loop. It works great (is confirmed on the Oscope), but I have to introduce an artificial 50ms delay to 'hide' the latency of the Windows OS.

Using the Nsample instance is what I would like to use, but can't figure out how. Any help would be appreciated.

Also, how can I set the frequency or widths of the pulses I'm sending out ? Maybe it would be better to use a digital waveform ?

ak

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

Hi Cig438,

The 6514 doesn't support correlated I/O (HW timed) so a digital waveform isn't going to be easy to use. The only type of sampling you can specify is on demand (when you call it) or from change detection. All of your timing is going to be software timed, so you can set the periods by controlling the delays between writes. Using the for loop with 1 Channel and 1 sample with varying delays (you can toggle between 2 to generate a pulse train with a duty cycle) is probably going to be your best bet. Even if you got writing N samples to work, you would have no control over the timing.

Hope this helps, post back if I didn't cover anything or you have more questions.

Andrew S.

National Instruments

Message 2 of 4
(3,148 Views)
Hi Andrew,

   Yes - it makes sense. So the 1Ch Nsample instance of the VI does in fact operate by sending the set of samples into hardware memory & then output a hardware-timed data stream, but my 6514 card just doesn't support this DIO mode ? In other words, if I had the right M-series card, I could use the 1Ch Nsample instance & it would output a HW-timed data stream ?

Thanks,
ak

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

Hello ak,

M Series DAQ boards do support a form of hardware-timed digital I/O known as "correlated" DIO.  This means that the timing source for your digital reads or writes can come from a number of sources including an external clock, an analog input or output task, or a pulse train generated by a counter.  By using one of these sources to time your digital task, you are correlating the digital data to other events.  The M Series boards do not have a dedicated digital timing engine, so the sample clock for your digital task will have to come from one of the sources I've listed. 

We do have a number of example programs that demonstrate how to perform correlated DIO with an M Series board.  These include:

Multi-Function-Synch Dig Read Write With Counter.vi (located in the LabVIEW example finder - correlates digital read/write with pulse train generated by counter)
Performing Correlated Digital IO with an M Series Device in LabVIEW (correlates digital input to analog input)
M Series: Correlated Digital Output with Analog Output Sample Clock (correlates digital output to analog output)

If you want a board that has a true dedicated digital timing engine, consider the 653x line.  I hope you find this information helpful as you evaluate the different options that are available. 

Best regards,

 
Message 4 of 4
(3,115 Views)