LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Data Processing and High speed data acquisition in C

Solved!
Go to solution

Hi All,

         I am trying to design a VI for high speed data acquition from 3 Data acquition cards at the maximum speed. The data cards are PCI 2517 from Measurement Computing. The intended sample rate from each card is 1M samples/second, so the total of 3M Sample/second from three cards. Problem is the LabVIEW drivers and the VIs provided by vendor works fine just for one card at maximum speed but does not support the multiple cards at maximum speed. Their technical engineer recommended me to write a code in C#, C++ or VB.NET for that high speed data acquition. If I use C for data acquisition I would still like to use LabVIEW for processing the acquired data. I have come across some examples that suggest creating the dll of the C code and then calling it from LabVIEW. But all of those were simple programs and none of them talked about data acqusition in C. My questions are,

1. Is it possible to call a high speed data acquisition C program from labview and not run into any kind of buffer overflow sitiuation?

2. Would it be simple/better to use labwindows CVI?

3. Is there any other alternative solution that I am missing?

           I ll appreciate any inputs.

 

Thanks!

 

-Nilesh

 



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
Message 1 of 10
(5,353 Views)

Nilesh,

I have some questions/clarifications on what you're trying to do, so we can give you a better answer.

1.  What kind of data processing are you trying to program in Labview?  Do you need to acquire and process at the same time, or can you acquire data and then process it when acquisition is finished?

2.  What issues were you running into when using Labview to acquire data?  Was there an error message involved?  Were you getting unexpected data?

Thanks for the question,

Lisa

Applications Engineer
National Instruments
0 Kudos
Message 2 of 10
(5,317 Views)

Lisa,

    Thanks for the reply, I was loosing hope on this one.

I will talk about the second question first, With the drivers the card vender (Measurement Computing) has provided, I developed a VI for data acquisition from 3 cards at a time. I am reading 4 channels each card. The VI worked just fine for data rates <= 100KS/s per channel. But when I tried to raise the data rate to 250KS/s it gave me an errors such as "Buffer Overrun" and "samples were overwritten.." something along that line. After trying various combinations it looks like, I can not acquire at maximum data rate(250KS/s) for more than 4 channels (and it could be all 4 channels on one card  or 2 from either card). I contacted the technical support about their drivers and they said currently the ULx (their driver VIs) can not support more than one card on full speed. Thus, we decides to go 'C' route for data acquisition and the processing in Labview.

  The processing part is mostly correlation and filtering and the display. 

   I would still like to use just labview for data acquisition and processing if it is still possible and achievable with my moderate skills in LabVIEW.

 

Thanks again,

 

-Nilesh

 



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
0 Kudos
Message 3 of 10
(5,310 Views)

Hi Nilesh,

 

I wrote a Code Interface Node in C++ which bridged between LabView and an ASIO compliant sound driver.  The system was able to handle 8 channels in and 8 channels out at 65536 32 bit values per second or 2 * 8 * 65536 * 4 * 8 = 32Mbits/sec.  These transfer rates were performed over ECHO Audio's custom parallel cable system.  The ASIO driver was handed two call back routines from my CIN code.  There was of course a read call back and a write call back.

 

No accumulation of data was being performed in LabView, so there were no memory problems.  Real time waveform generation was performed as well as real time FFT display of up to 8 channels.

 

I found the CIN to be a great solution to easily incorporate ASIO source code into LabView.  At the C++ level, the LabView interface involved some library calls and some post processing of my .EXE after it was built using a LabView utility.  The post processing was simply placed into my project build configuration.  My .EXE was post processed into a .CIN which I could then point to using a CIN function block on my wiring diagram.

 

Terry

Message 4 of 10
(5,301 Views)

Terry,

       I appreciate the response. My C skills are very very basic, and thats why I would like to take whole labview approach. When I posted this question I was not aware of the difficulty level of the C code or making a DLL for that matter. I have a coworker who has expretise in C, said DLL would be time consuming, but he might be able to follow your approach. Can you please elaborate a little bit on how did you get started on the interface code in C? Also would it be possible for someone who is expert in C but does not have any labview knowledge.

again, Thanks for the reply.

 

 

-Nilesh 



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
0 Kudos
Message 5 of 10
(5,273 Views)
Solution
Accepted by topic author odessy27

It's pretty easy.  Arguements for CINrun must match wiring.  You can wire your CIN function block and tell LabView to generate the C interface code to get started.

 

Here are my pairs for the ASIO sound project.

 

All the best,

Terry

Message 6 of 10
(5,264 Views)

Appreciate your help Terry!

 

 

-Nilesh



------------------------------------------------------------------------------------------------------
Kudos are (always) welcome for the good post. 🙂
0 Kudos
Message 7 of 10
(5,213 Views)

Just be aware that the functions called in that example and the functions you have to call in the measurement computing dll are completely different. Also, CINs have been obsolete for quite a while and are no longer supported.

 

If measurment computing has different ULx dlls for LabVIEW and for other languages, you can call the other from LabVIEW just like the existing VIs do. The LabVIEW VIs use .NET methods and properties of the ULx_LV.dll.

0 Kudos
Message 8 of 10
(5,199 Views)

Hi Dennis, Terry, Nilesh,

 

I have a pretty desperate need to get an ASIO driver working for Labview and I believe Terry is the developer for the Arizona State application.  I contacted Dr Sternberg and he pointed me to the Arizona State link below.  I tried downloading the files and I had trouble getting the whole thing working properly.  Can anyone point me in the right direction?  I need to acquire 8 channels of mono audio for manufacturing purposes.  The funkiest issue with this whole ASIO driver issue is that if I create my labview application and put it on an XP computer to acquire the audio, it works fine, but I take the same application and put it on a win 7 computer the labview sound acquire vi's, I dont get all 8 channels.  The people at Tascam told me this is because labview is pointing to the wrong drivers underneath.

 

Anyways, Im confused about this.  HELP!

 

Jon

0 Kudos
Message 9 of 10
(4,989 Views)

2 .net libraries can do this:

 

http://www.codeproject.com/Articles/24536/Low-Latency-Audio-using-ASIO-Drivers-in-NET

 

and

 

http://www.un4seen.com/ Bass.Net if non comercial

 

 

Richard

 

0 Kudos
Message 10 of 10
(4,931 Views)