Jump to content

Recommended Posts

I've been using Labview for 6 years now for research and one of the most confusing things for me is how code is supposed to be managed. I have been using Tortoise SVN with folder organization but with things getting more complicated I am starting to wonder what the "right" way of doings things is.

I've looked through a variety of posts and official documentation and haven't found what I am looking for (or haven't realized it was what I needed).

I'm using LV2009 32 bit, JKI TotoiseSVN Tool 2.2.0.186 (demo), Tortoise SVN 1.7.6, Win 7 x64, and have little interest in actual code deployment.

Features I am looking for:

- avoiding cross linking problems

- prompts to save a vi only when it has been changed

- svn integration

- code that works with multiple developers instead of corrupted files (mainly thinking about project files)

My code base consists of project or modules (not lvproj) just a set of code in a directory & subdirectories. When I am running a program, many of these modules will run together and collect data, with a messaging system in between where necessary. In addition I have generic code libraries (not lvlib), with generic functions (math, string, table, server, etc). It seems like my code libraries should be lvlib files. After some reading it seems like Project Libraries can be used for preventing namespace collisions. On a side note the term Labview Project Libraries is very confusing because I think of Labview Project Explorer which I have no gathered does nothing for changing the namespace. I did happen to find this link, which helped get me started but I'm still not understanding some things.

As a general rule I pretty much want library membership to always apply to files that are in my libraries directory, which doesn't seem possible.

Question 1: How do I delete a library file via SVN and remove it from the project. I am using the JKI TSVN toolbox and removal of the file doesn't seem to effect removal from the library.

Question 2: If I create a vi and later decide to move it into the library, how do I accomplish this in Labview with SVN tracking. For example, if I create a vi in one of my modules and realize that it is fairly generic and would be better in a library, how do I move it to the library (ideally on disk and into the library file) so that both Labview and SVN are happy. Another situation might be moving a file from one module to another module, ideally I could move both library association and disk location.

Question 3: If I am running multiple modules, how do I ensure that they have no namespace collisions? Should these be libraries as well? Do I only need a project if I want to deploy my code?

Question 4: When someone creates a vi outside of the library but in the library directory how can this be detected and fixed?

Question 5: Is there any way to get better svn integration into the lvlib and lbproj right click menu? My current approach would be to do this through the tools menu (tools -> TortoiseSVN -> rename). Side note, this doesn't doesn't currently work on my computer although the actual TortoiseSVN through Windows Explorer works just fine.

Question 6: My files are constantly prompting for saving. It seems like most of these are changes from other files and not the file I changed. Since I don't know really know how this works I am not sure what exactly is going on. The end result though is that I want to minimize version changes (as tracked through SVN). I seem to remember reading somewhere that in LV2010 you can separate source code and compiled code. Thoughts? Would this be fixed by better lvlib and lvproj usage or is something else going on?

Thanks,

Jim

Link to comment

Question 1: How do I delete a library file via SVN and remove it from the project. I am using the JKI TSVN toolbox and removal of the file doesn't seem to effect removal from the library.

The .lvlib file contains a list of files in the library. If you double-click on an lvlib file, a list of VIs in that library shows up. Right-click on a file to "Remove From Library". Then check in the lvlib file.

Link to comment

Question 6: My files are constantly prompting for saving. It seems like most of these are changes from other files and not the file I changed. Since I don't know really know how this works I am not sure what exactly is going on. The end result though is that I want to minimize version changes (as tracked through SVN). I seem to remember reading somewhere that in LV2010 you can separate source code and compiled code.

The changes are probably recompiles caused by subVI changes. Separating compiled code from source code should stop this. I’ve upgraded to 2011 recently and separated compiled code and it seems to work well so far.

Question 3: If I am running multiple modules, how do I ensure that they have no namespace collisions? Should these be libraries as well? Do I only need a project if I want to deploy my code?

I generally put all subVI’s in libraries libraries (or class libraries), other than test code.

Question 2: If I create a vi and later decide to move it into the library, how do I accomplish this in Labview with SVN tracking. For example, if I create a vi in one of my modules and realize that it is fairly generic and would be better in a library, how do I move it to the library (ideally on disk and into the library file) so that both Labview and SVN are happy. Another situation might be moving a file from one module to another module, ideally I could move both library association and disk location.

Personally, I move VIs such that the Project is happy and just let SVN consider the file deleted and created new in another place. Makes your SVN repository bigger, but this isn’t a big issue.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Similar Content

    • By ATE-ENGE
      Edit: I'm asking primarily if there is a reason why/when I should/shouldn't use .net functions in my LabVIEW development. The example below is just to demonstrate a case of my question.
      _________________________________________________________________________________________________________________________________________________________
       
      I recently found a custom library that calculates SHA256 hash algorithms However, in this post I see that the same thing can be done with .net 
       
      My main question is: Is there any reason to build or use a custom library for something where .net functionality already exists? Are there any disadvantages to offloading work to .net ? 
    • By GregFreeman
      I am running calls to a various stored procedures in parallel, each with their own connection refnums. A few of these calls can take a while to execute from time to time. In critical parts of my application I would like the Cmd Execute.vi to be reentrant. Generally I handle this by making a copy of the NI library and namespacing my own version. I can then make a reentrant copy of the VI I need and save it in my own library, then commit it in version control so everyone working on the project has it. But the library is password protected so even a copy of it keeps it locked. I can't do a save as on the VIs that I need and make a reentrant copy, nor can I add any new VIs to the library.
      Does anyone have any suggestions? I have resorted to taking NIs library, including it inside my own library, then basically rewriting the VIs I need by copying the contents from the block diagram of the VI I want to "save as" and pasting them in another VI.
    • By A Scottish moose
      Hello everyone,
      I am working on putting together a test executive that pulls from a lot of external code libraries.  I'm at the point now that I have a fair number of custom error codes generated by different DAQ libraries and keeping track of all of them is becoming increasingly difficult.  I've been using error rings for custom error generation and while not ideal has served well enough until now.  Keeping track of the codes hasn't been hard because they are few and far between.  
      I've been thinking about transitioning to a custom error file instead of using ring constants because keeping track of it all is not realistic anymore.  
      My question arises from the fact there are ~10 different libraries in this current project all pulling from 3-4 different source control locations and creating a single error file that covers all the errors from these libraries seems incorrect.  I would think custom error records would travel with the library that uses them, but does this create file reference headaches when you start pulling in libraries and external references, PPLs, etc?  
      Question: How do you keep track of your custom error codes?
       
      Some options that I could see being viable:
      A single company wide error code file that gets pulled down with your version control. A blanket approach would make sense and also would prevent error code conflicts from one library to another by forcing communication during modification and addition.
       Error code files packaged with each individual library and pull them all into projects when they are getting developed.  This seems the most modular and portable but could result in conflicts with error code numbers if developers don't communicate about the ranges they are using; also how does LabVIEW do with referencing lots of different error files. 
      Cheers,
       
      Tim
    • By Petr
      I'm not able to solve DVRs problem. See project file.
      1. IO.lvlib exists in two versions: one with single variables + processSimulation.vi that simulates process/machine i.e. takes outputs, calculates process behaviour and writes inputs; the second version of IO.lvlib has variables as IOaliases. Simply swaping these two versions allows to run project on real target with machine or to run project on PC without target/machine. Thats why I use these IO.lvlib variables.
      2. Every subsystem is an object/class with method DoSomething that calculates response to inputs and writes outputs.
      3. I¨d like to call these objects DoSomething.vi method in one loop. Thats why it's not possible to have inputs/outputs as terminals of DoSomething.vi
      4. I've tried to solve the problem with DVRs: every object is created by constructor including inputs/outputs DVRs initializing. However I'm not able to use DVRs inside DOSomething method. What am I doing wrong?

      One solution is to avoid loop call and spread all (about 50) DoSomething.vi calls including inputs/outputs terminals onto block diagram. But this is definitely not well arranged solution.
      Do you see anything wrong concerning my solution in general? How to access DVR inside class method? Any other ideas, comments? Thanks.
       
       
      IOrefs.zip
    • By etgohomeok
      I use SVN for version control in my project and am often faced with many conflicted VIs that must be dealt with. I have found that frequently, the changes causing these conflicts are not "real" changes (for example, a wire was moved or a typedef for a cluster control was changed). So, I am trying to create a tool that queries my project directory for any VIs that have conflicts, and running the VI Comparison tool with only non-cosmetic changes enabled to automatically find VIs that don't have any "real" changes and marked the conflicts as resolved. I would like to build the tool into a .exe because I would like to be able to run this tool from the command-line so that I can create a right-click menu item in my Windows environment to easily run the tool from any folder containing conflicted files.
       
      I found vi.lib\SourceControl\support\SCCSup Compare Two VIs.vi which performs the comparison operation, allows me to specify which types of changes to detect, and returns if there are differences. This is exactly what I need and it works perfectly in the development environment. However, when I build my tool to a .exe file, I get a LabVIEW error with the following description:
      Error 1574 occurred at Open VI Reference in SCCSup Compare Two VIs.vi->Resolve False Conflicts.vi Possible reason(s): LabVIEW:  (Hex 0x626) Cannot open a file with separated compiled code in the LabVIEW Run-Time Engine. An error occurred loading VI 'my.vi'. LabVIEW load error code 59: The source file's compiled code has been separated, and this version of LabVIEW does not have access to separated Where my.vi is the path to the VI that it is attempting to compare. All of the VIs in my project have "Separate compiled code" enabled since I use version control on them, therefore turning it off it not an option. Is there any way to get around this issue?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.