Using NI FieldPoint 4.0 with LabVIEW 7.0
Overview
LabVIEW 7.0 and NI FieldPoint 4.0 have introduced major changes in the way LabVIEW works with FieldPoint hardware. This document illustrates the changes and gives a basic tutorial on using LabVIEW 7.0 with FieldPoint.
Table of Contents
Simplifying Block Diagram Programming
Before LabVIEW 7.0 and FieldPoint 4.0, FieldPoint programming on the block diagram required the following steps:
- Place an FP Open VI on the block diagram. Wire the .iak file path terminal if you don’t want to use the default configuration file (the last-saved file from FP Explorer).
- Place an FP Create Tag VI on the block diagram for each I/O point you want to communicate with. Wire the FP refnum in terminal to the FP refnum out terminal of the FP Open. You can also wire the error terminals for error checking. Wire the comm resource name, device name, and item name string terminals. Make sure that the white space and letter case (capital/lowercase) match the .iak file.
- When you have configured each FP Create Tag, you can place FP Reads and FP Writes and wire the refnum and/or error terminals to the appropriate FP Create Tags.
- Finally, place an FP Close to terminate communication with the FieldPoint module.
Figure 1 shows a LabVIEW 6.1 code snippet following these steps.

Figure 1. LabVIEW 6.1 Block Diagram Using FieldPoint Explorer 3.0.2 VIs
Constructing a block diagram is a lot easier with LabVIEW 7.0 and NI FieldPoint 4.0. For one thing, you no longer have to do steps 1, 2, and 4 described above. FieldPoint IO Point has replaced FP Refnum, FP Open, FP Create Tag, and FP Close. Simply wire an FP Read or an FP Write to a FieldPoint IO Point constant. You no longer have to type tag names as they appear in the .iak file, but can browse to the tag you want. Figure 2 shows an FP Read and an FP Write wired to FieldPoint IO Points.
Note: All the screenshots shown in this section are from the Advanced Palette. Refer to the LabVIEW Upgrade Notes for version 7.0, page 15: Controls and Functions Palette Enhancements, to learn how to change the palette view.
- Functions Palette
In LabVIEW 7.0, the location of the FieldPoint VIs has changed. You can now find them under Functions>>NI Measurements>>FieldPoint. Figure 3 below shows the Functions palettes in LabVIEW 6.1 and LabVIEW 7.0 and the locations of the FieldPoint VIs on each palette.

Figure 3. LabVIEW 6.1 (left) and LabVIEW 7.0 (right) Functions Palettes and Locations of FieldPoint VIs
Notice that FP Open, FP Create Tag, FP Get Configuration Info, and FP Close have been moved to the Advanced sub-palette, as they are provided mainly for backward compatibility. The Custom Create Tag sub-palette is gone, as is the Import FieldPoint Tags tool, because both have been replaced by the FieldPoint IO Point. Nevertheless, FP Read, FP Write, and FP Advise, which have all been polymorphic for four basic data types (float, float array, boolean, and boolean array) since LabVIEW 6.0, are now also polymorphic for I/O control (purple wire) or FP refnum (brown wire) wire as well, making it possible for recent code to coexist with older code.
The additions to the palette for LabVIEW 7.0 are the FieldPoint IO Point Constant and the FieldPoint Express Block.
- Controls Palette
In LabVIEW 7.0, there is no FieldPoint subpalette on the Controls palette. The FP Refnum In and FP Refnum Out controls have been replaced by the FieldPoint IO Point control. Figure 4 shows the Control plaettes in LabVIEW 6.1 and LabVIEW 7.0, and the location of the FieldPoint controls in each.

Figure 4. LabVIEW 6.1 (left) and LabVIEW 7.0 (right) Controls Palettes and Locations of FieldPoint Controls
A "classic" version of the FieldPoint IO Point control can also be found on the Controls>>Classic Controls>>Classic I/O subpalette, which differs from the regular palette only in appearance.
Configuring the FieldPoint IO Point Control
The FieldPoint IO Point control contains a slash-delimited string that represents an item on a FieldPoint module. The string has four parts and is built as follows:
- Comm Resource, Device, and Item are the same strings that used to be passed into FP Create Tag in older versions of FieldPoint and LabVIEW.
- The alias is a short name representing a path to a .iak file on the computer that LabVIEW is running on. The name 'FieldPoint' is reserved for the .iak file last saved in Measurement & Automation Explorer (MAX).
A FieldPoint IO Point is always associated with a FieldPoint device. When you create the point, the dropdown list displays the default .iak file, the first comm resource, and the first device on that comm resource. For example, a typical dropdown list looks like the one in Figure 5.

Figure 5. FieldPoint IO Point Control Dropdown List
In Figure 5, the alias is FieldPoint, the comm resource is FP Res, and the device is FP-2010 @0.
To change the device associated with a FieldPoint IO Point Control, select Browse to launch the Browse dialog (discussed later in this document). Missing items appear grayed out as shown in Figure 6. This can happen if the .iak file has been changed between LabVIEW sessions.

Figure 6. Grayed-Out Item in FieldPoint IO Point Control
If the device is no longer valid, the dropdown list appears empty, as shown in Figure 7.

Figure 7. Empty Dropdown List of an IO Point Control Pointing to an Invalid Device
To correct this behavior, launch the Browse dialog and point the control to a valid device.
If you are using the LabVIEW 7.0 Real-Time Module targeted to a FieldPoint or Compact FieldPoint real-time controller, the host LabVIEW must get item information from the controller. Therefore there is generally a delay in populating the dropdown list when a FieldPoint IO Point control is first dropped on a front panel, as illustrated in Figure 8.

Figure 8. FieldPoint IO Point Control Running Embedded
Launching the Browse dialog and pointing to an item corrects this behavior.
- Browse Dialog
The Browse dialog has two tabs: Browse FieldPoint and View Configurations.
The Browse FieldPoint tab is for browsing the FieldPoint hierarchy and pointing the FieldPoint IO Point control to a new device, as illustrated in Figure 9.
Select a device from the tree, select the item, and click OK. If you do not select an item is selected, the first item in the list is selected by default.
If no .iak file has been saved in MAX or no configuration has been added on the View Configurations tab, the browse tree is empty and the error message in Figure 10 appears.

Figure 10. Error Message When No .iak File Has Been Saved
If you are running LabVIEW 7.0 Real-Time targeted to a real-time controller, the alias, comm resource, device, and item names that have been downloaded to the controller from MAX are displayed on the View Configuration tab. Either right-click the corresponding comm resource in Data Neighborhood and select Download item names, or select Tools>>FieldPoint>>Download item names on save, then save the .iak file.
LabVIEW uses the alias name associated with the current .iak file. If no alias is defined, "FieldPoint" is used.
While the VI is targeted, any configuration associations you save on the host computer will not be displayed. If no item names have been downloaded to the controller, the browse tree is empty and the error message in Figure 12 appears.

Figure 12. Error Message When No Items Have Been Downloaded
You can click the Refresh button to update the tree if configuration files have changed.
Use the View Configuration tab to view and manage configuration path aliases on your computer, as illustrated in Figure 13. This tab is grayed out if the VI is targeted to a Real-Time controller.
The View Configuration tab displays all of the associations between .iak files and aliases on a given machine. You can add, delete, and modify associations here. The default "FieldPoint" configuration cannot be modified or deleted, so the Remove and Modify buttons are grayed out if that configuration is selected.
A check mark to the left of a .iak file name in the table indicates that the file and its items can be opened and parsed. A "Do Not" symbol to the left indicates that the file could not be opened or parsed correctly. You cannot have two configuration file aliases that refer to the same .iak file unless one of the aliases is the default alias.
Reader Comments | Submit a comment »
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/).




