Migrating NI-DNET Applications to NI-Industrial Communications for DeviceNet

Publish Date: Oct 23, 2014 | 2 Ratings | 5.00 out of 5 | Print | Submit your review

Overview

The NI-Industrial Communications (NI-IndCom) for DeviceNet 2.1 or later software adds NI-DNET 1.6.x compatible LabVIEW VIs that work with NI PCI-8532, NI PXI-8532, and NI 9882 boards. NI-IndCom for DeviceNet 2.1 or later offers better performance and long-term support benefits over legacy NI-DNET products. NI recognizes the large applications written in the older NI-DNET VI APIs and the need to maintain those applications over a long term. This article explains how to migrate NI-DNET 1.6.x applications to NI-IndCom for DeviceNet 2.1 or later.

Table of Contents

  1. Differences between NI-IndCom for DeviceNet 2.1 or Later and NI-DNET 1.6.x
  2. Migrating NI-DNET Applications to NI-IndCom for DeviceNet 2.1 or Later
  3. Importing EDS Files
  4. Further Reading

1. Differences between NI-IndCom for DeviceNet 2.1 or Later and NI-DNET 1.6.x

NI-IndCom for DeviceNet 2.1 or later adds NI-DNET compatible LabVIEW VIs that work on NI PCI-8532, NI PXI-8532, and NI 9882, while also maintaining older project based NI-IndCom for DeviceNet 2.0.x features for NI PCI-8532 and NI PXI-8532.  To achieve this compatibility still requires the steps outlined in the example to be performed.  

The table below provides which hardware was created for DNET and DeviceNet:

Driver Versions* Support Devices
NI-DNET 1.6.x PCMCIA-DNET, PCI-DNET, PXI-8461/D
NI-Industrial Communications for DeviceNet 2.1 or Later NI 9882, PCI-8532, PXI-8532

*These versions reflect the versions of the software that we can use for the purposes of this guide

Unlike NI-DNET, NI-IndCom for DeviceNet 2.1 or later does not support C based languages.  DeviceNet slave mode has been added to NI-IndCom for DeviceNet 2.2 or later.

NI-DNET Configurator is no longer available.  However the NI-DNET Analyzer abilities have been transferred to a very powerful Monitor example utility.  This utility can be found at <LabVIEW Version>\examples\NI-Industrial Communications for DeviceNet\Utilities\Monitor.

The NI-IndCom for DeviceNet 2.1 software offers a project based EDS file import to find and test connected slaves easily. Please see the section titled importing EDS files.

 

Back to Top

2. Migrating NI-DNET Applications to NI-IndCom for DeviceNet 2.1 or Later

The NI-IndCom for DeviceNet 2.1 or later API uses a LabVIEW Library (.lvlib) to include all new DeviceNet VIs. This design enables us to use the same VI names for the new API so you can install the NI-DNET and NI-IndCom for DeviceNet software side by side. Also, you can run the NI-DNET VIs and NI-IndCom for DeviceNet VIs in parallel on the same host machine or RT target. However, if you want to run NI-DNET applications on 8532 or 9882 hardware, you must replace the old NI-DNET VIs with corresponding new VIs provided by NI-IndCom for DeviceNet 2.1 or later.

National Instruments recommends conducting this migration in a LabVIEW project. Before you start make a copy of your original code and save it. If the NI-DNET application is not in a LabVIEW project yet, create a new LabVIEW project and add the copy of your original application Main VI into this project. Save the project. Make sure only the project window is opened and all VIs are closed. Then open the project Dependencies and right-click the vi.lib folder and choose Arrange By » Path. In your project window, if you right-click the project name and choose View » Full Path, the window will show the path of every dependency. Now go ahead and replace every NI-DNET VI and every custom Control (.ctl) in Dependencies » vi.lib tree with the corresponding new VI and control in folder <vi.lib>\DeviceNet\VIAPI.

When NI-DNET VI’s or Ctl’s listed in the table below are shown in the Dependencies » vi.lib tree, replace those VIs with the corresponding NI-IndCom for DeviceNet VIs.  An example of this is provided below this list:

  • DnetIntfConfig.ctl
  • DnetIOConfig.ctl
  • xobjhandle.ctl
  • Close Object.vi
  • Convert For DeviceNet Write.vi
  • Convert From DeviceNet Read.vi
  • Easy IO Close.vi
  • Easy IO Config.vi
  • Get DeviceNet Attribute.vi
  • Get Driver Attribute.vi
  • Open DeviceNet Explicit Messaging.vi
  • Open DeviceNet Interface.vi
  • Open DeviceNet IO.vi
  • Operate DeviceNet Interface.vi
  • Read DeviceNet Explicit Message.vi
  • Read DeviceNet IO.vi
  • Set DeviceNet Attribute.vi
  • Set Driver Attribute.vi
  • Wait For State.vi
  • Write DeviceNet Explicit Message.vi
  • Write DeviceNet IO.vi

 

Easy IO Config Example

  1. In the LabVIEW project, right click Easy IO Config.vi and select Replace with from the shortcut menu.  The replace dialog is only active if the Main VI is closed.

  1. In the Select VI to Replace dialog box, browse to folder  <vi.lib>\DeviceNet\VIAPI, choose Easy IO Config.vi and click OK. Custom controls are in <vi.lib>\DeviceNet\VIAPI\subVIs.  Typically <vi.lib> can be found here: <Program Files>\National Instruments\<LabVIEW Version>\vi.lib

  1. Click Save for all the changes.

  1. Repeat above three steps to all other NI-DNET VIs shown in Dependencies » vi.lib tree.

 

Back to Top

3. Importing EDS Files

There are several examples included with NI-Industrial Communications for DeviceNet.  In Example Finder, you can go to Hardware Input and Output » NI-Industrial Communications » Legacy Examples.  Here you can find examples on how to use an imported EDS file in your project.  You can only import EDS files for use with the PCI/PXI-8532.  

 

Add a DeviceNet Master to a LabVIEW Project

  1. Open LabVIEW and create a new project.  Add any Real-Time targets to the project.
  2. Right-click on My Computer or the Real-Time target, select New » Target(s) and Device(s).
  3. Select Discover Existing Devices.  Expand DeviceNet Master Interface.
  4. The master should automatically discovered.  Click on the target, and then OK.
  5. Configure the Master settings.  Then click OK.

 

Add a DeviceNet Slave Device to a LabVIEW Project

  1. Right-click on the master device in the project.  Select New » Targets and Devices.
  2. In the dialog box, expand DeviceNet Slave Device and find your DeviceNet Slaves.  Click OK.
  3. The Slave settings dialog box will appear.  Configure your slave and select your EDS file.  Click OK.

 

Load an EDS File for the Slave Device

  1. If you have not loaded an EDS file using the Slave settings dialog box, or if you need to change your EDS file, then you may do so.  Right-click on the Slave Device, select datasheet.
  2. Click Add Files.
  3. Locate your EDS file.  Click OK.
  4. Select your EDS file from the list of imported EDS files.  Click OK.

 

Verify the EDS File Imported Correctly

  1. Right-click on the Slave Device » Utilities » Online Test Panel
  2. Select Device State in the left-hand panel, then the Device in the right-hand panel.
  3. Click Verify Device.
  4. Ensure no errors or warnings have occurred.

 

Back to Top

4. Further Reading

KnowledgeBase 6JHCG3EG: Why Can’t I Install NI-DNET 1.6.x Support for LabVIEW 2013 and Above?

Drivers and Updates: NI-Industrial Communications for DeviceNet Driver Support

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit