Lock State:Set
- Updated2025-07-30
- 2 minute(s) read
Sets the lock state of a VI. If interactive is FALSE (default), you can use password to either unlock a password-protected VI or set the password of an unprotected VI. If interactive is TRUE, LabVIEW ignores password and displays a dialog box that prompts you to change the lock state.
This method is similar to the Unlocked (no password), Locked (no password), and Password-protected options on the Protection page of the VI Properties dialog box.
Parameters
| Name | Data type | Required | Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Lock State | ![]() |
Yes | Specifies the level of editing permission of the VI.
|
||||||||
| Interactive | ![]() |
No | Specifies whether to display a dialog box that prompts you to change the lock state. The default is FALSE. |
||||||||
| Password | ![]() |
No | If lock state is Password-protected, password is the new password. If you are changing lock state from Password-protected, password is the old password. The default is an empty string. |
||||||||
| Put in Cache | ![]() |
No | If Lock State is Password-protected, Put in Cache specifies whether to place the new password in the cache. The default is FALSE. |
Remarks
The following table lists the characteristics of this method.
| Short Name | Lock State.Set |
| Data type | No return value |
| Available in Run-Time Engine | No |
| Available in Real-Time Operating System | No |
| Settable when the VI is running | Yes |
| Loads the front panel into memory | No |
| Need to authenticate before use | No |
| Loads the block diagram into memory | No |
| Remote access allowed | Yes |
| Must wait until user interface is idle | Yes |
| Available with control VIs | Yes |
| Available with global VIs | Yes |
| Available with strict type definitions | No |
| Available with polymorphic VIs | Yes |


