Some specific next steps for LabVIEW examples

December 29, 2008

I wrote a post over the weekend about trying to improve examples for people using LabVIEW. Michael Aivaliotis and Yari had some good comments and I wanted to follow up on those as well as share a recent discussion and give some insight into the complication (some might say unnecessary) with getting the right LabVIEW examples in the hands of people that need them. As a follow-up to recent discussions by the LabVIEW Champions I had a good lunch discussion today with Todd, a LabVIEW Product Manager on this area.

Michael made a very good point about shipping examples being a starting point of many applications. That is entirely true. Now there are sometimes more than one way of doing something so it’s important we present the pro’s and con’s but overall having a high bar for shipping examples should be paramount. There are a few steps Todd and I discussed to take some short term action:

  1. Prioritize the code to focus on using web traffic and download information.
  2. Investigate the current shipping example review. During our lunch today, Todd, Dr. Truchard and I discussed the importance of example code. An analogy that came up was the code review process we use in engineering for software development. If example code is used as the framework for peoples applications it probalby deserves similar attention. This is more of an investigation task for Todd and me, we both really don’t know what we do today, we may be doing all the right things already.
  3. Determine what the update process for examples is (shipping and on line). How do we review examples that should be updated because the way of solving a task has improved as a result of a new feature? How do users with older versions still continue to be able to find relevant examples?
  4. Create a collaborative environment with the LabVIEW Champions and others to identify code to improve and possibly be part of the solution.

Yair brought up a great point about Tutorials and their relationship to example code. It really is key to make examples tie to tutorials better, make it bi-directional since I could find one or the other when I search on-line. The NI web-site does have related links that show up on pages that are automatically generated but in these cases having a very specific tutorial referenced would make much more sense. This is an area that we’re still discussing. How can tagging help with this? How should search work versus browsing? This example might be a step in the right direction: Queued Message Handler

Finding Examples

2002 - Example Finder and Example Database (EPD)

2002 - Example Finder and Example Database (EPD)

There are a lot of different places developers can go to find examples. The Example Finder in LabVIEW is one of them. With this tool people can search for installed examples as well as on-line examples on the NI web-site. I found very old diagram (2002) that has a simple representation of the systems and how they were connected. The details aren’t correct today but the overall structure is relevant. What you can see here is a web service that provides access to examples that are created on the NI web-site through the Example Finder. The Notes EPD DB was the repository of all examples in 2002.

There’s another database today, actually there are two. This really shouldn’t matter as far as people being able to find examples since the information in each system is identical. If you’re wondering about look around on NI Developer Zone you’ll see a UI difference on the between some examples.

One issue that came up in our discussion at lunch is that depending on where you are on NI Developer Zone when you search you may or not get all the examples. Specifically f you want the whole set of examples make sure you search from the main NI Developer Zone page: http://zone.ni.com/dzhp/app/main and not from the NI Developer Zone Community section: http://decibel.ni.com/content/community/zone

The latter only searches through one of the databases I just mentioned. Another thing for the list for us , I put this into the make it possible to find the examples column as opposed to improve the examples that people find.


Improving examples to get people up and running with LabVIEW

December 27, 2008

There’s been a recent discussion between a LabVIEW Product Manager and the LabVIEW Champions on example code I’ve been interested in. The Champions had a lot of great points, there are regular meetings and a private discussion forum for communication, and I wanted to expand on a few of the things that come to my mind and see what others think.

Purpose of Examples
I think of two primary goals of an example. The first is get people up and running with a task they’re starting and the second is to teach people about best development practices. Examples as templates should also demonstrate common applications or needs in applications that people can use as a starting point and customize.

The Right Way or the Fast Way
One specific example used by a LabVIEW Champion got me thinking. Let’s say I want to have my application do something after I click on a button. The traditional way to do this in LabVIEW was to use a while loop and detect a value change on a button. This approach is often referred to as “polling” and it can eat up your processors since the while loop is continually executing and reading the value. When the Event Structure was introduced it provided a much better way where we essentially wait for interumpts from the OS so you’re not just spinning processor cycles polling the current value of a control.

Ideally you should use an Event Structure, you application will respond better and the performance of your application and machine should improve over polling. We do though need to keep in mind that some people are just looking to perform a quick and dirty task where using polling is sufficient and faster to write. Many people transition from this to using that code in a larger application and then the polling approach can break down.

In this case I would want any example that uses polling to call out the pro’s and con’s with polling and mention the event structure as the “right” way and ideally provide a link to that example.

Newer Versions of LabVIEW Introduce Better Ways to Do Something
The event structure is a good example of something that wasn’t in LabVIEW at one time. When it was introduced it provided a better way to develop interactive user interfaces. We should really do something with those older examples shouldn’t we? On Developer Zone we do list the version an example is written in but that doesn’t really inform people that there are features in a newer version, one you may be using, that provides a better way to do something.

Improving Examples in LabVIEW
Improving examples shouldn’t just be about creating more example code. I should ideally be about updating existing examples and in some cases deleting or removing them. Examples are installed with LabVIEW and are available on NI Developer Zone as well as other community sites. The LabVIEW R&D feature specification process does have a section titled “Examples Impact”. I’m going to work with Todd, the product manager I mentioned earlier, to revisit what that sections goals should be. In addition to what examples we need to create, things like what examples need to be updated or obsoleted should be considered. There are some challenges to this process as far as how to manage it and track the use of features in examples but those are details, the overall goal should come first and we should find something we can do today and define what we need in the future.

Your Ideas
If you have any other things you’d like to see in examples or LabVIEW to help get you up and running as well as develop your applications please share your ideas by commenting on this post, I’ll be sure to catalog them and share them.


Follow

Get every new post delivered to your Inbox.