LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ with a 653X using DAQmx or Traditional DAQ

All,

    Having a bit of a problem trying to get this bit of hardware to do what I want it to do. I've got a 653(4 I believe? PCI-DIO-32HS) PCI card here and I'm trying to take some very simply digital measurements. What I'm trying to do is sample a 12 bit parallel bus on a clock signal (about 2Mhz), sounds pretty simple right? I want to use the first port (A) and the first four channels of the next port (B, each port has 8 channels) to act as the parallel bus, and then use some arbitrary channel to watch for a rising edge on the clock signal to sample this data. I can't seem to configure this device exactly how I want it. I want this device to take ONE sample on each clock, and then place it a buffer. LabVIEW will be continuously reading the buffer and analyze the data. It is critical that the device only sample once on per edge. Can anyone show me how to set this up either using DAQmx or Traditional DAQ VIs in labview 7.1 or later? Any help at all is appreciated. Thanks.
0 Kudos
Message 1 of 5
(2,996 Views)
Hello Kenneth,

the problem is that taking a single sample at a time will cost you enormous computation time. i consider this a bug, but not accordingly to LV engineers. if you would try to do this in C, you'll have continuous loading into computer buffer, and an external pointer to the memory position, allowing you direct access to data as it is written. in LV, the dll to LV connection involve allocation of memory, each time you call the read from buffer. therefore, trying to do a point by point read will induce underbuffer. What you have to do is read chunks of data, say 100000 at a time, and then process separately. to process one by one, you can just enter the chunk into a queue, and dequeue somewhere else.
Here you'll find a discussion on the same topic and the same card, just output instead of input.


Also, dont use 2MHz at first, try at much lower f to check that it works ok. on most computers, continuous input will not work above 1MHz, using the sample clock.
one last thing: if you have an external clock for clocking your input data, just plug it directly on the card as your external clock. that will insure that you sample a single data line per clock edge.

good luck.



Message Edited by Gabi1 on 08-25-2007 12:36 AM

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 2 of 5
(2,992 Views)
the problem is that taking a single sample at a time will cost you enormous computation time. i consider this a bug, but not accordingly to LV engineers. if you would try to do this in C, you'll have continuous loading into computer buffer, and an external pointer to the memory position, allowing you direct access to data as it is written.

I'm trying to take a single sample on a single edge at a time. I can read data in LabVIEW in whatever group size is necessary and then process.

in LV, the dll to LV connection involve allocation of memory, each time you call the read from buffer. therefore, trying to do a point by point read will induce underbuffer. What you have to do is read chunks of data, say 100000 at a time, and then process separately. to process one by one, you can just enter the chunk into a queue, and dequeue somewhere else.
Here you'll find a discussion on the same topic and the same card, just output instead of input.

You linked back to this post instead of the topic.


Also, dont use 2MHz at first, try at much lower f to check that it works ok. on most computers, continuous input will not work above 1MHz, using the sample clock.

How do I achieve this then? This hardware is rated for 2Mhz sampling and I really need it to run at 2Mhz.

one last thing: if you have an external clock for clocking your input data, just plug it directly on the card as your external clock. that will insure that you sample a single data line per clock edge.

Ok. Should I use it as a Trigger or a Change Detection?

Also, should I try this using traditional DAQ VIs as opposed to DAQmx VIs with a task? Does either require any more overhead? I'm really looking to get this done ASAP as this should be a very simple thing to do, and I don't understand why it's so hard to get this card setup to do this.

good luck.
Thanks.
0 Kudos
Message 3 of 5
(2,969 Views)

sorry about the link

http://forums.ni.com/ni/board/message?board.id=170&message.id=251473#M251473

using DAQmx you can set the clock for the device, as well as the clock source. for testing purposes i suggest you dont work at 2MHz.

if you have an external reference, to which every edge some data is sent to the card, then simply define it to be your clock. you input it to the card, (i remember PF2 but check it on the manual). then define the clock source to be external - pf2. automatically, at every clock cycle the card will read the data on its input lines.

unrelated to that you might want to have a trigger to start aquisition.

in general, this is a simple thing to do, and DAQmx is as good as traditional, just with a bit more functionnality. you might want to look at online examples aquisition using DAQmx, and the tread above.

 

-----------------------------------------------------------------------------------------------------
... And here's where I keep assorted lengths of wires...
0 Kudos
Message 4 of 5
(2,962 Views)
Hi Kenneth,

I believe what Gabi is trying to say is try a lower frequency to begin with and work up to 2MHz.  From what I understand of your posts, you want to bring in an external sample clock (at 2MHz) and use it as the sample clock for reading your digital lines.  All you need to do is connect the sample clock to one of your PFI lines on the 6534.  Click here for a link to the help file for the 6534 to get the device pinouts for your PFI lines.  If you search "signal descriptions", you should find the pin numbers (4,7 for PFI0 and PFI1) for your PFI lines. Next select the sample clock source as your PFI line.  This will make your card take 1 sample every rising edge of your sample clock.  These samples are all stored in the buffer until you read them, and if you don't read them fast enough, you will get a buffer overflow.  As a general rule of thumb, you will want to set your "samples to read" at aproximately 10% of your sample rate (200,000 for 2MHz). 

I hope this helps,
Paul C.
0 Kudos
Message 5 of 5
(2,920 Views)