Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Changing from E Series to M Series card

Hi,

I recently changed from a 6034E DAQ board to the M Series PCI-6251. When I run my software (Mac OS X DAQmx Base) on the 6034E I get a nice, clean measurement (sine wave). On the other hand, when I try to the same software application on the M Series card I get a strange clipping effect on my signal. I've attached a PDF that shows sinusoidal data with the clipping at the end of the dataset. I think it has to do with the buffering but I can't seem to find out exactly what is causing the problem. I was able to get clean data on the M Series card from one of the DAQmx Base examples (cont. acq&graph voltage-internal clk-dig start i think it's called) but my own software doesn't seem to work on the M Series. Ideas?

Thanks for your time,
Stefano
0 Kudos
Message 1 of 8
(3,710 Views)

Hi Stefano-

It looks like you're programming in LabVIEW.  What are the differences between your program structure and that of the example that works properly?  The fact that both channels seem to "drift" upward at the same time and in parallel patterns almost seems to suggest that the source voltage is following that path and not that the software is failing.

The timing rates between E Series and M Series cards are determined a bit differently in NI-DAQmx Base, but the end results should be the same.  In other words, the M Series card should "drop in" in place of the E Series card and give the same result.  If you can give more insight into the actual operation of your program it would be helpful in troubleshooting, but if an example works properly I would suggest first trying to isolate the differences between the two and to make absolutely sure that the source voltage is not actually behaving as your program seems to indicate.

Thanks-

Tom W
National Instruments
0 Kudos
Message 2 of 8
(3,673 Views)
I've attached the LabView application I'm using to read from the DAQ card.
0 Kudos
Message 3 of 8
(3,666 Views)

Hi Stefano-

Are you able to see good results in testing with both of the "Divide?" and "Fit Data?" options disabled?  I ran after removing both of these options and everything worked properly on both E- and M Series cards.  One change I had to make was to remove the While loop in your program- there is no need for it in a finite acquisition and your loop was running endlessly every time because you were not breaking the loop in the case of the expected timeout error from the DAQmx read.

Also, it seems that you are trying to operate on the batch of data with the For loop, but this is also not particulary necessary in finite operations.  I removed both the While and For loops, increased the timeout from 1 sec, and disabled the Divide and Fit Data operations.  This basically turned your example into the equivalent of a shipping example as you mentioned, and the entire process worked well.

Take a look at the attached VI.  Were you able to check any of the suggestions I gave in my first response before simply posting the VI?  Let us know what you find out.

Thanks-

Tom W
National Instruments
0 Kudos
Message 4 of 8
(3,646 Views)
Hi Tom,

You're right, it should work fine with your modifications to the VI. Ideally, what I'd like to do is to continuously stream data from 2 channels on the card and be able to average the data as it comes in. I had the while loop going so I could continuously grab one period of the signal. The for loop would then average a certain number of datasets as specified by the user and display the averaged signal in the graph window (similar to the display on an oscilloscope). I guess I could use the "continous sampling" option on the DAQmx Base "sample clock" VI.

In addition to grabbing the data and averaging on 2 channels, I would like to divide CH1 by CH2 and apply a fitting routine to the divided signal (displaying the divided signal and fit on the graph). This is where the Divide? and Fit Data? options come into play. With all of this processing, I tend to run into buffering problems because I'm not sure how to setup the acquisition. To summarize, I want to-->1. get a period of sample data from 2 analog inputs-->2. average a user-specified number of datasets-->3. Divide CH1 by CH2 and apply fitting routine to the resulting signal-->4. Display in the graph window-->5. Repeat continuously

Can I make this happen?
Thanks for your time
0 Kudos
Message 5 of 8
(3,643 Views)
Hi Stefano-
 
I think I have a better idea of what you're trying to accomplish now.  I think if you make a few fundamental changes you can perform all of the operations you are looking for.
 
First, you definitely need to set the acquisition for continuous sampling.  Otherwise it will simply stop acquiring after the finite amount is acquired and because you are not error-checking in the loop you will not notice that the DAQmx Base Read VI has timed out.  Also, you will want to increase the read timeout beyond the current 1 second setting to ensure that the operation will not time out while you are performing processing on the data.
 
You also need to move the DAQmx Base Start Task VI outside of the while loop and start the task only a single time.  If you were error-checking in the loop you would also notice that the task is throwing an error because your current setup attempts to start the task many times in a row.  Obviously this cannot be done without stopping, but for your continuous operation you will just want to start at the beginning (i.e. before entering the loop) and stop at the end.
 
After making these changes your processing options should have the required data and everything should work.  You should also add error checking to the loop- it's always a good idea because you can break the while loop if an error occurs and avoid having any erroneous data pass or unpredictable behavior based on the occurrence of an error.  You can easily add error checking to While loops like this:
 
 
I hope this helps-

Message Edited by Tom W. on 07-29-2005 12:47 PM

Tom W
National Instruments
0 Kudos
Message 6 of 8
(3,623 Views)
Tom?

I don't know if you're still checking this thread, but I have another question. My application is now set up with the DAQmx Start Task VI outside the while loop and the read timeout wired to 10sec. When I run the acquisition and the real-time division between 2 channels, I have no problem. However, when I try to apply my fitting routine I get a "DMA Buffer Overflow" error. The fitting usually takes about 3 seconds when I run it with test data, but the buffer overflows every time I try to perform a fit on my acquired data. Is there a way to pause the DAQmx task and have it continue the acquisition when the fit is complete?

Thanks for your time,
Stefano
0 Kudos
Message 7 of 8
(3,568 Views)

Hi Stefano-

The best method for stopping the task momentarily would be to do just that- stop it.  One method would be to read the acquisition and then stop it before entering a sequence structure where the fitting will be performed.  After the fitting is complete you would then simply restart the task at the end of one iteration of the While loop and repeat the process with the next iteration.

I have modified the Continuous Acquire LabVIEW example to show this setup.  This will be your best option for "pausing" the acquisition and should work well for your application.

Thanks-

Tom W
National Instruments
0 Kudos
Message 8 of 8
(3,545 Views)