Jump to content

Independent A/D sampling - is it possible?


Recommended Posts

I posted this on the NI forum and got one reply that I hope isn't true. Hopefully someone else here can confirm or deny it.

I need to be able to sample up to 8 analog channels independently. For instance I need to start up a conversion in one VI and then in another VI start up another conversion on another channel - independent of the first conversion. I thought maybe the PCI-6143 should be able to do that because it has separate A/Ds for each channel, but when I tried it with a simulated device I get the following error:

Error -50103 occurred at DAQmx Read (Analog Wfm 1Chan NSamp).vi:2

Possible reason(s):

The specified resource is reserved.

The operation could not be completed as specified.

This is the same error I get if I use a more standard DAQ. If it can be done are there any examples that show how to do it? If not, does anyone know if anybody makes an A/D card that can do this?

George

PS,

I did some more checking. It looks like I probably need an R series device to do the independent sampling.

Link to comment

QUOTE (george seifert @ May 22 2008, 05:15 AM)

I posted this on the NI forum and got one reply that I hope isn't true. Hopefully someone else here can confirm or deny it.

Error -50103 occurred at DAQmx Read (Analog Wfm 1Chan NSamp).vi:2

Possible reason(s):

The specified resource is reserved.

The operation could not be completed as specified.

George

Yes its true, since most cards have only 1 FIFO and 1 sample clock, you can't do it. You can sort of do it, by sampling all the channels at the highest rate that you need (in a group) and then have 1 loop or VI that acts as a DAQ server with all the data available, and different clients sampling different channels at required lower rates.

Neville.

Link to comment

QUOTE (Neville D @ May 22 2008, 11:23 AM)

You can sort of do it, by sampling all the channels at the highest rate that you need (in a group) and then have 1 loop or VI that acts as a DAQ server with all the data available, and different clients sampling different channels at required lower rates.

Neville.

Maybe that is a better way (at least cheaper) than using the FPGA - start up the A/D sampling all channels all the time and then pick what I need out of the buffer. Does that sound reasonable? Does the DAQ board use up processor resources transferring it's data all the time or does it only transfer it off the board when I do a read?

George

Link to comment

QUOTE (george seifert @ May 22 2008, 09:39 AM)

Does that sound reasonable? Does the DAQ board use up processor resources transferring it's data all the time or does it only transfer it off the board when I do a read?

George

Depending on your DAQ board, and the way you set it up:

1 Hardware timed (using the onboard scan clock)

Uses a DMA channel(s) to dump data directly into computer memory without Processor intervention

2 Software timed (using a AI read VI in a while or timed loop)

Reads the FIFO whenever you ask it to.

The more expensive DAQ boards have multiple DMA channels for AI and AO.

The multithreaded DAQmx driver is really good for the software timed reads/writes if you go that route.

Neville.

Link to comment

Thanks for the help. One more question if I may. Assume that acquisition is always running - converting 2 channels. Is there a way to set it up so that I can read from one channel and (in another loop) read from another channel? The two reads would be asynchronous. It seems like reading from the one channel resets the buffer pointer so that when I try to read from the other channel it has to wait for the buffer to fill again. Somehow it seems like I need two buffer pointers to guide the two different reads.

George

Link to comment

QUOTE (george seifert @ May 22 2008, 11:52 AM)

Assume that acquisition is always running - converting 2 channels. Is there a way to set it up so that I can read from one channel and (in another loop) read from another channel? The two reads would be asynchronous.

George

Are you reading H/W timed? S/W timed?

Are you reading both chans simultanously?

Somewhere on the NI website there is an example showing how fast you can go with s/w timed loops and DaqMX, maybe you can go S/W timed and the two reads could then be separated into two loops (provided you don't expect too much accuracy on the timing and are not going too fast).

Neville.

Link to comment

QUOTE (jdunham @ May 22 2008, 11:19 PM)

I decided it was easier to describe all this in LabVIEW, so here you go. These are just code fragments, not tested or anything, but I've used these methods in many applications.

I got it working. One minor oversight in your diagram in the middle example. I had to negate the offset value that feed into the "number of samples per channel" input on the DAQmx Read VI because it needs a positive value. Other than that it works like a champ.

George

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.