LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

good ways to save labview project directories on a development computer

Solved!
Go to solution

I created an application recently. Every day I will copy and paste the previous day project directory, rename it and modify it. When I finished I deleted the older folder and left the latest version on the desktop. Yesterday I thought to do quick modification after assessing executable application for few days. I found certain subvis were deleted/moved.

Is there a recommended method of saving every day project development work?

 

0 Kudos
Message 1 of 8
(2,800 Views)
Ready need to be using a source code control system. Try the open source (and free) Subversion.
0 Kudos
Message 2 of 8
(2,798 Views)

I second the motion.  I was carrying "the latest" around on a USB key, copying it to desktop, working, copying back, going home, working, etc.  So easy to make a mistake that way!  With Subversion (or any other Version Control system), you always have the old versions, you can go back and "start over" at any time.  A real life-saver.

0 Kudos
Message 3 of 8
(2,790 Views)

I had a go with it. Didn't succeed 100%. When I make changes to vi and use diff with previous version I get the error

"Unable to open repository file".

I had added in settings of Tortoise SVN following commands under external programs

 

For compare

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

For merge

C:\Program Files\National Instruments\Shared\LabVIEW Merge\LVMerge.exe" %base
%mine %theirs %merged

 

Besides being able to see side by side differences in front panel and block diagram, I wonder if I could add multiple SVN repositories with different names in C directory for different projects? So I wonder if I could do the following:

Add multiple SVN repositories in C directory

In windows explorer create a blank folder and import this into one of the SVN repository

Go to repo-browser, choose path for above SVN repository and export my blank folder into a new empty folder. Name it for my first project and start working on this until its finished. So I hope, this way I will have a good record of all changes made to the project on daily basis. If this is the standard way then I wonder how we save changes to the project folder as every change will leave vi/folder with a red mark? And will I still be able to revert it back to an old version say a week old?

 

Thanks for help

Kind Regards

Austin

0 Kudos
Message 4 of 8
(2,784 Views)

You can have a repository for each project or a single repository for multiple projects. Using a single repository means that the revision number increments for every project. But that doesn't really matter. Think of the SVN revision number as an internal tracking thing and use tags.

 

It sounds like for what you want to do you can just create a tag every day. Commit all your work at the end of the day and create a tag something like "Project Name-8-27-2011".

 

My repository looks something like this

 

  • Repos
    • Project A
      • trunk
      • tags
      • branches
    • Project B
      • trunk
      • tags
      • branches
    • Project C
      • trunk
      • tags
      • branches

So when you create a project just make the three subdirectories trunk, tags and branches under it. Put all your code in the trunk then import the project.

 

After you import the project then check out the trunk into a working directory. Make your changes then at the end of the day do a commit. Right after the commit create a tag for the date. You will be ready to start working the next day in your working directory. At the end of the day do the same thing. No need to do another checkout or copy any directories anywhere. In fact copying directories for any kind of version control is definately the wrong way. Let Subversion do the managment for you. That's what it's for Smiley Happy

 

You should also create other logical tags such as "Version 1.0", "Version 1.1" etc.

 

Using this you can easily get the code from any day or version. You can do either a checkout or an export.

=====================
LabVIEW 2012


0 Kudos
Message 5 of 8
(2,779 Views)

Thanks for your reply

Sorry I am new to svn and source code management- would you mind telling how the tags are created.

 

Kind Regards

 

0 Kudos
Message 6 of 8
(2,769 Views)
Solution
Accepted by topic author K.Waris
Sure, a tag is a snapshot. You can think of it as a folder containing your project as it existed when you created the tag. Don't worry about branches yet. You will probably never use them. I for one have never needed one. That said a branch is simply a tag that you use differently. You never modify a tag (you can but shouldn't) but you do modify branches. They are a fork of a project. To create a tag (or branch) you select tags/branches and set the name. For example something like repos/project name/project name_8_28_2011. You can then export it from the repo browser. One of the most impressive things about subversion is the documentation. Google "red bean book" and read the pdf. The express are pretty much command line based but you can still get a good idea of the concepts of tags and branches and other aspects of version control.
=====================
LabVIEW 2012


Message 7 of 8
(2,758 Views)

One important correction. I said "repos/project name/project name_8_28_2011". That should read "repos/project name/tags/project name_8_28_2011". Also "the express" should read "the examples" That's what happens when I try posting from my phone using Swype.

 

Another advantage of using one repository for all your projects instead of a different repository for each is managment. You should back up your repository from time to time using svn dump. They can become corrupted which sucks.

=====================
LabVIEW 2012


0 Kudos
Message 8 of 8
(2,729 Views)