Wednesday, September 29, 2010

Optimizing Dataflow in LabVIEW: In place element structures

I finally finished my project based on FBG technology!! I’m an engineer with Honors and I started an improvement of the Lightbox software for Airbus Company.

Even finished the project there is a lot of possible improvements to get a more efficient application. But is necessary to improve the less efficient part of the project first to get the best improve. LabVIEW is software developed for data flow and instrumentation control, but there is a big problem with it. Always you pass data into a VI or in a for loop the software do a copy of all data. This operation takes a lot of time and if your data flow is fast or big this can cause a slow down in the process.

I search in LabVIEW some solutions to this problem, and I’m glad to discover some structures that can solve my problem.

LabVIEW 2009 includes a structure called In place element that is included also in LabVIEW 8.5, but with a little big difference: The Data value reference. THIS IS A BIG IMPROVE. The concept of a pointer does not exist in LabVIEW an in C or other lenguajes since this, and it can be very useful.

Let’s do an example: We can do a process like the shown in the next image, there is an array of 1000 elements that is incremented 500 times. This process is repeated in a continued execution during some time.

image

The only change made in next image is to create two subVI for every way only for use the Profile Performance and Memory tool in a simple test. Then I execute this process some times.

image

The results of this example is true interesting, let’s see:

clip_image006

Normal VI (the vi that contains the normal for loop) consumes about 3 more time in CPU than the in place structure. But not only improves the execution time. The memory used by Normal VI is 5 times bigger!!!

Well, this results speaks very well about my next step in develop of Lightbox. I post the result here soon.

The entire example is done in an Intel i5, 4GB of ram, windows 7 and LabVIEW 2009 sp1.

No comments:

Post a Comment