Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
2 ratings:
 2 out of 5     Rate this Document

Using Scan Engine and FPGA Simultaneously on a CompactRIO

Primary Software: LabVIEW Modules>>FPGA Module
Primary Software Version: 8.6
Primary Software Fixed Version: N/A
Secondary Software: Driver Software>>NI-RIO, LabVIEW Modules>>Real-Time Module
Hardware: CompactRIO

Problem:
I want to use some of my cRIO modules in Scan Mode and some in FPGA Mode.  There is no explicit option to do this in the chassis properties.  How can I do this?

Solution:
Using the Scan Engine and FPGA at the same time on a target is known as hybrid mode.
There are a few things to consider before starting to program in hybrid mode. First, the compile time will significantly increase because the compiler has to combine the default RIO Scan Interface bitfile as well as the FPGA code that was created into one bitfile. Secondly, the number of DMA FIFO's that can be used in the FPGA code will be reduced, since the scan engine uses two DMA FIFO's. Most FPGAs have 3 DMA FIFO's, so there will only be one DMA channel left to use in the FPGA code.

The following steps can be followed to set up your device in Hybrid Mode:
  1. First, create a new project and add your cRIO target, chassis, and modules.  Then, set the chassis properties to use the Scan Interface.  For details on how to do this see Product Manuals: Getting Started with CompactRIO and LabVIEW.
  2. Add an FPGA target to your chassis by right-clicking the chassis and selecting New»FPGA Target
  3. If you see the following message box and you are connected to your hardware, choose Deploy Now. Otherwise, choose Deploy Later. Note that you must deploy to the chassis at some point before operating the project on the target as described below.

    Adding an FPGA target to the chassis puts the chassis in LabVIEW FPGA Interface mode.  This change will take effect when you deploy settings to the chassis.  Do you want to deploy chassis settings now?

  4. Drag and drop any modules that you want from underneath the chassis to the FPGA target.  The module I/O pins will now appear under the FPGA target, in a folder with the name of the module, and disappear from the Chassis. 
  5. Right-click on the chassis in the project and click deploy.
  6. Now, you can create a VI under the FPGA target and use the module pins.  Any modules that remain under the chassis will remain in Scan Mode.


The final project should look like the project pictured below.  Mod1 is a module in Scan Mode and Mod2 is a module in FPGA Mode:

Project Explorer

Note: As mentioned in Step 3, the chassis must be in FPGA Interface mode before operating it. To do so (if Deploy Later was selected), simply right click on the chassis in the project and select Deploy. If the chassis isn't in FPGA Interface Mode before running the application, you will get an error message similar to the following:

error code -61141
"your VI name here.vi
FPGA activities:

Reference open through FPGA interface.
Reserved outside LabVIEW FPGA: The RIO Scan Interface is running. You must set the chassis to FPGA Interface mode in order to unlock the FPGA."



Related Links:
Product Manuals: Getting Started with CompactRIO and LabVIEW
Knowledgebase 4Q1DQ7BZ: What are the requirements to use CompactRIO Scan Mode?
Knowledgebase 406BAE4H: Why Does It Take So Long to Compile an FPGA VI for a cRIO in Hybrid Mode?
Developer Zone Tutorial: Using NI CompactRIO Scan Mode with NI LabVIEW Software

 



Attachments:





Report Date: 05/28/2009
Last Updated: 09/17/2009
Document ID: 4XRBMIUV

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit