Force Variable VI
- Updated2025-07-30
- 2 minute(s) read
Forces an I/O variable or I/O alias to assume forced value until you disable forcing, reboot the target, or force the variable to assume a new forced value.

Inputs/Outputs
variable path (URL)
—
variable path (URL) specifies the path to the I/O variable or I/O alias. The path can be absolute or relative. The format of the variable path is \\<TargetName>\<ModuleName>\<VariableName>. You can view the variable path for an I/O variable in the Context Help window when you hover over the I/O variable node on the block diagram.
forced value
—
forced value is the value for the I/O variable or I/O alias to assume while forcing is enabled on the target and the enable forcing input of this VI is TRUE. To ensure data integrity, you must wire a value of the same data type as the I/O variable. To verify the data type of an I/O variable, right-click the I/O variable in the Project Explorer window and select Properties to display the Shared Variable Properties dialog box.
error in (no error)
—
error in describes error conditions that occur before this node runs. This input provides standard error in functionality.
error out
—
error out contains error information. This output provides standard error out functionality. |
To perform batch forcing on a set of I/O variables, disable forcing on the target, force each I/O variable, then enable forcing on the target.
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\Scan Engine\Programmatic Forcing.lvproj
variable path (URL)
—
forced value
—
error in (no error)
—
error out
—