The Communication Test sequence demonstrates data read and write operations through I2C, SPI, and serial communication using a USB-845x or USB-232 device.

This TestStand sequence uses the LabVIEW measurement libraries. By default, the test sequence is installed to the following location: C:\Users\Public\Documents\National Instruments\PCB Assembly Test Toolkit for LabVIEW\TestStand\Automation\Communication Tests

Refer to the Communications APIs Library topic for information about related examples on which the Communication APIs are based.

Required Driver Application Software

This sequence requires a supported version of the following driver application software:
  • NI-DAQmx
  • NI-845x
  • NI-Serial

Highlighted Features

  • I2C Comm Test—Demonstrates simple read and write data operations through I2C protocol communication using the USB-845x device. This example uses the Communication APIs library.
  • SPI Comm Test—Demonstrates simple read and write data operations through SPI protocol communication using the USB-845x device. This example uses the Communication APIs library.
  • Serial Comm Test—Demonstrates simple read and write data operations with a RS232 serial port through a USB connection such as the USB-232. This example uses the Communication APIs library.
  • Hardware Configuration

    The following figures illustrate the hardware connections for this example sequence.
    Figure 7. I2C Communication Test


    Figure 8. SPI Communication Test


    Figure 9. Serial Communication Test


    Refer to the documentation for your specific device for pinouts and other information necessary to adapt this example sequence to your application.

    Using the Sequence with Physical Hardware

    • Update the I2C Comm Test sequence.
      1. Update the DeviceID variable with the connected USB-845x device ID in the Update I2C Interface Device ID step.

        Copy this step and associated variables if you create a custom sequence.

      2. Review and update step settings for the I2C Read – Read Register Data and I2C Write – Write Register Data steps based on the relevant I2C specifications. These settings are used in read and write operations.
      3. Review the configurations of USB-845x I2C pins for your intended use case.
    • Update the SPI Comm Test sequence.
      1. Update the DeviceID variable with the connected USB-845x device ID in the Update SPI Interface Device ID step.

        Copy this step and associated variables if you create a custom sequence.

      2. Review and update step settings for the SPI Read – Read Register Data and SPI Write – Write Register Data steps based on the relevant SPI specifications. These settings are used in read and write operations.
      3. Review the configurations of USB-845x SPI pins for your intended use case.
    • Update the Serial Comm Test sequence.
      1. Update the Serial VISA variable with the targeted serial COM VISA address in the Update Serial VISA step.

        Copy this step and associated variables if you create a custom sequence.

      2. Review and update step settings for the Simple Serial Comm step based on the relevant serial port specifications. These settings are used in read and write operations over the serial COM port.
      3. Review the connections between the serial com ports for your intended use case.