Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

correlated digital read to buffer

Solved!
Go to solution

Hello.

Is it possible to generate a finite pulse train (25 pulses, 100kHz) and read an input to a variable with every falling edge to get a 25-bit result with PCI-6254 or USB-6221?

If so please point me to some examples.

0 Kudos
Message 1 of 4
(2,782 Views)

Hi,

 

There is an example program in LabVIEW (if that is what you are using) that does correlated digital reads.  This example can be found under:

 

Help»Find Examples»Hardware Input and Output»DAQmx»Digital Measurements»Correlated Dig Read With Counter.vi.  

 

What this program does is create a counter output task (which would be your 25 pulses, 100kHz) and sets up a digital task that uses the counter as a sample clock (hardware timed).  You will have to make some minor adjustments to get the program to suit your specific needs but this is a good start.  One important note though is that the 6254 has 32-clocked digital lines while the 6221 has only 8 clocked digital lines.

Message Edited by Jordan F on 09-08-2009 05:02 PM
Regards,
Jordan F
National Instruments
0 Kudos
Message 2 of 4
(2,766 Views)

Thanks for the answer.

I changed this example to my needs, but there is another problem with finite aquiring.

When I choose continious samples on digital read sample clock, error appears:

   Error -200284 occurred at DAQmx Read (Digital Wfm 1Chan NSamp).vi:1  Measurements: Some or all of the samples requested have not yet been acquired.

 

When I choose finite samples, this error appears:

   Error -200278 occurred at DAQmx Read (Digital Wfm 1Chan NSamp).vi:1 Measurements: Attempted to read a sample beyond the final sample acquired.

 

How this can be avoided?

0 Kudos
Message 3 of 4
(2,757 Views)
Solution
Accepted by topic author KaE

Hi,

 

I attached a modified version of the example I linked to you earlier that is finite as you requested earlier that acquires at 100kHz.  Try this out to see if it works for you.  Also, the article linked below includes extensive information on why you are seeing the 200284 or 200278 errors. 

 

Error -200278 at DAQmx Read

http://digital.ni.com/public.nsf/allkb/4159A4241B8A24B3862570EC007AB6B7?OpenDocument

 

Why Do I Get Error -200284 from my DAQmx Read VI?

http://digital.ni.com/public.nsf/allkb/FEF778AD990D5BD886256DD700770103?OpenDocument

 

Regards,
Jordan F
National Instruments
0 Kudos
Message 4 of 4
(2,731 Views)