Monday, December 13, 2010

Complex notes manager on LabVIEW

 

This is a post i’ve done on the NI discussion Forums in Idea Exchange. It has been warmly welcomed in that community and I hope you find it interesting.

“Well, time ago I started to work with LabVIEW, It's powerful, but there are some kind of issues that I want to explain here. Now I'm get involved in a big project for a very big aerospace company, and I'm developing a complex application to acquire some data and process it. Well, this software is in development by some people and I have an idea for the work flow.

I explain it with an example:

If we have in every VI a little data base with some notes ordered by type or something we can read the code or we can start to work in a VI faster. Imagine that you have an event structure with several cases, and you put some notes like you can see in the following image:

Captura.JPG

Now, I'm able to revise quickly the code reading all the notes and start working only in the "TO DO" zone. But let's do a more complex design: Now I open my project explorer, and open the "Note manager" that could be like this.

Captura2.JPG

Here it is the real advantage of this tool: All the design are done and now I want to improve the application. Lets go only to the notes that interest to me: "TO DO" notes. If I double click on an element LabVIEW opens for me the VI centered in the zone that is interesting for me. And some more: I can check the work I've done and I can add new notes only with a click.

The more complex the project is, the more useful is this system. So, what do you think?”

Saturday, November 13, 2010

Complex data interface in LabVIEW

As I posted before I’m doing an application to manage and control data acquisition from some specific instruments. The application have some tabs with different controls and indicators and in the background have a very complex data flow that have been processing as fast as the computer can. All this data must be showed to the user but with the smallest amount of resources.

In LabVIEW it’s easy to implement a refresh routine to shown data. It’s easy as:

imageThis basic loop puts data into a control every iteration, but as you can see is not controlled in time or in valid data at the input. Of course this loop takes all the processor and resources of the system.

How about this solution?:

image

Ok, as you can see it’s a much more smart solution, didn’t it? It have a strong synchronization not only with the data flow (because of the notifier used) it have a minimum refresh interval that can be configured. An the case structure avoids the write of not valid data. This is a better implementation for data interface update, I'm not absolutely sure that is the best, because depends of the application, but is quite good.

Now I want to show my problem and my solution.

When I started to develop Lightbox I have a huge problem: A lot of different interfaces must be showed to the user only when they are needed. My first design consist on a hard and big galaxy of cases and loops. It was unreadable, and I’m sure that uses a lot of resources.

I improve the system with the next solution that I think it’s much more dynamic and light.

The interface:

image image

Let’s think that the interface has some controls in two tabs because it’s the same information but with different representations process. Also we have a very fast data flow in the background that has being processing in parallel.

Ok, the representation of a graph is much more heavy than the numeric indicators, but this two representations doesn’t need to be done at the same time because the user can’t see both together. (Think in too much tabs and more complex data right now… It can be a chaos!!)

What we can do?… Dynamic events, you can synchronize the update instructions with the next system:

image image

It’s quite complex for basic purposes, but when you have a big application it’s good:

  • The program only update the values when the user are seeing it.
  • The refresh time can be dynamically defined if you want. It can depends on the user, other vi’s that calculates the power of the PC or something like that.
  • The update is done as fast as the system look at the event structure.
  • In some complex cases you can use all the possibilities of the timed loop structures to prioritize or dynamically control the system. (Think about a terminal program to show results that gets data from a shared variable in a network. This system can also control the usage of the network or thinks like that).

Here end’s this post. I hope that you meet it useful… What do you think?

Tuesday, November 9, 2010

Firefox 4.0 Beta

imageWell, some weeks ago I started to use Firefox 4.06 Beta, and I’m very happy with it. It’s too similar to Crome, but is what the people want. Firefox is elegant and fast with pages, but it’s slow at the opening. In my computer (I5, 4GB of ram, nvidia 9500) takes 4 seconds to open the program with some complements, and there is a white window during the opening…What the hell is that?!

Some days ago the Mozilla team have launched the 4.07 Beta. It’s really awesome! Some bugs have been solved like the previous one. But also the interface has changed a little bit:

THERE IS NOT AN STATUS BAR! Why it’s an advantage? Well, a navigator must be like the air. The only purpose of these programs is to show as fast as it can pages. The navigator must show to the user the minimum information, because the focus is the page not the navigator. Crome implements this idea very well, but the Google empire frightens me and I decide not use it.

The new interface is clear and user friendly. Only shows the information when needed. For example, the new interface show the link information at the right of the address bar only when the mouse it’s over a link (like Crome). The reload bottom it’s embedded into the address bar and is the reload and cancel button only when needed.

image

As strong points in Firefox 4.07b  we have a very good support to html 5, webGL and direct2d to improve speed and functions. All the improves are in the Mozilla page.

I think that this navigator is a big step for every Firefox user. What do you think?

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.

Saturday, September 18, 2010

Lightbox

Six years have passed since I start my degree in telecommunication engineering. But today I see the end, the last effort.

My End-of-degree project is titled: Development of an application in LabVIEW for data acquisition and treatment on MicronOptics instruments, sm125 and sm130. As you can read I developed an application in, I think, the most powerful environment for instrumentation and data work: LabVIEW. image

The capabilities of MicronOptics devices are based on the fiber Bragg grating (FBG) technology. It can measure strain or temperatures or even acceleration only with one optic fiber that can be of hundreds of kilometers length. The reduced cost of this technology for some purposes and the advantages of the light to measure without noise is the cause of some companies are investing in these devices.

My work consisted in develop Lightbox for these devices: Lightbox is an application that can retrieve data by an TCP/IP connection with the sm125 &sm130 devices and process it to get adjusted information. Next it can write it into memory or you can see the information in a panel of graphs.

image

All developed with LabVIEW 2009. In two months of work you can have a complete software running, the time saved and the reduced cost of developing is the most attractive characteristic of LabVIEW software.

In conclusion: This project let me know LabVIEW deeper and I’m so satisfied with the result.

In the future I will post some entries to analyze the high degree of complexity of this software. 

Friday, September 17, 2010

Impossible is adjective

Impossible is adjective. Adjective is accidental, secondary, non-essential. Like an adjective is not attached to nothing, because is only a word to define the human capacity. Only oneself defines the impossible, but only someone can see this truth.
I like to start this blog with this warning today:
“Only, if you think you can, you can