Example Code

Programmatically Password-protect all files in LLB or Folder

Code and Documents

Attachment

Overview
This example VI provides a method to set block diagram passwords for all VIs in a LLB or folder.


Description
This example VI can set block diagram passwords for all VIs in a LLB or folder, it is convenient to help you protect numerous VIs that you'd like to password-protect. You can also remove a password by setting the Lock State on the VI Invoke Node to "Not Locked", then enter the password that the VIs were originally locked with into the Password string.

In order to remove the password from VIs in a LLB or folder immediately after applying a password, you may first have to restart LabVIEW in order to remove the VIs from memory.

 


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download the attached folder to your computer
  2. Open the VI "Password Protect VIs NIVerified.vi"
  3. Browse to the file path of LLB or folder on the front panel
  4. Set the desired password on the block diagram
  5. Run the program

 

Additional Information or References
VI Snippet

 Block Diagram.PNG

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

Regards,
Austin S.

National Instruments
Academic Field Engineer

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.