LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

cvi loads the wrong project

I have a project.  I needed to make a new distribution kit that had some other #defines so I set up the code and did file->save project as-> some new name. Then I set up the distribution and rebuilt everything.  Now when I try to load the original.prj it loads the new.prj.  If I load original.prj and then try to load new.prj its says "new.prj" is already loaded.  If I load new.prj it loads new.prj and I can load original.prj without any errors but its still set up like new.prj.  I looked at the *.prj files and they have the correct information I just cant get CVI to load the original.prj.  Any help please?
 
Thanks
 
0 Kudos
Message 1 of 3
(2,922 Views)
I got rid of the cws file and loaded the original.prj and it worked ok. 
So what is supposed to be the right procedure for making a new distribution from the same project with some #defines different?
 
This doesnt work:
file->save project as->new.prj
because the *.cws file moves to new.prj and wont allow you to load original.prj any more.
 
It only works if I hide the *.cws file which seems not right.
 
 
 
 
 
 
0 Kudos
Message 2 of 3
(2,921 Views)
I think it would help to clear up how project/workspace loading works.  If you open a project, CVI will automatically look in the same directory for a corresponding workspace (.cws).  It defines a "corresponding" workspace as one with the same name as the project, as this is usually the case.  The trouble, in your case, is that your original.cws actually does not contain original.prj.  Thus, every time you try to open original.prj, CVI finds original.cws and opens that instead, which actually contains new.prj.

The simplest way to get around this (in my opinion) would be to include both of your projects in the same workspace.  Since they are very closely related, it probably makes sense to do so.  You can add existing projects to your workspace by going to Edit>>Workspace.  Now if you open the workspace (or a project by the same name), both projects will be accessible in the project tree.  You should note that if you directly open a project that is named differently than the workspace containing it (e.g. new.prj and original.cws) it will open by itself, in a new, default workspace.

CVI does not really support the "Save Copy As" behavior that I think you wanted.  "Save Project As" creates a copy under a new name, changes the workspace to refer to that new copy, but does not change the name of the workspace.  This can lead to the kind of confusing opening behavior you are seeing.  Your best bet is just to copy the .prj file in Windows explorer, rename it as you wish, then either add it to your existing workspace or just open it, letting CVI create a new workspace for it.

I hope this clears some things up.  Let me know if you have further questions.

Mert A.
National Instruments

0 Kudos
Message 3 of 3
(2,916 Views)