LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Dll from labview code to decrease computational time???

Hello all,

I am currently trying to replace some of my heavy computational sections of labview code with a DLL written in C. I am a newbie at C and require some help. I built my C program and there are 0 errors and 0 warnings....being a programer in another lifetime I realize that just becauce there are 0 errors, doesn't mean the program is working properly. I have attached a zip file that contains: a working vi with the original labview code entitled "Just Labview Version", (I am trying to replace the stuff in the 2 for loops). A vi entitle "Structure", which is my attempt at using a DLL that I created (which isn't working). All of the c++ coding with the workspace entitled "1_Array.dsw". And a raw data file for the labview code. I have read a lot of the NI notes on creating the dll properly and allocating the proper amount of memory and have had success with simpler algorithms, but i think there is an issue with my C algorithm. I would appreciate any help in getting this vi to work with the dll!!!!!!!!!!!!!!!!!!!!!!!!!!

On a side note, does professional take labview code and make DLLs producing the C code and everything?(I don't have professional but can dream)Oh ya, the vi takes two arrays and performs a simply calculation and spits out 1 array for display purposes and I am using 7.1, C++ 6.0, and XP. If you require and further information just let me know.

Thanx,

Azazal

(1 more thing...remember to change the path of the raw data file in the vi as it is currently set to my directory)

Message Edited by Azazel on 03-12-2005 03:52 PM

Azazel

Pentium 4, 3.6GHz, 2 GB Ram, Labview 8.5, Windows XP, PXI-5122, PCI-6259, PCI-6115
0 Kudos
Message 1 of 2
(2,255 Views)
I looked at your program. I think you can probably do about as well in LV as in other languages. Look at the information in the archives and in the knowledge base about handling large data sets. Your program uses 150+MB of memory. If your system does not have that much available, disk swapping will slow the process down substantially. Consider making all variables Doubles after the initial file read. The coercion dots on many of the inputs show that LV is doing a lot of type conversion. Use shift registers and Replace Array Subset rather than building arrays at the outputs of the loops. This prevents frequent memory re-allocations at runtime. Since you process small chunks of data at a time in the inner loop, perhaps only reading in a portion of the file at a time might be faster, especially if your system has limited RAM. Use the VI Profiler to help identify the portions of your program using too much time or memory.

Lynn
Message 2 of 2
(2,228 Views)