Il contenuto non è disponibile nella lingua selezionata.

Verrà mostrato il contenuto in un'altra delle lingue disponibili. Il tuo browser potrebbe avere delle funzionalità di traduzione.

Discover, Configure, and Communicate with NI 987x Modules in Scan Mode

Updated Oct 23, 2023

Environment

Hardware

  • NI-9870
  • NI-9871

Software

  • LabVIEW Base

Driver

  • NI-Serial
  • NI CompactRIO
  • NI-RIO

The NI Serial interface devices lets you communicate with a wide variety of serial devices. This article will go through the setup process of these modules when used with a CompactRIO and the Scan Engine in LabVIEW Real-Time Module. 

You will need to have LabVIEW with the Real-Time Module installed on your system alongside the NI CompactRIO drivers to complete these steps. 

Install NI-Serial 9870 And 9871 Scan Engine Support On Your Real-Time Controller

  1. Open NI Measurement & Automation Explorer (MAX).
  2. Locate your Real-Time Target by expanding the Remote Systems tab. 
  3. Right-click the Software tab, and select Add/Remove Software.
  4. Choose Custom Software Installation and click Next.
  5. In the Custom software installation window, select the NI-Serial 9870 and 9871 Scan Engine Support.
  1. Click Next to start the installation.
  2. Next we will need create a LabVIEW project.

 

Adding Modules To Your LabVIEW Project

  1. Launch LabVIEW.
  2. Create a New Project by selecting File>>Create Project.
  3. Select Blank Project.
  4. Add your CompactRIO to the project by right clicking on the Project and selecting New>>Target and Devices.
  1. Select Scan Mode as programming mode for the controller and discover the modules. 
  2. Right-click on your controller in the Project Explorer window and select Deploy All.
 

Now the ports of the NI 987x will appear in Measurement & Automation Explorer underneath the RIO target corresponding to your CompactRIO chassis, as shown below.


Once your ports are detected properly in MAX, they need to be configured to match the settings of the device you are communicating with. Configure the baud rate, parity, and flow control to ensure proper data communication. 

In LabVIEW, you can place a VISA Configure Serial Port VI or a VISA Property Node to configure the settings of your individual ports.

If the ports have been configured, you can open a VISA session for those ports and write to/read from them to communicate with your serial instrument.