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:
|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 below titled Importing EDS Files.
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.
NI 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:
- 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
- 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.
- 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
- Click Save for all the changes.
- Repeat above three steps to all other NI-DNET VIs shown in Dependencies » vi.lib tree.
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
- Open LabVIEW and create a new project. Add any Real-Time targets to the project.
- Right-click on My Computer or the Real-Time target, select New » Target(s) and Device(s).
- Select Discover Existing Devices. Expand DeviceNet Master Interface.
- The master should automatically discovered. Click on the target, and then OK.
- Configure the Master settings. Then click OK.
Add a DeviceNet Slave Device to a LabVIEW Project
- Right-click on the master device in the project. Select New » Targets and Devices.
- In the dialog box, expand DeviceNet Slave Device and find your DeviceNet Slaves. Click OK.
- 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
- 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.
- Click Add Files.
- Locate your EDS file. Click OK.
- Select your EDS file from the list of imported EDS files. Click OK.
Verify the EDS File Imported Correctly
- Right-click on the Slave Device » Utilities » Online Test Panel
- Select Device State in the left-hand panel, then the Device in the right-hand panel.
- Click Verify Device.
- Ensure no errors or warnings have occurred.