Error 1000 When Changing Default Values of VI Programmatically

Updated Jan 10, 2023

Reported In

Software

  • LabVIEW Full
  • LabVIEW Base

Issue Details

I am getting the following error when trying to change the default values of my VI programmatically:

Error 1000: The VI is not in a state compatible with this operation.

What is the meaning of this error, and how can I resolve it?

Solution

If the code being used has worked previously with no changes being made, it is possible there is a corruption in your LabVIEW Development or Run-time software. Please refer to this page to repair or reinstall your software.

This error is thrown because an editing method cannot be called on a VI while the VI is running or is reserved for running. An editing method is one that can only be called in the development environment of LabVIEW, and not the run-time environment.

For example, the Make Current Values Default method is an example of an editing method, and the Reinitialize All to Default method is an example of a non-editing method. Several of the settings found in VI Server have the effect of an editing method.

To resolve this error, you must ensure that the VI is not running and is not reserved for running before trying to programmatically change its default values.

Additional Information

A VI is reserved for running when a reference to it is opened using the Open VI Reference function with a strictly typed VI reference wired to the type specifier VI Refnum input. Using the type specifier allows you to call the VI using a Call By Reference Node, which marks the VI as reserved for running. The strictly typed VI reference must be closed before editing methods may be invoked or editing properties may be set.

Opening a VI reference without the type specifier does not reserve the VI for running. Editing methods may be used in this case as long as the VI is not actually running. It is acceptable to open both a strictly typed and a weakly typed VI reference to the same VI, but the invocation of editing methods and the setting of editing properties is subject to the conditions above.