LabVIEW 2012 Project Templates and Sample Projects

Aug 15th, 2012 by Christina in LabVIEW

In LabVIEW 2012, new Project templates and Sample Projects help you get started with a project as quickly as possible.

Some of the best weapons against “spaghetti code” – diagrams that are hard to read and impossible to maintain – are design patterns such as the Simple State Machine and Queued Message Handler. The Project templates promote starting with one of these tried-and-true designs.

You can also create your own Project templates and Sample projects, but I’ll talk about that more in a future post.

To use the new Project Templates and Sample Projects, you’ll use the Create Project dialog. You can access this dialog by clicking the Create Project button on the LabVIEW 2012 Getting Started window. It’s also in the File menu and the Project menu.

 

The Create Project dialog lists the available Project templates and Sample Projects. I am only showing the core set; modules and toolkits can install additional items.

If necessary, you can narrow your choices by selecting a category in the left-hand column or typing keywords in the Search box.

After selecting your starting point, you click Next. Depending on the item you have chosen, you may see a different dialog than the one below. For the Simple State Machine, you need to decide your project’s name and location on disk. You can optionally prefix your file names (in case you want to make all your VI names unique across multiple projects) and define a custom icon overlay.

 

When you click Finish, you will have a new project to work with. This project is a customized copy of the template, so you don’t need to worry about edits to the VIs interfering with other applications (which can happen when people edit examples).

You can now open the Main VI and explore the contents of your project. Areas where you will probably want to focus on writing your own functionality are highlighted with blue comments. Here is the Main VI of the Simple State Machine template:

You may also want to review the Project Documentation, which explains the template (or Sample Project) in great detail.

We believe that the Project templates and Sample Projects will not only get you to a working application faster, but also lay the groundwork for applications that can be extended and maintained long into the future.

2 Comments

  • Antoine Chalons

    That looks cool! I like the idea of spreading good architecture with LabVIEW.
    How hard do you think it would be to get the simple state machine template to work with the State Diagram Editor?

  • Hey Antoine,
    I don’t think using the State Diagram Editor with the LabVIEW Template will be very compatible. I suppose you could modify the State Diagram Editor so that it scripting state machines to look more like the templates but that won’t be a trivial change. I don’t see a good way (or really a need) to make them work together. Could you clarify what the goal of getting them to work together is?
    Another tool that may be worth taking a look at is the LabVIEW Statechart Module. This module has replaced the state diagram editor and can be used to create complex state machines while still maintaining a clean high level appearance.

 

Comments have been closed for this post.