NI Tutorial 14074 en

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Document Type: Tutorial NI Supported: Yes Publish Date: Jun 11, 2012

Migrating NI-DNET 1.6.x Applications to NI-Industrial Communications for DeviceNet 2.1


Overview The NI-IndCom for DeviceNet 2.1 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 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. The NI-IndCom for DeviceNet 2.1 API uses a LabVIEW Library (.lvlib) to include all new DeviceNet VILib 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/9882 hardware, you must replace the old NI-DNET VIs with corresponding new VIs provided by NI-IndCom for DeviceNet 2.1.

Contents 1. Differences between NI-IndCom for DeviceNet 2.1 and NI-DNET 1.6.x 2. Migrating NI-DNET Applications to NI-IndCom for DeviceNet 2.1 3. Example

1. Differences between NI-IndCom for DeviceNet 2.1 and NI-DNET 1.6.x The NI-IndCom for DeviceNet 2.1 software adds NI-DNET compatible LabVIEW VIs that work on NI PCI-8532, NI PXI-8532, and NI-9882, and also maintains the older project based NI-IndCom for DeviceNet 2.0.x features for NI PCI-8532 and NI PXI-8532. Compared with NI-DNET, the NI-IndCom for DeviceNet 2.1 software does not support C based languages, DeviceNet slave mode, NI-DNET Configurator or Analyzer in Measurement & Automation Explorer (MAX). The NI-IndCom for DeviceNet 2.1 software offers a project based EDS file import to find and test connected slaves easily.

2. Migrating NI-DNET Applications to NI-IndCom for DeviceNet 2.1 We recommend conducting this migration in a LabVIEW project. Before you start make a copy of your original code and save it somewhere else. 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 VIs or Ctls listed in the table below are shown in the Dependencies -> vi.lib tree, replace those VIs with the corresponding NI-IndCom for DeviceNet VIs. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 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

3. Easy IO Config.vi example: (1)In the LabVIEW project, right click Easy IO Config.vi and select Replace with from the shortcut menu.

1/3

www.ni.com

Note: The replace Dialog is only active if the Main VI is closed.

(2) 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 the <vi.lib> can be found here: C:\Program Files (x86)\National Instruments\LabVIEW 2011\vi.lib

(3) Save all the changes in Save changes before closing dialog.

2/3

www.ni.com

(4) Repeat above three steps to all other NI-DNET VIs shown in Dependencies->vi.lib tree.

Legal This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE ( http://ni.com/legal/termsofuse/unitedstates/us/).

3/3

www.ni.com

You might also like