Setting Up the CompactRIO PROFIBUS Module

Updated Jun 13, 2023

Environment

Hardware

  • C Series PROFIBUS Interface Module

Software

  • LabVIEW Real-Time Module
  • LabVIEW FPGA Module

Driver

  • NI CompactRIO

This tutorial provides step-by-step instructions to help you set up the CompactRIO PROFIBUS module as a PROFIBUS DP master and slave.

Note: These items are no longer available for purchase through NI.

Required Hardware and Software

  • CompactRIO PROFIBUS DP module (master/slave or slave version)
  • NI CompactRIO or NI Single-Board RIO system
  • NI LabVIEW Real-Time Module and LabVIEW FPGA Module 8.5 or later
  • NI-RIO 3.1.0 or later
Figure 1. Use the PROFIBUS DP module for connectivity with LabVIEW and NI programmable automation controllers (PACs).
 

Installation

  1. Insert the PROFIBUS DP module into slot 1 of the chassis. When using a CompactRIO system, slot 2 must remain empty for optimal heat dissipation.
  2. Insert the COMSOFT driver CD into the host computer and install the software.
  3. Launch the NI Measurement & Automation Explorer (MAX) utility from Start»Programs»National Instruments»Measurement & Automation. Follow hardware and software installation instructions at the beginning of the Getting Started with CompactRIO and LabVIEW tutorial.
  4. In the left-hand Configuration panel tree, expand the Software item and click on NI-VISA. In the right-hand window, select the VISA Options tab. Expand the VISA Server item in the tree and select Security. If the wildcard “*” is not in the Remote Access List, click Add or <Click here to add new permission>. Type in the wildcard “*” to allow VISA access to all remote systems or type in the CompactRIO controller’s specific IP address. When you are finished click Save to save your changes.


Figure 2. Allow VISA access for the PROFIBUS DP driver to program the CompactRIO system.
 
  1. While still on the VISA Options tab, expand the General Settings item in the tree and select Remote. To access the CompactRIO system with the PROFIBUS Configurator, check the box next to the IP address of your controller. If the remote address is not listed, click the Create New System button to enter it manually.

Figure 3. Allow the PROFIBUS Configurator to remotely access the system.
 

PROFIBUS Configuration

PROFIBUS DP Master Configuration

  1. Launch the PROFIBUS Configurator from Start»Programs»Comsoft GmbH»Profibus Configurator»Configurator II. The Configurator allows you to create the complete PROFIBUS network configuration, which is then downloaded to the PROFIBUS DP master.
  2. Create a new project by selecting Project»New from the menu bar. In the left-hand tree, expand Profibus Master. To add a CompactRIO PROFIBUS DP module as a master, click and drag cRIO PB into the blank configuration project on the right. Double-click on the master icon to configure the master address, baud rate, profile, and other properties.

Figure 4. Add a CompactRIO module as a PROFIBUS DP master.
 
  1. Select Online»Driver Selection from the menu bar to view the CompactRIO PROFIBUS DP module installed in slot 1. If nothing is displayed, click the VISA-Config button to rescan for the available PROFIBUS module. Select the module and click the OK button.

Figure 5. Select the CompactRIO master module in slot 1.
 

PROFIBUS DP Slave Configuration

  1. To add a CompactRIO PROFIBUS DP module as a slave node, expand the left-hand tree to PROFIBUS DP»General»COMSOFT GmbH. Click and drag cRIO PB DP Slave to the master icon in the configuration project on the right. Double-click on the slave icon to configure the slave address and other properties.

    Note: To add a third-party slave, select Tools»Install new GS*-file to upload the slave’s configuration file first. Locate the slave in the left-hand tree and drag it into the configuration project.

  2. Expand cRIO PB DP Slave from the left-hand tree to select the slave’s memory configuration. (The CompactRIO PROFIBUS DP module offers memory configurations from 4 byte input/4 byte output up to 240 byte input/240 byte output.) Select the slave icon, and then click and drag the appropriate memory configuration to slot 0 in the configuration project on the lower right.

Figure 6. Select the slave module’s memory configuration.
 

Configuration Download

  1. After all the PROFIBUS slaves have been added to the configuration project, select Online»Download configuration from the menu bar. This step downloads the network configuration to the master.
 

LabVIEW Examples

  1. Launch a PROFIBUS example in LabVIEW from Start»Programs»Comsoft GmbH»cRIO PB»Examples. This tutorial follows the steps for opening the master example called cRIO PB DP Master.

Figure 7. Open the CompactRIO PROFIBUS LabVIEW project example.
 
  1. Select File»New Project to open a second LabVIEW project. In the new window, right-click on Project and select New»Targets and Devices.
  2. In the Add Targets and Devices dialog window, select Existing target or device. In this tutorial, you will be adding a CompactRIO controller, so expand the category Real-Time CompactRIO, select the appropriate controller, and click OK.
  3. When the Select Programming Mode window appears, select the LabVIEW FPGA Interface radio button and click Continue.

Figure 8. Program the CompactRIO system in LabVIEW FPGA.
 
  1. Once the CompactRIO controller has been added to the second LabVIEW project, select the following items from the LabVIEW project of the PROFIBUS example:
    Click and drag these items under the FPGA Target in the other, new LabVIEW project.
    1. CS_PBM-Slot1
    2. CS_PBM-Slot1 (Slot 1, CS_cRIO-PBM)
    3. CS_PB-Memory
    4. CS_cRIO_PB_FPGA_DP-MasterExample.vi or CS_cRIO_PB_FPGA_DP-MasterProcessDataExample.vi

Figure 9. Copy the PROFIBUS project items into a new LabVIEW project.
 
  1. Close the LabVIEW project of the PROFIBUS example. Double-click and open the FPGA VI (CS_cRIO_PB_FPGA_DP-MasterExample.vi or CS_cRIO_PB_FPGA_DP-MasterProcessDataExample.vi) in the new LabVIEW project to edit the program.

Figure 10. Use the PROFIBUS LabVIEW example as a template for your program.