Upgrading the NI-5640R Driver
- 更新时间2025-09-11
- 阅读时长4分钟
The NI-5640R 1.6 and later instrument driver makes use of some features new to LabVIEW FPGA 2010. The most prominent feature is the adoption of the FPGA Dynamic Host Interface. The FPGA Dynamic Host Interface offers two advantages over the traditional FPGA Host Interface.
First, only the Open FPGA VI Reference function stores the location of your bitfile. This feature makes subVIs easier to reuse without rebinding FPGA interface controls and indicators to a type definition every time their location changes.
Second, the FPGA Dynamic Host Interface allows you to create interface definitions for your subVIs. You can subsequently use these interface definitions to create reusable single-source subVIs with specific control, indicator, FIFO, and memory requirements.
If the LabVIEW FPGA Dynamic Host Interface that connects to your subVI contains the resources defined for your subVI, they are accessible to your subVI.
Considerations for Upgrading Projects Saved in LabVIEW 2009 and Earlier
This section provides information about upgrade and compatibility issues specific to upgrading from LabVIEW 2009 and earlier to LabVIEW 2010 or later.
If you are using only the NI-5640R instrument driver, you cannot use the FPGA Dynamic Host Interface wire unless you are using LabVIEW 2011.
Upgrading the NI-5640R Instrument Driver Code from LabVIEW 2010 or Earlier to LabVIEW 2011
The NI-5640R instrument driver was converted to the LabVIEW FPGA Dynamic Host Interface starting with LabVIEW 2011. Most users do not need to take any action to upgrade their code, other than opening it in LabVIEW 2011.
If you are using configuration template VIs that are not part of the instrument driver public API (not a recommended practice), you may have to replace your existing VIs with versions from the locations shown in the following table.
| Version of Windows | Configuration Template VI Location |
|---|---|
| Windows 32-bit | C:\Program Files\National Instruments\<LabVIEW>\instr.lib\ni5640R\Configuration |
| Windows 64-bit | C:\Program Files (x86)\National Instruments\<LabVIEW>\instr.lib\ni5640R\Configuration |
If you are accessing the FPGA using LabVIEW FPGA Host I/O or method nodes outside the instrument driver public API (not a recommended practice), you may have to replace your FPGA reference controls and indicators with the Dynamic Host Interface version. You can create a control or indicator from the top-level Open FPGA VI Reference function and paste the control or indicator onto the subVI. You can also drop a blank FPGA Interface Dynamic Refnum from the Functions»FPGA Interface palette and configure the refnum yourself.
Using LabVIEW FPGA without the Configuration Template (ni5640R Template.lvlib)
- Open your project in LabVIEW 2010 or later.
- Open your host VI in LabVIEW 2010 or later.
- Right-click the Open FPGA VI Reference function and select Configure Open FPGA VI Reference.
- From the Configure Open FPGA VI Reference dialog box, select Dynamic mode. If any subVIs in your project have traditional FPGA Host Interface wire controls and indicators, replace the controls and indicators with FPGA Dynamic Host Interface wire controls and indicators. You need to make only one replacement or reconfiguration in one location if the replaced controls and indicators share a type definition.
Using the LabVIEW FPGA With the Configuration Template (ni5640R Template.lvlib)
- Verify that LabVIEW is closed and not running.
- Launch Windows Explorer and navigate to the folder of the project to convert it to LabVIEW 2010 or later.
- Right-click the project folder and select Copy, and make a copy of the entire project folder in another location.
- Open the original .lvproj file of the project in LabVIEW 2010 or later.
- Open the host VI that contains the Open FPGA VI Reference function.
- Right-click the Open FPGA VI Reference function and select Configure Open FPGA VI Reference.
- Disable Bind FPGA host reference to type definition.
- Enable Dynamic mode.
- Click OK.
- Save the host VI.
- Save and close the project. Note It is not necessary to save the ni5640R Template.lvlib files if prompted.
- Delete ni5640R Template.lvlib from your project folder.
- If you added some of your own VIs to the NI-5640R VIs folder, move them to another location.
- Delete the NI-5640R VIs folder from the original location.
- Reopen the original .lvproj file of the project in LabVIEW 2010 or later.
- Reopen the host VI that contains the Open FPGA VI Reference function. LabVIEW automatically searches for and maps all ni5640R Template.lvlib files to the new dynamic copies in <LabVIEW>\instr.lib\ni5640\Configuration.
- A dialog box appears confirming that the VIs have been loaded from the new paths.
- On the block diagram, investigate and fix any broken wires.
- Any host sub VIs that are not a part of ni5640R Template.lvlib and contain FPGA Host Interface control and indicators must be updated with FPGA Dynamic Host Interface controls and indicators. You can create a control or indicator from the top-level Open FPGA VI Reference function and paste the control or indicator onto the subVI. You can also drop a blank FPGA Interface Dynamic Refnum from the Functions»FPGA Interface palette and configure the refnum yourself.
| Version of Windows | Configuration Template VI Location |
|---|---|
| Windows 32-bit | C:\Program Files\National Instruments\<LabVIEW>\instr.lib\ni5640R\Configuration |
| Windows 64-bit | C:\Program Files (x86)\National Instruments\<LabVIEW>\instr.lib\ni5640R\Configuration |
Implementing Bug Fixes Only
To take advantage of bug fixes implemented in more recent versions of LabVIEW without switching to the FPGA Dynamic Host Interface wire, a version of ni5640R Template.lvlib is available at <LabVIEW>\Examples\instr\ni5640R\FPGA\Traditional Configuration.