High-Speed Digitizers

cancel
Showing results for 
Search instead for 
Did you mean: 

how to acquire data properly in a b-scan

I'm aqcuiring ultrasound backscattered data in a b-scan system. The vi that i have designed for this purpose is based on a niscope vi (sample rate aquisition). Every time an iteration occurs i get 1000 points and record them in a .xls file, appending values to this file on every iteration, until the transducer gets to the end of 1 line. when the transducer gets to the end, it moves one step, the vi creates another file, where the following acquisitions will be recorded til the next step. My problem is: the transducer is excited at a 1khz rate, (and every time this happens i get 1000 points), but the program (the vi) does not run fast enough to keep track of every pulse (the iteration should occur at 1khz rate also, what's impossi
ble, at least i think it is). Since i'm stuck for a while with this ang i always got very good sugestion on this forum (thanks pals!) i decided to ask for some help. I want to know if it's possible to make this kind of acquisition using labview only and how it can be done.
0 Kudos
Message 1 of 4
(7,047 Views)
Unless you are using a very old machine, you should easily be able to store your data at a 1MHz rate. A three year old 650MHz Pentium III is capable of streaming to disk at 10MHz+, so 1MHz is absolutely no problem. You only have a few changes to make.

1) Do not use the .xls format. This is a non-native LabVIEW format and takes translation time. It is unclear from you question whether you are using ActiveX and storing in native Excel format or are using the LabVIEW VIs to store data in text based spreadsheet format (very slow). In either case, you will be much better off saving as a simple binary file. Use the Write File primitive. You can reach disk limited speeds this way. Store to disk in 65,000 byte chunks for maximum speed. If you need the data in a spreadsheet format, convert it after you are done. If you use a simple binary format, most analysis programs (e.g. MathCAD, Mathematica) can read it.

2) Consider using one file instead of many. Alternately, create all your files before you start. Creating files is a slow process. You do not want to do it while taking data. If you have a newer version of NI-Scope, look on your CD for a directory called sfpFile. It contains some LabVIEW VIs to create binary files with structure. They are somewhat difficult to use, but are tailor made for your application. They allow you to store multiple waveforms in a single binary file with relatively easy access.

3) Your data acquisition needs are not really clear. It appears you are taking 1000 data points every millisecond. What hardware are you using to acquire the data and what scan rate are the points taken at? What is the dead time between each 1000 point scan (if any)? If you are taking data at 1MHz, you are probably better off streaming continuously instead of taking data in separate records, if your hardware supports it. If you are taking data at 100MHz, your dead time is almost a millisecond, so you do not need to stream. Consider putting your save code in a separate loop from your acquisition code. This allows LabVIEW to multithread your application (works much better in LV7.0), resulting in better performance. Use LV queues to communicate between the loops. Use local variables to pass the data between the loops.

Finally, run the LabVIEW profiler to find out where your slow steps really are (in the Tools->Advanced->Profile VIs... menu). If these suggestions don't help or are not detailed enough, post more details of you data acquisition and we'll try again. You should be able to do this.
0 Kudos
Message 2 of 4
(7,047 Views)
Leo, I have had similar problems in the past, could you post your vi so that i can get a better understanding of what you are doing.
 
Mark
Mark Mutton
Electrical Engineer
0 Kudos
Message 3 of 4
(6,769 Views)
This is a very old thread, and things have changed a bit.  NI-SCOPE now includes the NI-HWS toolset, designed for high performance disk access.  It is the successor to the sfpFile API mentioned above.  Look at the NI-SCOPE example niScope EX Save to File - HWS Low Level - Single Channel Stream.vi for how to use it.  There are several NI-SCOPE HWS examples for your use.  You can find them with the example finder (in LabVIEW Help->Find Examples...).

An alternate is to use the TDM binary format.  I am not experienced it it's use, so can't offer too many hints.

As to which to use, that depends on where your data is going.  If you plan to analyze using DIAdem or Excel, use TDM (there is an Excel plug-in).  If you plan to analyze using anything else, use HWS.  HWS is based on HDF5, so can be read by most analysis packages using the HDF5 tools.  If your analysis package does not support HDF5, use raw binary.  Anything will read that, but it is not very self-describing.
0 Kudos
Message 4 of 4
(6,761 Views)