|LabVIEW 2015 FPGA Module Help|
|LabVIEW 2016 FPGA Module Help|
|LabVIEW 2017 FPGA Module Help|
|LabVIEW 2018 FPGA Module Help|
|LabVIEW 2019 FPGA Module Help|
If you use programmatic front panel communication to transfer coherent sets of FPGA I/O data to an RT host VI, you must create block diagram code that synchronizes the FPGA VI with the host VI. If the FPGA target supports the NI Scan Engine, you can use the NI Scan Engine to synchronize this data transfer. You then can use user-defined I/O variables to transfer data between the FPGA VI and the RT host VI.
|Note An I/O variable is a type of shared variable that uses the NI Scan Engine for single-point access to I/O data. Refer to the specific FPGA target hardware documentation for information about support for the NI Scan Engine.|
Using the NI Scan Engine reduces the amount of code you have to create to access and transfer coherent sets of data between FPGA I/O channels and the RT host VI. With user-defined I/O variables, you can process data on the FPGA target before sending that data to the RT host VI and after sending that data back to the FPGA VI. For example, you can create an application that executes the following steps:
Steps 2 and 3 involve user-defined I/O variables to transfer data between the FPGA VI and RT VI.
(CompactRIO) Refer to the User-Defined IO Variable - Basic.lvproj in the labview\examples\CompactRIO\NI Scan Engine\Getting Started\User-Defined IO Variable - Basic\ directory for an example of using user-defined I/O variables.
Right-click the chassis item in the Project Explorer window and select New»User-Defined Variable from the shortcut menu to create a new I/O variable. Because all I/O variables are unidirectional, you must configure the direction of each user-defined I/O variable as either FPGA to Host or Host to FPGA.
I/O variables that you create this way appear in a container labeled User-defined Variables.
|Note A chassis item can include only one user-defined I/O variable container. However, a user-defined I/O variable container can contain multiple user-defined I/O variables.|
Be aware of the following caveats when creating and using user-defined I/O variables:
User-defined I/O variables rely on timing information from the NI Scan Engine. You can access this timing information by adding the Scan Clock I/O item to the block diagram of the FPGA VI. This I/O item transmits timing information, such as the number of FPGA clock cycles during which the signal is high, from the Scan Engine to the FPGA VI. Use this timing information to design an application that guarantees coherency of the data sets you transfer between the FPGA VI and the RT host VI.
Not all chassis support the Scan Clock I/O item. If you are using a chassis that does support this item, the item is located in the Project Explorer window under the Chassis I/O item for the FPGA Target. The following figure shows the location of this item.