LabVIEW Development Best Practices Documents

cancel
Showing results for 
Search instead for 
Did you mean: 

Software Engineering Technical Manual and Exercises for LabVIEW

This technical manual examines the typical development life cycle and reviews the best practices and recommendations for programming with LabVIEW in a structured development environment. Topics include configuration management, tracking and identifying changes that are made to code, requirements gathering, code architecture, ensuring proper style guidelines, validation of code, dynamic code analysis, and professional deployment practices.

 

Table of Contents for Attached Exercises

  • Introduction to Software Engineering
  • Software Configuration Management with LabVIEW and TortoiseSVN
  • Exercise: Creating a Subversion Repository and Adding Code
  • Exercise: Tracking Changes to VIs Using Source Code Control
  • Tracking Requirements Coverage with NI Requirements Gateway
  • Exercise: Tracing Code to Requirements Documents
  • Performing Code Reviews with NI LabVIEW VI Analyzer Toolkit
  • Exercise: Analyzing Code Quality
  • Advanced Debugging and Dynamic Code Analysis with NI LabVIEW Desktop Execution Trace Toolkit
  • Exercise: Debugging Unexpected Behavior
    • Part 1: Trace an Example in the Development Environment
    • Part 2: Trace an Executable
  • Testing and Validation with NI LabVIEW Unit Test Framework Toolkit
  • Exercise: Unit Testing and Validation of Code
  • Optional Exercise: Finding Un-Covered Code

 

Revision Log

  • 8/20/13 - Updated for LabVIEW 2013 and made minor bug fixes to hands-on manual.  (v 4.1)
  • 8/22/12 - Repackaged for LabVIEW 2012 using a VI Package file.  Demonstration files and script are installed to the 'Create Project' dialog
  • 9/21/11 - Updated manual (v2.1) to correct minor mistakes and released new version of slides
  • 9/14/11 - Updated the database so that it does not generate a run-time error by default.  It must be turned on by enabling the conditional disable structure (for the DETT exercise)
  • 7/20/11 - Replaced manual, exercises and slides with updated versions for NIWeek 2011 (to download the original content, browse versions orclick here)
  • 6/6/11 - Added 'SVN Database NEW.zip,' which contains a new and more 'real-world' demonstration that has been designed for these exercises
  • 6/2/11 - Updated slides now include additional material on configuration management and the use of VI Package Manager

 

Related Links

  • Overview of Software Engineering with LabVIEW
  • Introduction to Configuration Management with LabVIEW

 

Contact Elijah Kerry with any questions at Elijah.Kerry@ni.com

 

 
Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
Comments
jcz
Member
Member
on

Good article, Eli. Those who don't have LabVIEW 2009 and LVCompare.exe, can use LVDiff http://meta-diff.sourceforge.net/ and set it up in TortoiseSVN/CVS.

Elijah_K
Active Participant
Active Participant
on

Thanks Jakub.  Alternatively, if you want to continue development in an older version, I believe that the LVCompare.exe file will work with versions before 2009, as long as they had the graphical compare tool (so 8.0 or later) built in.  That being said, I have not tested this, so anyone who has - let us know!

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
OscarDaniel
Member
Member
on

Hello

I  try to use the tool "LVCompare.exe" from the "TortoiseSVN" and generates  me the following error message:

An error occurred while running LVCompare.

Invoke Node in LVCompare.vi
<APPEND>
Method Name: <b>User Interaction:Compare VIs</b>

Elijah_K
Active Participant
Active Participant
on

Could you post the exact string you put in your settings for the vi file format?

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
OscarDaniel
Member
Member
on

I just follow the steps in the "EXERCISE: TRACKING CHANGES TO SOURCE CODE CONTROL USING VIS", and after the step 4.b (page 8), then appear the error message. Because that I don’t have more information about the erro.

Elijah_K
Active Participant
Active Participant
on

So my integration with TortoiseSVN works beautifully (I use it all the time), and this is what I have in my settings:

"C:\Program Files\National Instruments\Shared\LabVIEW Compare\LVCompare.exe" %mine %base -nobdcosm -nobdpos

(make sure you include the quotes around the path)

In the settings dialog, click on 'Diff Viewer,' then in the right pane, click 'Advanced,' select 'Add' from the dialog that appears, and enter this string for the .vi file extension. 

Is this still not working?

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
mprimrose
Member
Member
on

Elijah,

Is there any way to add "Diff with previous version" to the Labview Tools menu so that I don't have to right click in Windows File Explorer to compare with a previous version?  This is one feature that JKI lacks.

Mark

Jim_Kring
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast
on

Hi Mark,

That's high up on our to-do list at JKI

Thanks,

K.Ruzicka
Member
Member
on

I use exact your settings (copy&paste from your posting) with LabView2009SP1 and TortoiseSVN 1.6.7, Build 18415

and have the same error:

Invoke Node in LVCompare.vi
<APPEND>
Method  Name: <b>User Interaction:Compare VIs</b>

any hints?

Elijah_K
Active Participant
Active Participant
on

Do you have the professional version of LabVIEW?

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
K.Ruzicka
Member
Member
on

I have the Full version with Application Builder

Elijah_K
Active Participant
Active Participant
on

I'm afraid that the diff and merge features are only available in the Professional Development Environment.

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
K.Ruzicka
Member
Member
on

Very disappointing, as the LVCompare.exe is installed by default (why, when its not working anyway) and the error message is completely useles...

Peilong
Member
Member
on

I got the pop-up window "LabVIEW: File version is later than the current LabVIEW version" which stops me from running the "Basic Calculator" project. Anyone can suggest a solution for this? Thanks.

>I use Labview 2009 professional development suit on WinXP and did the setup steps according to the Software Engineering Hands-On Exercises.pdf

Fini
Member
Member
on

The project is unfortunately saved in LV2010 format...

I also did not come round to upgrade to 2010 yet, so I suffer the same. Maybe Elijah could save the project in some older version format

But I like the step by step exercises, very good article!

fareast
Member
Member
on

I use the VisualSVN as the server, and TortoiseSVN as the client. They works well. This article is very good. Thanks.

Cepera
Member
Member
on

Elijah, good presentation! I think it would be beneficial to add a chapter on bug tracking (Bugzilla?).

Sergey

RyanCheng82
Member
Member
on

thank for your guys discussion content, for me it is important to know.

Ryan

Anne_Z
Member
Member
on

Hi, I just installed tortoiseSVN. The articles are the most helpful in overcoming setup issues with LabView. But I have not been able to find similar information on TestStand. Does anyone have experience in using SVN with TestStand, especially differencing sequences?

Anne

ANDRES_VANEGAS
Member
Member
on

Good Article...Grettings of Ecuador

X.
Trusted Enthusiast
Trusted Enthusiast
on
Schnegg
Member
Member
on

Hi,

I just installed tortoiseSVN with the same settings as https://decibel.ni.com/content/groups/large-labview-application-development/blog/2010/03/29/using-su....

An error occurred while running LVCompare.

ERROR is German:

Bei der Ausführung von LVCompare trat ein Fehler auf.

Open Registry Key.vi

Aufrufen von LVCompare:

LVCompare <absoluter Pfad zu vi1> <absoluter Pfad zu vi2> [-lvpath <absoluter Pfad zu LabVIEW>] [-noattr] [-nofp] [-nofppos] [-nobd] [-nobdcosm] [-nobdpos]

[-lvpath <absoluter Pfad zu LabVIEW>] - Pfad zur LabVIEW.exe, die für den Vergleich der VIs verwendet werden soll

[-noattr] - Vergleichen Sie keine VI-Attribute

[-nofp] - Vergleichen Sie keine Frontpanel

[-nofppos] - Vergleichen Sie nicht die Position/Größe von Frontpanel-Objekten

[-nobd] - Vergleichen Sie keine Blockdiagramme

[-nobdcosm] - Vergleichen Sie keine Darstellungsoptionen von Blockdiagrammobjekten

[-nobdpos] - Vergleichen Sie nicht die Position/Größe von Blockdiagrammobjekten

Beispiel:

LVCompare c:\test\apfel.vi c:\test\orange.vi

Elijah_K
Active Participant
Active Participant
on

Please confirm that you have the professional version of LabVIEW.  Also, what version of LabVIEW are you running?

Does this error occur when you try any VI?

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
Schnegg
Member
Member
on

Professional Developer Suite 2011.

I tested some things and it seems that I must have administrator privileges on the PC.

Normal I don't have administrator privileges on the PC but the system administrator tried it with administrator privileges and it works.


Can I also run it without administrator privileges on the PC?

(The installations folder of Tortoise and National Instrument have administrator privileges on the PC also on my account).

Elijah_K
Active Participant
Active Participant
on

Do you have the original error code?

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
Schnegg
Member
Member
on

This is the error code, but in German.

Bei der Ausführung von LVCompare trat ein Fehler auf.

Open Registry Key.vi

Aufrufen von LVCompare:

LVCompare <absoluter Pfad zu vi1> <absoluter Pfad zu vi2> [-lvpath <absoluter Pfad zu LabVIEW>] [-noattr] [-nofp] [-nofppos] [-nobd] [-nobdcosm] [-nobdpos]

[-lvpath <absoluter Pfad zu LabVIEW>] - Pfad zur LabVIEW.exe, die für den Vergleich der VIs verwendet werden soll

[-noattr] - Vergleichen Sie keine VI-Attribute

[-nofp] - Vergleichen Sie keine Frontpanel

[-nofppos] - Vergleichen Sie nicht die Position/Größe von Frontpanel-Objekten

[-nobd] - Vergleichen Sie keine Blockdiagramme

[-nobdcosm] - Vergleichen Sie keine Darstellungsoptionen von Blockdiagrammobjekten

[-nobdpos] - Vergleichen Sie nicht die Position/Größe von Blockdiagrammobjekten

Beispiel:

LVCompare c:\test\apfel.vi c:\test\orange.vi

English (Translation):

When running LVCompare was an error.

Open Registry Key.vi
Calling LVCompare:

LVCompare <absolute path to vi1> <absolute path to vi2> [-lvpath <absolute path to LabVIEW>] [-noattr] [-nofp] [-nofppos] [-nobd] [-nobdcosm] [-nobdpos]

[-lvpath <absolute path to LabVIEW>] - path to labview.exe to be used for the comparison of the VI
[-noattr] - Compare VI no attributes
[-nofp] - Compare no front panel
[-nofppos] - Do not compare the position / size of front panel objects
[-nobd] - Do not compare block diagrams
[-nobdcosm] - Compare Options block diagram representation of any objects
[-nobdpos] - Do not compare the position / size of block diagram objects

example:
LVCompare c: \ test \ apfel.vi c: \ test \ orange.vi

Fini
Member
Member
on

Hej Schian,

I reckon your Tortoise settings are wrong. This is how it looks at my computer.

If you add the external program for .vi extensions, the line should be something like this

"C:\Program Files (x86)\National Instruments\Shared\LabVIEW Compare\LVCompare.exe" %mine %base -nobdcosm -nobdpos

Note that the " and so on all have to be put in exactly as shown above. Your Program Files directory might have different name (like 'Programme'), but you get the idea.

Cheers,  Fini

Capture.PNG

Schnegg
Member
Member
on

I have the same settings:

Unbenannt.JPG

On this pc i have no administrator privileges. I think thats the problem.

Could that be? And can i give some folders privileges that it works?

Fini
Member
Member
on

I tried it out but it works. On my normal PC where I have admin privileges (and installed Labview and Tortoise) which is under a WIN domain controller I logged in with a non-admin user. After setting up the LVcompare things in Tortoise for this user I could use the compare just as usual. So there is no need to be admin to work with this feature. (Interestingly the LabView licence seems to be bound to the user, as this non-admin user runs LabView in trial mode.)

How far gets the Diff before the error occurs? Do you see the LabView splash screen (assuming LabView was not running when you started the diff via Tortoise)? The error message you get is a little bit nondescript, I've never seen that.

Schnegg
Member
Member
on

As admin i can use compare. Everything is OK and works well.

Without admin privileges. There is nothing before. The error warning is the first window.

Unbenannt.JPG

Fini
Member
Member
on

I assume the vi you want to compare is "open registry key". I tried several things to replicate the error ... to no avail. The only thing that comes to my mind now is ... is the checked out folder owned by the non-admin user? Or does this non-admin user work with the data (i.e. vi) files owned by the admin? In all my tries here I always checked some project out, cleanly, by that non-admin user in a folder of that non-admin user. Then changed one vi and did the diff. This error might come if Tortoise or LVcompare is not able to read the relevant files, meaning the actual .vi file and the files hidden in the .svn folder. Just a guess.

SMcGraw
NI Employee (retired)
on

What operating system are you using schian?

SMcGraw
NI Employee (retired)
on

I believe the problem is that on your particular setup, the user doesn't have permissions to read the registry keys to the windows shell command for opening .vi types (what LVCompare uses to determine where the LabVIEW executable is to launch on Windows).  You can possibly workaround this problem by:

1. log in as administrator

2. run regedit

3. got to HKEY_CLASSES_ROOT \ .VI key

4. pop-up on it and select "Permissions" to give everyone read permissions

5. look at the "Default" string value in the right pane.  (On my Windows XP 32-bit machine, it is "LabVIEWInstrument"

6. go to HKEY_CLASSES_ROOT \ LabVIEWInstrument (or whatever is in your default string value for .VI key)

7. give everyone read permissions on LabVIEWInstrument key (or whatever is in your default string value for .VI key)

Schnegg
Member
Member
on

Hi SMcGraw,

thank you for your solution. I tried it and everything works well.

Thanks to all

Patrick

SMcGraw
NI Employee (retired)
on

Glad it work out for you!

RayFarmer
Trusted Enthusiast
Trusted Enthusiast
on

By the way Eli,  I have added a similar setup to my SmartSVN to allow VI comparison.

Use C:\Program Files\National Instruments\Shared\LabVIEW Compare\LVCompare.exe in the External comparator command and ${rightFile} ${leftFile} in the Arguments.

I have also done a similar setup to compare my TestStand Sequence File as well. Therefore you should be able to do this with TortoiseSVN. For the command line use C:\Program Files\National Instruments\TestStand 4.2.1\Bin\SequenceFileDiffer.exe and the Arguments are ${rightFile} ${leftFile} as with the LabVIEW setup.

Regards

Ray armer

Regards
Ray Farmer
akaperô
Member
Member
on

Hi ElijahK,

I can't open the package. I have an 8.5 licensed version, but I try with 2010 and 2012 trial version, and error message from VIPM is always the same:

"This package is not compatible with your operating system or any LabVIEW version installed on your computer."

My OS: WindowsXP (32bits)

Thanks!

Elijah_K
Active Participant
Active Participant
on

Please be sure that the LabVIEW version you've selected and configured from the drop-down is 2012 (as shown below)

8-28-2012 8-48-15 AM.png

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
akaperô
Member
Member
on

This is the error message, with the 2012 LabVIEW versión configured:

VIPM_capture2.png

It's the trial versión, could be the reason?

RayFarmer
Trusted Enthusiast
Trusted Enthusiast
on

I think you should be using a proper release not the beta version

Regards
Ray Farmer
LucaP.
Active Participant
Active Participant
on

I do see the same error as akapero with the released version of LV/VIPM. Any hints?

Capture.PNG

Regards,
Luca
Elijah_K
Active Participant
Active Participant
on

I just uploaded the file again - can one of you verify that this has addressed the problem?  (works on the 3 machines I've tested it on)

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
LucaP.
Active Participant
Active Participant
on

It's working now. Thank you.

Regards,
Luca
Bob_Schor
Knight of NI Knight of NI
Knight of NI
on

The Good News is that the VIPM package installs fine on Window 7 (64) + LabVIEW 2012 (32-bit).  The Bad News is the PDF file still is call the  "Software Engineering Techincal Manual and Exercises v 3.0".  Now, I realize "Techincal" is a technical NI term for "Technical", but for those of us not familiar with internal NI lingo ...  (just kidding!)

BS

Bob_Schor
Knight of NI Knight of NI
Knight of NI
on

Elijah,

     The PowerPoint slides mesh nicely with the Exercises in the Technical Manual.  However, Slide 32, "Create a Configuration File by Scanning a Project", does not seem to have a corresponding Exercise.  What is this?  Is this topic covered somewhere that I missed?  [By the way, I know I said "call" instead of "called" in the previous post ...].

BS

Elijah_K
Active Participant
Active Participant
on

Hey Bob,

I've corrected the typo - good catch!  Sorry for the lack of details on the configuration file.  This is a very useful feature of the professional version of VI Package Manager, as it simplifies recreating and tracking all of the VI Packages that a project uses.  Instead of having to transport and share numerous package files, ensure that they're all the correct versions, and manually install them all individually, you can create a single file that contains all of this information.  For more info, check out JKI's website on Configuration Files.

Elijah Kerry
Chief Product Manager, Software Platform
_______________________________________________
Follow my Software Engineering for LabVIEW Blog
jordon
Member
Member
on

Good Article...Grettings of Ecuador

CaoWJ
Member
Member
on

great work

Ficare
Member
Member
on

good article !

you should add something in the next version : how to branch and merge with SCC (with practical example), and indicate how to organize project, libraries, files,  to minimize (if not avoid) coupling between modules.

Philippe

rolfk
Knight of NI Knight of NI
Knight of NI
on

Not sure it would be a good idea to add more than some very generic mentioning of branching. Each SCC system is quite different in that respect and the branching support in SVN, just to name one of the still most popular SCCs out there, is quite limited. That is probably because SVN really wants to be simple to use, contrary to something like GIT for instance which strives for a full featured solution no matter how complicated it gets to use.

Rolf Kalbermatter
My Blog