LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

high output rate with 6024E(or 6062E) and BNC-2120 and Labview 8.2

I'm using LV8.2 under WindowsXP with 6024E and BNC-2120 board. I just started to learn labview and currently I am using a labview code, called monitorIU_coef.vi, which was wrote by somebody else long time ago.
I am measuring I-V, I-t (current-time) characterisitic from current preamplifier and voltage preamplifier. I want the system can measure short peaks (below 1 milli second) in the I-t curve. The bandwidth of those preamplifier should be good enough. However, with current Labview code, I can only get about 200 data/second at most in the output file.
 
My questions here are,
1, Is this limitation due to the DAQ? Now I am thinking about replace 6024E with 6062E. From the specificaition I can see that 6024E has a output rate only 1kS/s, and 6062E has a Output rate 850kS/s. 500,000 data every second should be corresponding to 1 data per 2 microseconds, which should be good enough.
 
2, Could you please take a look of my Labview code and tell me how to increase the output data per second in the output file?
 
3, Is there a easy way to achieve the following function based on my current labview code? 
    If I output all the data with 500kS/s rate, the final file might be very large. I hope the DAQ acquire data at a very fast rate. However, the output rate can be at a slower rate, such a 1kS/second when the current is flat or slowly change. When a peak is identified, the output rate should be at a very high rate, such 500kS/s even higher?
 
4, I have another problem with current LabView code. In the final output file, I have the first column as time, second column as current, and third column as voltage. When I change the rise time and/or average value in the labview front panel, the output time is not correct any more. For example, if I do a measurement for 10 minutes, the time should be from 1 to 600 while I got from 1 to 300 in the final output file.
 
I included "average 4 channels.vi" and "monitorIU_coef.vi", because they seems to be related.
 
If you do not have time to look into the code, any suggestion or hint will be still highly appreciated . I know little about Labview and I really don't know where to start. 
 
Thanks,
Rusen
Download All
0 Kudos
Message 1 of 9
(3,745 Views)
Your terms and specs are all backwards. You do not care about the output rate of the DAQ card. You want to look at the analog input sample rate. This is the rate that you would acquire data. The way the code is written now, it would not matter if you switched DAQ boards. The subVI you posted - average 4 channels, uses a function called AI Sample Channel. This is used for each of 6 channels. I have no idea why the original author decided to use this function unless he or she was very inexperienced as well. Used this way, the DAQ does not use the on-board timing to acquire data. It is strictly software timed. There are functions that allow you to use the on-board timing for much higher acquisition rates. It's also possible to acquire multiple channel with a single function instead of using mulitple funciton calls with a single channel. The subVI should be completely rewritten. You can switch to the more modern DAQ driver called DAQmx. There are numerous shipping examples if DAQmx is installed. If you stick with the traditional DAQ driver, you would want to use a funciton like AI Acquire Waveforms. You mention a need for 500ks/sec. That is the spec for the 6062 but you can only get that with a single channel.
0 Kudos
Message 2 of 9
(3,738 Views)
Thank you very much! I had thought the output rate were the rate to write the data to the output file. As a matter of fact this rate should be related to the sampling rate, which is 200kS/s for 2120. In other words, I can get a maximum of 200,000 data point in one second if I have the right Labview code, right? At least 100,000 data per second should be no problem, right?
 
In addition, I replaced NI PCI-6024E with NI PCI-6259, 16-Bit, 1 MS/s (Multichannel), 1.25 MS/s (1-Channel), 32 Analog Inputs. It should work with my BNC 2120, right? 6024E and 2120 together should be able to provide a very fast sampling rate >500kS/s. Am I right?
 
From your reply I can see that DAQmax is better than what I have in my Labview code. I might try DAQmax after I receive all 2120, 6259, and cables. Is DAQmax another software different from Labview? Or is it some subvis, which will be included in the labview and do the acquitition?
 
I am really a novice in this field. and I am still learning how the 6259 and/or 2120 get data from outside device and write into a output file. I didn't see a clear part in my Labview code showing the acquisition process.
 
thanks,
Rusen
0 Kudos
Message 3 of 9
(3,721 Views)
 
 
 

Hi Rusen,

In regards to your first question, you shouldn't have trouble acquiring at 200kS/s with the PCI-6024E with the right LabVIEW code. 

In regards to your second question, the BNC-2120 will work with any M Series, E Series, S Series, and NI 671x devices.  This includes the M Series PCI-6259.

DAQmx is nothing more than our newer driver set.  When you install DAQmx, it will verify which version of LabVIEW you have installed and install new DAQmx driver VIs within LabVIEW that can be used with any of our DAQmx supported DAQ cards.  This includes both your PCI-6024E and PCI-6259.  Depending on what version of LabVIEW you are using, you might need to verify which version of DAQmx is compatible with that version of LabVIEW.  You can find compatibility information here.  Another great resource for getting started with DAQmx can be found here.  I would recommend reading through the frequently asked questions (FAQ).  After you install DAQmx, you should be able to go to Help » Find Examples within LabVIEW and find various example which demonstrate good programming practices to use with your two DAQ cards. 

I hope this information helps,
Paul C.

Message Edited by Paul C. on 10-22-2007 01:10 PM

0 Kudos
Message 4 of 9
(3,721 Views)

Hi Paul,

Thank you very much! Now I will start from FAQ of DAQmx and hopefully I will be more familiar with Labview and write a good code by myself.

I am really glad that you lead me to a good start point. I had read a book on Labview. Eventually I gave up because I was completely lost in the book.

Regards,

Rusen

 

 

0 Kudos
Message 5 of 9
(3,704 Views)
 

Hi Rusen,

I'd also like to mention that we have some great courses that we teach on LabVIEW and DAQ applications.  Here is the link to our LabVIEW Basics class.  The LabVIEW Basics class is a great way to start learning about LabVIEW and data acquisition techniques.  I've personally taken the class and found it very helpful and informative.  In addition, I would recommend using context help (Press control + h within LabVIEW).  When you highlight over an VI it will populate a box with information about that VI.  I've found this very helpful when I started learning LabVIEW.

Regards,
Paul C.

 
0 Kudos
Message 6 of 9
(3,686 Views)
Hi,
 
I don't think I will be allowed to take those couses. I have tried to learn labview through help file and this forum for several days now. I got my codes as attached.   I am able to acquire data at very fast rate. However, I have some new problems.
 
First of all, how can I get my data (Current value from ai6 channel, Voltage from ai7 channel and the corresponding time). I mean how to write them to a text or spreadsheet file.
 
As can be seen from my code, I got 1-D array of waveform. "Write to spreadsheet file.vi" might be able to do the job. However, it will open and close the file at each iteration. I want to do it with "format into string" and "Write to text file". However, the final file does not have the data I want.
 
In this output file, I got a row of numbers instead of three columns corresponing to current, voltage and time. There are much less data than I expected.
 
In addition, I used a for loop to generate the time. I guess the waveform should contain the time information. You might have a better way to extract the time information and write to the file, such that I can plot current vs time curve.
 
Second question is about the graph. The current comes from a current preamplifier. As a result, I need to multiply the current value with a scaling factor, such 10^5. As you can see from the attached images in screenprint, the graph without scaling factor is much different from that with scaling factor. The graph without scaling fact seems right, while the graph with scaling factor shows only some zigzag.
 
The last question is still about the graph. How to make the graph to be more continuous and smooth? When I set the rate to be 200 Hz and number of sample to be 200, the graph seems to update every 1 second. If set the number of sample to be lower value, the graph will show only small part of the whole curve and jump up and down. The code can also stop when the number of sample is too small and rate is very high ( A pop-up window will say I need more buffer size or acquir data more frequently). The ideal case will be as follows: with the measurement going on, the graph keep all the old curves and add the new data to it. The x-dimension might keep growing, but I can easily see the trend.
 
I have spend all day trying to export the waveform to a spreadsheet without a good result. I hope you can hepl me out.
 
Any suggestion will be highly appreciated!
Download All
0 Kudos
Message 7 of 9
(3,634 Views)

Hi, just recall other two questions.

1, how to do an average on the waveform? For example, I acquire the data at a rate of 1000Hz and number of sample of 500. How to average 5 data points before I plot the graph and write to the file.

2, when I gain more exprience, I might consider to make a low pass filter to the waveform. Could you please give me some suggestions on that? How to working on the waveform?

Thanks a lot!

0 Kudos
Message 8 of 9
(3,623 Views)
 
 
 
 

Hi Rusen,

I mean how to write them to a text or spreadsheet file.

 

 

The best way of doing this without opening and closing the file every time the loop runs and adding the time stamp to the text file is looking at the “Write to Text File.vi” example (LabVIEW->help->find examples->search tab and type “Write to Text File”. You can use this as a guide and merge it with your code. If you run this code you will have a timestamp for column one and the tab delimited data on each other column.

 

 

The graph without scaling fact seems right, while the graph with scaling factor shows only some zigzag.

 

 

From your pictures I don’t see a zigzag on the current graph that has the scaling factor; I see a zigzag in the voltage graph. What I will suggest in this case is to first grab the data “no scaling” and make sure you are getting the values that you are expecting, after that you need to multiply the data (array) by a scalar, in you code the “scaling factor” is an array. Take a look at this example: “Add - Various Uses.vi”. Make sure to see how all the different inputs (array, numeric, waveform) can change the output of the operation..

How to make the graph to be more continuous and smooth?

 

 

Which of the graphs are you referring to the voltage graph or the current graph? The current graph looks smooth to me. The smoothness of the signal in the graph depends on how fast the signal is changing and how fast you are sampling it, to get a smooth signal as a rule of thumb you should be sampling at 10 times the frequency of you signal.

 

 

How to do an average on the waveform?

 

 

One of the easiest way of doing this is converting it from a double precision data type to a waveform data type and use the “Time Averaging” express VI, another solution is to aid yourself with some for loop and code the averaging yourself. I always prefer test code in separate VIs for testing and debugging and after you are sure the code works like you want to is a quick step to integrate it on the main VI or to call it as a subVI.

I might consider making a low pass filter to the waveform.

 

 

The best way of learning about filtering and what labview can do is getting your hands on some of the examples that we have: LabVIEW->help->find examples->search tab and type “filter”.

 

 

I would also like to inform you that if you have another question regarding a different issue as then one that started this thread it will be on your best interest to post in a different forum, this will allow us support you a lot faster. The NI website in conjunction with labview examples are the best resources to troubleshoot labview code since they will allow you to go to the very basic of your issue.

I hope it helps



Message Edited by Jaime F on 11-06-2007 02:42 PM

Jaime Hoffiz
National Instruments
Product Expert
0 Kudos
Message 9 of 9
(3,594 Views)