06-30-2011 09:56 AM
Hello,
it happened to me a few times by now that the tags in my project are offset by a few lines - since it is a large project with many tags it is quite time consuming to repair it. Hence I am wondering what can cause such effects... Thanks!
Wolfgang
Solved! Go to Solution.
07-01-2011 12:09 AM - edited 07-01-2011 12:11 AM
That happened to me lots of times, too.
I couldn't verify what really caused the behaviour but I feel it is about not saving the workspace.
I think tags are not saved within the souce file but in some other file (maybe the workspace).
When I move my project among computers, I used to move only the updated source files not the whole project directory.
In that case, the old workspace together with the new source file shows incorrect tag positions.
Since I felt this behaviour, I started to move the project as a whole and I think I havent encountered it since then.
I am using vague terms because I never stopped to investigate the real reason behind.
Can you verify my findings with your case?
07-01-2011 12:41 AM
Hi,
Thanks for your reply. You are right, this is one of the things that one never has time to investigate more closely...
Trying to localize the problem: no, I did not move my project around recently, it happened when I was using it on the same computer for some time. However, I was loading other projects in between, both my own and sample projects from NI. I suppose it is related to loading other projects, i.e.. clicking on *.prj instead of *.cws, but since I keep forgetting the subtle differences between project and workspace I wouldn't retell this hypothesis...
But even then, reloading my original workspace should have restored the tag positions, no? Maybe a question for NI: does it make a difference if I click on project.prj or project.cws?
(there is a some long documentation in CVI help of what is saved where but it is too long to remember...)
07-01-2011 01:07 AM
What I could possibly add: In the affected project I have tags both in the include file and in the source file - only the tags in the source files have moved. Morover, this shift in position is not necessarily constant: while on average it is two lines, it may be one or three lines, too (more to the beginning or the end of the file)
07-01-2011 11:25 AM
Wolfgang,
To answer your question, when you try open a .prj file, CVI creates a .cws file with the same name that includes the project that you tried to open and then opens the .cws file. If there was already a .cws file with the same name, CVI simply opens it instead.
Source code tags are saved in the workspace (.cws) file.
Normally, the workspace is saved automatically, as soon as something changes. But you can disable this by toggling File>>Auto Save Workspace. You would still be prompted to save the workspace when you unloaded it, but if you choose not to save it, the tag information would not be updated.
Also, if you ever edit the source file outside of CVI, or even in CVI but when a different workspace is loaded, then the tags in your original workspace will be out of sync with the new file contents.
These are just guesses. It's hard to know for sure unless we can reproduce this in a controlled environment.
Luis
07-01-2011 11:36 AM
Thanks, Luis!
Also, if you ever edit the source file outside of CVI, or even in CVI but when a different workspace is loaded, then the tags in your original workspace will be out of sync with the new file contents.
This guess looks like the most probable of your suggestions. If I find out more (hopefully not as hopefully all the tags will remain in place) I'll update this thread.
Wolfgang
10-30-2011 03:15 AM
Hello Luis,
it appears that your second guess was correct - using two different workspaces (one at home and one at work) and only transferring the source file.