Link Search Menu Expand Document (external link)

PXIe-148X Getting Started Example - Basic Acquisition Tutorial

This tutorial will teach you the steps needed to configure an acquisition using a PXIe-148X module with a Leopard Imaging IMX490 camera and familiarize you with the basic functionality provided by the Acquisition Getting Started Example.

Note: This document references the example included with the NI-FlexRIO 23Q1 driver. Examples included in newer releases of the driver should be applicable.

Table of contents

  1. Prerequisites
  2. Initial Hardware Setup
  3. Initial Software Setup
  4. Performing a Simple Continuous Acquisition
  5. Performing a Finite Acquisition with Data Logging
  6. Reviewing Previously Logged Data
  7. Related Documents

Prerequisites

Review and complete all setup from the appropriate getting started guide:

Basic knowledge of LabVIEW and LabVIEW FPGA concepts.

A supported PXIe-148X interface module and camera on a PXI system running Windows. The table below lists all supported interface modules and supported cameras that have configuration scripts provided with the getting started example. For modules and cameras not listed in the table below, configuration scripts need to be provided separately.

Interface Module Camera
PXIe-1486 (8 In - 954 Deserializer) LI-IMX490-FPDLINKIII
PXIe-1486 (4 In 4 Out - 953/954 SerDes) LI-IMX490-FPDLINKIII
PXIe-1487 (8 In - 9296A Deserializer) LI-IMX490-GMSL2
PXIe-1487 (4 In 4 Out - 9295A/9296A SerDes) LI-IMX490-GMSL2

Initial Hardware Setup

  1. First complete installation of hardware as described in the Getting Started Guide linked above.
  2. Connect the camera to serial input channel 0 (SI0) on the interface module with a FAKRA cable

Initial Software Setup

  1. First complete installation of software specified in the Getting Started Guide linked above.
  2. Use the NI Example Finder to create a default project for your specific interface module.
    • Open LabVIEW and click Help -> Find Examples…

    Open NI Example Finder

    • In the NI Example Finder dialog, double-click Hardware Input and Output -> FlexRIO -> Integrated IO -> Getting Started -> Getting Started FlexRIO Integrated IO.vi NI Example Finder
    • In the FlexRIO with Integrated IO Project Creator dialog set the Project Name to PXIe-148X Tutorial and make the FlexRIO Integrated IO selection for the desired PXIe-148X interface module then click OK. FlexRIO with Integrated IO Project Creator
  3. Double click the Acquisition Example VI in the LabVIEW project.

    Open Acquisition Example VI

    The opened front panel of the Getting Started Example is similar to the figure below.

    Acquisition GSE Front Panel

Performing a Simple Continuous Acquisition

Note: For the purposes of this tutorial, all input control values not specified should be left as the default value.

  1. Select the Resource tab and make the following modifications.
    • Select the RIO Device from the dropdown menu that corresponds to your interface module.
    • Set the Bitfile Path to the bitfile that corresponds to your interface module. The default shipping bitfile is in the ‘FPGA Bitfiles’ subfolder located in the project folder (created at the Project Root location specified in Project Creator):
    Interface Module Bitfile
    PXIe-1486 (8 In) FPGA Bitfiles\PXIe_1486_8_In.lvbitx
    PXIe-1486 (4 In 4 Out) FPGA Bitfiles\PXIe_1486_4_In_4_Out_Acq_Tap.lvbitx
    PXIe-1487 (8 In) FPGA Bitfiles\PXIe_1487_8_In.lvbitx
    PXIe-1487 (4 In 4 Out) FPGA Bitfiles\PXIe_1487_4_In_4_Out_Acq_Tap.lvbitx
    PXIe-1488 (8 In) FPGA Bitfiles\PXIe_1488_8_In.lvbitx
    PXIe-1488 (4 In 4 Out) FPGA Bitfiles\PXIe_1488_4_In_4_Out_Acq_Tap.lvbitx
    PXIe-1489 (4 In) FPGA Bitfiles\PXIe_1489_4_In.lvbitx
    PXIe-1489 (2 In 2 Out) FPGA Bitfiles\PXIe_1489_2_In_2_Out_Acq_Tap.lvbitx

    The values on the Resource tab of Configuration Settings are now similar to the figure below.

    Configuration Settings Resource Tab

  2. Select the Serial Channel tab and make the following modifications.
    • Select the Configuration Script that corresponds to your interface module. The scripts are used to configure the deserializer on the interface module as well as the serializer and image sensor on the camera. The configuration scripts provided with the getting started example are in the project folder under the subfolder ‘Host\Scripts’ and listed in the table below. Configuration scripts not listed in the table below need to be provided separately.

      Interface Module Configuration Script
      PXIe-1486 (8 In) Host\Scripts\DS90UB954\Acq\LI\IMX490_2880x1280_RAW12.py
      PXIe-1486 (4 In 4 Out) Host\Scripts\DS90UB954\Acq\LI\IMX490_2880x1280_RAW12.py
      PXIe-1487 (8 In) Host\Scripts\MAX9296A\Acq\LI\IMX490_2880x1280_RAW12_ID1_A.cpp
      PXIe-1487 (4 In 4 Out) Host\Scripts\MAX9296A\Acq\LI\IMX490_2880x1280_RAW12_ID1_A.cpp

    The values on the Serial Channel tab of Configuration Settings are now similar to the figure below.

    Configuration Settings Serial Channel Tab

  3. Select the Board tab and make the following modifications.
    • In the Power Over Coax Source drop down menu, select Internal to power the attached camera from the interface module’s internal 12V supply.

    The values on the Board tab of Configuration Settings are now similar to the figure below.

    Configuration Settings Board Tab

  4. Run the VI to start a continuous acquisition. Images captured from the camera display automatically in the First Display Channel tab.
  5. While the VI is running, use the displayed image to focus the camera.

    First Display Channel Tab

  6. (Optional) Update the Red Gain, Green Gain, and Blue Gain display parameters on the Serial Channel tab -> Channel Configurations control to better match the acquired image to the actual color of the object.

    Channel Configurations Control

    Note: Changes made to the RAW Display Parameters will take effect while the VI is running.

  7. Click the Stop Acquisition button to stop the acquisition and stop the VI.

Performing a Finite Acquisition with Data Logging

Note: The Finite Acquisition with Data Logging tutorial assumes that all input parameters are still configured as specified in the Simple Continuous Acquisition tutorial.

  1. Select the Resource tab and make the following modifications.
    • Enable Log Packets to Disk.
    • Enable Log I2C to Disk.
    • Enable Log GPIO to Disk.

    Note: During the first run of the VI in the Simple Continuous Acquisition tutorial, the TDMS File Directory control was automatically populated with a value pointing to a subfolder ("TDMS Files"). This subfolder was automatically created within the project folder to store any generated TDMS files.

    The values on the Resource tab of Configuration Settings are now similar to the figure below.

    Configuration Settings Resource Tab Log to Disk

  2. Select the Acquisition tab and disable Continuous Acquisition.

    The values on the Acquisition tab of Configuration Settings are now similar to the figure below.

    Configuration Settings Acquisition Tab Finite

  3. Select the I2C tab and add User24 to the timestamp filter array to enable I2C timestamp logging on the SI0 channel.

    The values on the I2C tab of Configuration Settings are now similar to the figure below.

    Configuration Settings I2C Tab with User24

  4. Select the GPIO tab and make the following modifications.
    • Add a GPIO line to the GPIO to Display array with the GPIO Bank value set to Des0 GPIO and the GPIO Number set to 0. Setting these values enables display of GPIO traffic for the GPIO 0 line on the SI0 channel connected to the camera.

    The values on the GPIO tab of Configuration Settings are now similar to the figure below.

    Configuration Settings GPIO Tab with Des0 GPIO0

  5. Run the VI to start the acquisition and wait for the acquisition to complete. The default acquisition duration of 1 second is run and results are displayed on the various tabs in the Data Output indicator.

    Packet Data is displayed in the First Serial Channel Packets tab.

    • The Bytes Acquired (1st Channel) indicator updates as the acquisition is occurring.
    • The Packets Logged (1st Channel) indicator updates after acquisition completes. See PXIe-148X Acquisition GSE Help for Acquired Packets (1st Channel) column details.

    First Serial Channel Packets Tab

    I2C timestamp data is displayed in the I2C Timestamps tab.

    I2C Timestamps Tab

  6. GPIO timestamp data is plotted in the GPIO Timestamps tab.

    GPIO Timestamps

    Note: The camera does not toggle GPIOs by default. The change shown in the figure above reflects GPIO level reset when the example VI is first run.

Reviewing Previously Logged Data

Note: The Reviewing Previously Logged Data tutorial assumes that the previous tutorials in this document were completed first.

TDMS files containing acquired data from the camera were saved to the "TDMS Files" subfolder in the previous tutorial. The GPIO timestamps, user timestamps, and data acquired from the camera are stored in individual TDMS files. You can use the file viewer utility to review the acquired packet data.

TDMS Files

  1. Double click the TDMS File Viewer VI in the LabVIEW project.

    Open TDMS File Viewer VI

    The opened front panel of the File Viewer will be similar to the figure below.

    TDMS File Viewer VI Front Panel

  2. Select the correct location for the TDMS File Directory control. By default, TDMS files in the previous tutorial were saved to <yourprojectdir>\Host\Acq\TDMS Files.

    Note: The directory browse window will not show the TDMS files located in the “TDMS Files” directory.

  3. Run the VI to load the TDMS file and view the packet data.

    TDMS File Viewer VI Front Panel With Data

    Note: The Update TDMS File Packet Offset Data control is enabled by default. Enabling this option results in re-saving a TDMS file with additional packet indexing information the first time the TDMS file is loaded. This indexing information can reduce the future load time of the file, particularly when reading only a subset of the packet data.

  4. (Optional) Update the Packet Display Start Index and Packets to Display controls to review a specific packet range of interest from the TDMS file and rerun the VI.

    Using an LI-IMX490-GMSL2 camera with a vertical resolution of 1280, each frame contains a Frame Start packet followed by 1280 RAW 12 packets and a Frame End packet. To display 10 frames of data starting at the second frame, set Packet Display Start Index to 1282 and Packets to Display to 12820.

    Note: Setting Packets to Display to -1 displays packets from Packet Display Start Index to the end of the file.