Jump to content
Jonathan Lindsey

Check if files in Project are Saved

Recommended Posts

This thread has a solution for saving all the VIs (and other types of LV files) in a project.

Is there a way to programmatically check if there are unsaved files in a project without actually saving them? So that I could then ask someone to manually save the files.

Share this post


Link to post
Share on other sites

Sure there is. Use a property node on the VI reference and select Modifications >> VI Modifications Bitset

This is the description from the help:

Quote

Indicates whether changes were made to the block diagram since the VI was saved or opened, depending on which was last. If the value is zero, no changes were made. If the value is nonzero, changes were made.

Here is an example based on the VI from the topic you mentioned:

Find Unsaved VIs This Project (2015).png

 

  • Like 2

Share this post


Link to post
Share on other sites

Thanks! That is useful!

Unfortunately this still does not check if the Project itself or things like Controls, Classes, or Libraries need to be saved. I looked but I did not see property nodes for those files.

Edited by Jonathan Lindsey

Share this post


Link to post
Share on other sites

Controls and VIs work for me. Other items can be checked by first casting the generic project item to the desired type. Here is an example to check if the private data of a class changed. Other types can be added similarly:

Find Unsaved VIs This Project (2015).png

I searched a bit for libraries and the project file but couldn't come up with a solution. Any ideas?

Share this post


Link to post
Share on other sites

If you use the type filter on the Get All Descendants method you can get files of a particular type.  Library will find *.lvlib etc.

This should help with speed as you should not have to loop through every item, just the ones you are interested in.

As a side note i Remeber having to drop down to "My Computer" first although "Root" seems to be working for you also

Edited by CraigC

Share this post


Link to post
Share on other sites

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.


×
×
  • Create New...

Important Information

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