Open FPGA VI Reference Function

FPGA Interface Functions

Open FPGA VI Reference Function

Owning Palette: FPGA Interface Functions

Installed With: FPGA Interface

Opens a reference to the FPGA VI or bitfile and FPGA target you specify. Right-click the Open FPGA VI Reference function and select Configure Open FPGA VI Reference from the shortcut menu to display the Configure Open FPGA VI Reference dialog box.

You must open a reference to the FPGA target before you can communicate between the host VI and the FPGA VI. You can download and run only one FPGA VI at a time on a single FPGA target. If you attempt to download a second VI to the FPGA target while the first FPGA VI is still in use, the LabVIEW FPGA Module reports an error and the download fails.

Note  You can use the Open FPGA VI Reference function to interface with an FPGA bitfile even if you do not have the FPGA Module installed.

Details  

 Place on the block diagram  Find on the Functions palette
resource name specifies the FPGA target on which you want to run the FPGA VI. LabVIEW automatically might determine the FPGA target on which the FPGA VI runs based on the information in the project, depending on the FPGA target. The data type of the resource name input varies by FPGA target.
Note  You must compile the FPGA VI before the Open FPGA VI Reference function can download or run the VI on the FPGA target.
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use exception control to treat what is normally an error as no error or to treat a warning as an error. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source specifies the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.
FPGA VI Reference Out returns a reference to the FPGA VI running on the FPGA target. You can bind the FPGA VI Reference Out parameter to type definitions so that LabVIEW automatically propagates configuration changes to subsequent subVIs in the data flow.
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning.

Open FPGA VI Reference Details

Use the Open FPGA VI Reference function to do the following:

  • Select the FPGA VI or bitfile with which the host VI communicates.
  • Select the FPGA target on which the FPGA VI runs.
  • Determine whether the host VI opens and runs the FPGA VI or just opens the FPGA VI.

Place and wire a Close FPGA VI Reference function for every Open FPGA VI Reference function in a host VI. When the Open FPGA VI Reference function first executes on the block diagram, the function checks whether the compiled FPGA VI already exists on the FPGA target. If the compiled FPGA VI is not on the FPGA target, the Open FPGA VI Reference function downloads the compiled FPGA VI to the FPGA target. If you place a checkmark in the Run the FPGA VI checkbox in the Configure Open FPGA VI Reference dialog box, the FPGA VI starts running if it is not already running.

The Open FPGA VI Reference function does not affect the FPGA VI if the FPGA VI is already downloaded and running. If you want to restart the FPGA VI, you can use the Invoke Method function to abort or reset the FPGA VI and use the Invoke Method function to run the FPGA VI again.

If you want to open references to different FPGA VIs or bitfiles on one target, open only one reference at a time and close the reference before opening another. You can have more than one FPGA VI reference simultaneously open on a target, as long as all the references correspond to the same FPGA VI or bitfile on the same target.

Note  The Open FPGA VI Reference function extracts the bitstream associated with the compiled FPGA VI or bitfile and stores the bitstream when you save the host VI. The bitstream contains the programming instructions LabVIEW downloads to the FPGA target.

If you double-click an Open FPGA VI Reference function that is not yet configured for an FPGA VI, the function displays the Configure Open FPGA VI Reference dialog box. If you double-click an Open FPGA VI Reference function that is configured for an FPGA VI, the function opens the front panel of the FPGA VI.

Selecting the FPGA VI or Bitfile

To determine the VI that the Open FPGA VI Reference function opens, drag the FPGA VI from the Project Explorer window onto the Open FPGA VI Reference function. You also can right-click the Open FPGA VI Reference function, select Configure Open FPGA VI Reference from the shortcut menu, and specify an FPGA VI or bitfile.

Note  You cannot open a reference to an FPGA VI if you do not have the LabVIEW FPGA Module installed. However, you can open a reference to a bitfile.

Selecting the Open Behavior

By default for some FPGA targets, this function opens and runs the compiled FPGA VI on the FPGA target if the FPGA VI is not already running. To open a reference to the FPGA VI without running it, remove the checkmark from the Run the FPGA VI checkbox in the Configure Open FPGA VI Reference dialog box. You then can run the FPGA VI using the Invoke Method function.

Some targets do not allow you to run the FPGA VI when you open it. You can always run the FPGA VI from the host VI using the Invoke Method function.

Determining Where the FPGA VI Executes

The text underneath the icon for the Open FPGA VI Reference function indicates where the FPGA VI executes. You can change where the FPGA VI executes by right-clicking the FPGA target and selecting an option from the Execute VI on shortcut menu. You also can use the Debugging Properties page of the FPGA Target Properties dialog box to specify where the FPGA VI executes.

You can use the Open FPGA VI Reference function when the FPGA target is configured to execute on the FPGA target or the development computer with simulated I/O. If you use this function when the FPGA target is configured to execute on the development computer with real I/O, LabVIEW returns a run-time error.