Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
4 ratings:
 4.75 out of 5     Rate this Document

Methods for Binding a Shared Variable to a FieldPoint Channel

Primary Software: LabVIEW Development Systems>>Full Development System
Primary Software Version: 1.0
Primary Software Fixed Version: N/A
Secondary Software: N/A
Hardware: FieldPoint

Problem:
What are the options that I have to bind a shared variable to a FieldPoint channel, and which is the preferred method?

Solution:
Using the FieldPoint Read or Write functions and writing or reading to or from a shared variable reference is still a recommended method for using FieldPoint with shared variables because certain options, such as custom scales, are only available using the FieldPoint functions.

However, binding a shared variable directly to a FieldPoint channel is advantageous in certain types of applications such as event driven data logging and monitoring applications, especially those using the LabVIEW DSC Module.

The methods for binding a shared variable directly to a FieldPoint channel are discussed below.


Method 1 (Recommended): Bind Directly to the FieldPoint Server of the Controller Using Logos

This method may be advantageous in certain situations if you want more direct access to rapidly changing channels as it bypasses the FieldPoint driver on the host machine, however the incremental increase in response time may be minimal and the method is harder to use since the FieldPoint controller doesn't publish the channel aliases.  In addition, by bypassing the FieldPoint driver on the host machine you will not be able to utilize certain features such as custom scaling.

  1. In the Project Explorer, right-click on My Computer and select New » Variable to create a shared variable. The Shared Variable Properties dialog box will appear.
  2. Make sure the Variable Type is set to Network-Published.
  3. Check Bind to Source, select the access type and click Browse.
  4. In the Select Source Item dialog box, click the Network Published Source drop-down menu and select Network Items. This is going to bring up a list of items on your subnet to which you can bind.
  5. Find the IP address of the desired FieldPoint controller.
  6. Expand the tree until you reach the module and respective channel of the desired FieldPoint module. See the image below.
  7. Highlight the correct channel and click OK. The shared variable is now bound directly to that channel via the FieldPoint Server of the controller.

Method 2: Bind via the FieldPoint I/O Server (NOT Recommended)

Prior to LabVIEW 8.5 and NI-FieldPoint 6.0 this method requires the LabVIEW development environment.   Therefore if you are using LabVIEW 8.2.1 or earlier, you cannot build executable files when using this method that will work with only the LabVIEW Run-Time Engine. When building your installer in LabVIEW 8.5 or later, you can now include the FieldPoint installer with I/O Server by selecting the installer type, Full with FieldPoint I/O Server Support.

NOTE: This method requires the LabVIEW DSC Module.
  1. To use this method you must have the FieldPoint I/O Server installed. If the FieldPoint I/O Server is not installed complete the following steps.
    1. Modify the installation of the NI-FieldPoint driver by going to Add/Remove Programs in Windows.
    2. Select National Instruments Software and click the Change button.
    3. Select NI-FieldPoint from the list of NI software and click the Modify button.
    4. The FieldPoint 5.0.1 dialog box will appear as seen below. Select to install the FieldPoint I/O Server and complete the installation.
    5. Restart your computer.

  2. Create a new project (at this point it is assumed you've already created an IAK file for your various FieldPoint items).
  3. In the Project Explorer, right-click on My Computer and select New » Variable.
  4. In the Shared Variable Properties dialog box, check the Bind to Source check box and then click the Browse button.
  5. Select Network Items from the Network-Published Source drop down and expand the item for your machine by clicking the + box next to your computer name.
  6. Expand the System item, then the FieldPoint item, and finally the MAX Data Neighborhood item. You can now select a channel to bind to the shared variable.
  7. Click OK. See the picture below:


Method 3: Bind to the OPC FieldPoint Server or NI Variable Engine OPC Server (NOT Recommended).

NOTE: This method requires the LabVIEW DSC Module.

NOTE: Using this method to bind FieldPoint channels to shared variables is NOT recommended. The purpose of these OPC servers is to provide open access of FieldPoint hardware and LabVIEW data to other 3rd party software, but using OPC adds another layer of communication on top of other methods and will result in a loss of performance compared to the other methods described.
  1. In the Project Explorer, right-click on My Computer and select New » I/O Server to create a new I/O Server.
  2. Select OPC from the Create New I/O Server dialog box and click Continue. (NOTE: you will not see OPC as an option without the DSC module installed).
  3. In the Configure OPC Client Instance dialog box , select National Instruments.OPCFieldpoint as the Registered OPC Server.
  4. Once the library containing your new I/O Server is created, right-click on the library and select New » Variable to create a new shared variable and automatically add it to the library. The Shared Variable Properties dialog box will appear.
  5. Check the Bind to Source check box and click Browse.
  6. In the Select Source Item dialog box, leave Project Items as the selection in the Network Published Source drop-down menu.
  7. Expand the tree under your project until you reach the OPC I/O server that you created. Continue expanding nodes until you find the desired FieldPoint controller.
  8. Expand the items in the tree until you find the desired module and channel. Select the channel and click OK. See the image below.


NOTE: If you are polling a shared variable reference in a loop, make sure your loop has a Wait function in it.

Related Links:

Attachments:


fpitems.JPG - fpitems.JPGfpioserver.JPG - fpioserver.JPG
FP OPC Method.JPG - FP OPC Method.JPGFP Direct Logos method2.JPG - FP Direct Logos method2.JPG


Report Date: 02/17/2006
Last Updated: 03/17/2008
Document ID: 3UG7KQY3

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit