Jonathan Lindsey Posted April 26, 2017 Report Share Posted April 26, 2017 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. Quote Link to comment
LogMAN Posted April 26, 2017 Report Share Posted April 26, 2017 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: 2 Quote Link to comment
Jonathan Lindsey Posted April 26, 2017 Author Report Share Posted April 26, 2017 (edited) 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 April 26, 2017 by Jonathan Lindsey Quote Link to comment
LogMAN Posted April 27, 2017 Report Share Posted April 27, 2017 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: I searched a bit for libraries and the project file but couldn't come up with a solution. Any ideas? Quote Link to comment
CraigC Posted April 27, 2017 Report Share Posted April 27, 2017 (edited) 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 April 27, 2017 by CraigC Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.