LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add Date and time to Block Diagram for Commenting

hii guys,

Is there any shortcut  to add System Date Time to B.D   it will help a lot for commenting

  also ability to add User name or user Login  can be the cherry  on the Pie

 

regards

Akshay

0 Kudos
Message 1 of 9
(3,370 Views)

Not that I'm aware of.

 

But you can probably write a script that does that for you and make it a quick drop plugin.

0 Kudos
Message 2 of 9
(3,368 Views)

I assume that this is for revision documentation, and want to make sure that you know about the VI History managed in the VI Properties?

 

VI Properties->Category:Revision History

Can set it up to update each time you change the VI, prompt for notes, etc.

Jon D
Certified LabVIEW Developer.
0 Kudos
Message 3 of 9
(3,350 Views)

As Jon Pointed out you can add system date and time to revision history of VI along with comment by using options in here : https://zone.ni.com/reference/en-XX/help/371361L-01/lvdialog/history_options/

-It does include windows user name also.

Thanks
uday
0 Kudos
Message 4 of 9
(3,330 Views)

I really like this idea.  I don't do it all the time but I certainly do it often enought that having a function that does this for you would be nice.  I can think of two ways that this  could work today with some work.

 

First you could make a right click plugin that works on the floating text object, which could add this text for you.  So you make the comment like you normally would then could right click and choose "Add Date and User" which would append the text to the existing comment.

 

The other idea involves my favorite unofficial feature and that is the XNode.  You could create an XNode that gets invoked with quick drop (or traversing on the palette) which would drop the comment with todays date and user name.

 

I think this should be on the idea exchange, but in the mean time either of these could be a working solution.

0 Kudos
Message 5 of 9
(3,315 Views)

To each his own, I guess.  First, by default, every time you save a VI in LabVIEW, it always updates the Version number for you, as well as (by default, again) tagging the Revision History with the OS User name.  Myself, I'm very happy to not have one more "label" sitting on my Block Diagram telling me the Revision Number, Last Person to Save, and Date of Saving.

 

What, in my opinion, is far more useful is to rigorously make use of a VCS, such as Subversion, and to set it so that you cannot commit anything without writing something in the Log File (in Tortoise Subversion, you do this by setting your Subversion LogMinSize property -- I set mine to 40).  You also, of course, need to do regular Commits.

 

Within a LabVIEW Project, each of the sub-VIs will almost surely be at different "revision" levels, but the entire Project (meaning the state of all of its component VIs and Controls) will be at a single Subversion Revision Level.  What I've done is to incorporate the Subversion Revision number into the Build element of the Executable Version Number (this is a set of four numbers separated by dots -- Major.Minor.Patch.Build, or 2.1.3.4368).  I've more-or-less automated this by using a Pre-Build Action to update the Build from the Subversion Version.  Of course, I have to remember to Commit the Project before I build it, or I will be "off-by-one".

 

Now, when my executable starts, I have it automatically populate a String indicator on its Front Panel with the Program Name and the LabVIEW Version Number (including the Build).  Should there be a crash (not that my code ever crashes, you understand), having the Subversion Revision number means that I can go directly to the exact code base on any PC connect to the Subversion repository and know I'm examining the "correct" code.

 

Bob Schor

0 Kudos
Message 6 of 9
(3,276 Views)

I get what you are saying Bob and I agree with quite a bit of it.  This clearly wouldn't be a replacement for SCC, and I would personally want to leave stuff like revision information out of the comment.  But I can see value in leaving a comment like "Hoove 8/19/16 I'm not sure if this code is necessary I am disabling it" and have a disable diagram structure around code that I temporarily want to disable.  Then if another developer is opening the code and they see I put a comment and disabled their code they can clearly know who disabled it, why, and when.  Then they can choose to talk to me, or take action by re enabling the code, or refactoring.

 

Comments in SCC are important and useful.  But a comment on the BD is there to be seen and is somewhat in your face.  If I open some code and see a comment by a developer talking about my code I'm going to look into it.  Leaving a comment on the BD is quick, easy, and has context, where a SCC comment is more about higher level changes.  "I updated this to do this", "I made a build version X with feature Y", but a BD comment can ask questions, or be reminders, or be used in code reviews, or whatever.  I could see this feature being useful enough to add a right click function to add this text.

0 Kudos
Message 7 of 9
(3,256 Views)

What about the Bookmark Manager?  Doesn't that more-or-less provide (much of) the same functionality?

 

BS

0 Kudos
Message 8 of 9
(3,233 Views)

Yes if you want to manually type in #UserName #TodaysDate.  Bookmark manager just finds tags in code.  This could certainly make bookmark tags as well, which also isn't a bad idea.  But the actual creating of the text isn't done by the bookmark manager, so I don't see them as having the same functionality.

0 Kudos
Message 9 of 9
(3,222 Views)