Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
What is Developer Zone?
United States

Document TypeTutorial
NI Supported: Yes
Publish Date: Oct 02, 2012


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links -Products and Services

Using FieldPoint OPC Server with the LabVIEW DSC Module

6 Ratings | 4.17 out of 5
 Print |  PDF

Table of Contents

  1. Overview
  2. Device Configuration
  3. Tag Configuration
  4. Tag Monitoring
  5. Building User Interface

Overview

This document shows how to access FieldPoint distributed I/O from the LabVIEW Datalogging and Supervisory Control (DSC) module. There are three communication protocols a user can choose from in order to connect these two products: OPC, Logos, and IAK protocols. This document only describes the OPC method, which is the preferred way. For overall comparison of all these methods, refer to the following link: LabVIEW DSC Module to FieldPoint Connectivity.

The major benefits of using OPC server are:

  • OPC is an industry standard
  • Easy channel configuration with FieldPoint Explorer

Major disadvantages are:

  • Cannot change I/O ranges during run-time
  • OPCFieldPoint is an extra layer in the communication stack
  • IAK file has to be maintained and deployed

Device Configuration

The very first step in the setup is to configure the FieldPoint devices. At the end of this step you should be able to access your FieldPoint devices from FieldPoint Explorer. If you have already done so, proceed to the next step; otherwise refer to the following documents:

See Also:
FieldPoint Ethernet Configuration
FieldPoint Serial Configuration

Tag Configuration


Once you are able to connect and monitor your channels from FieldPoint Explorer, you are ready to configure your LabVIEW DSC module tags.

1. Start LabVIEW and open a new VI.

2. Launch the Tag Configuration Editor by selecting Tools»Datalogging & Supervisory Control»Configure Tags.

3. Create a new SCF file. Select File»New. In LabVIEW 6.1, you'll get a File Information window. Accept the default values by clicking OK.

4. Launch the automatic tag generation by selecting Edit»Configuration Wizard.

5. The Configuration Wizard window should appear. Locate the National Instruments.OPCFieldPoint entry in the left pane and expand the hierarchy.

6. Select the channels you would like to add to your DSC configuration and click the Add Item(s) button. Read the following tip before you do so:

Tip: If you want to add all channels into the tag configuration, highlight the National Instruments.OPCFieldPoint entry and click Add Item(s). This will add all channels from all underlying modules. However, this includes some channels that are more than likely undesirable in your configuration. For example, it would include the Ethernet network module channels or the ...All channels. You are not likely to use these channels in your tag configuration. Your configuration is likely to only use the I/O channels. You can either add all channels and then delete the unwanted channels from the left pane, or you can select and add only the channels that you will use. For example, on the picture below only Channels 0 to 7 are selected and added to the configuration. Note that All and Channel 8 (Cold Junction Channel) were not added, nor the network module channels.


7. Click OK after you are done with the channel selection. Note that the tags are being auto-generated in the Tag Configuration Editor from the selected FieldPoint channels.



8. Save the configuration (File»Save). Accept the default values for the SCF Logging Path window that appears after you save the file.

9. Now examine the tag attributes. Double-click on a tag to edit the attributes. You will get a tag configuration window with five tabs: General, Connection, Operations, Scaling and Alarms. Press <Ctrl-H> on your keyboard to open the context help window. Move your mouse over the item in question to get the help. Here are a few items that deserve extra attention. See the context help for details.

Connection»I/O Group»Edit...»Update Rate (secs)
Connection»I/O Group»Edit...»Deadband (% of range)
Operations»Update Deadband (% of range) - this should match the Deadband in the I/O Group configuration (line above)

Tips:

  • All deadbands are a percentage of the range entered on the Scaling tab. If your tag values are only updated rarely or not at all, consider lowering the deadbands. Note that the default value is 1%. If you are reading temperatures and the tag range in the Scaling tab is 0 - 4000, then 1% corresponds to 40. Unless the temperature changes more than 40 degrees, the tag values are discarded. Zero deadband is acceptable, but it means the system will be busy with every single update. This might increase your system CPU usage.
  • You can predefine the default values that are used for new tags by selecting Configure»Default Parameters.

    Tag Monitoring

An easy way to verify that the engine can successfully connect to your device is to use the Tag Monitor utility.
1. Start the Tag Engine by selecting Tools»Launch Engine in the Tag Configuration Editor.

2. Watch for the Tag Engine icon in the task bar tray. A small green triangle should appear on the Tag Engine icon (). This signals that the engine is running. The six-dot icon should also display three green lights (). This icon represents the DSC background services, such as Citadel historical database. In older versions of the LabVIEW DSC module, the services were represented by a light house icon (). In some cases, you won't have the icon in the tray at all, which does not necessary mean the services are not running. Please refer to the document linked below this section for more information, if you run into some issues.



3. Launch the Tag Monitor by selecting Tools»Monitor Tags in the Tag Configuration Editor.

4. In the Tag Monitor window expand the My Computer entry in the tree view. Expand the LabVIEW entry underneath.

5. Add a tag to your view by popping up on the tag and choosing Add.

Tip: You can select and add a range of tags. Highlight the first tag, press the <Shift> key on your keyboard, and highlight the last tag in the range. Pop up on the selection and choose Add.



The right pane of the Tag Monitor displays the value, timestamp, and quality of the selected tags.

6. Save the current view to a Tag Monitor configuration file (*.tmd), by selecting File»Save.

Tip: In the LabVIEW DSC module version 6.1, you can invoke the Tag Monitor programmatically with the Start Tag Monitor.vi. This VI is located in the Tags sub palette and expects a Tag Monitor configuration file name.

The easiest way to create a new user interface control associated with a tag is to use the HMI Wizard.
1. Open a new VI, if it is not open.

2. Create a numeric indicator on the front panel.

3. Pop up on the indicator and select HMI Wizard from the menu.



4. In the HMI Wizard select a tag name from the list box.



5. Click OK to return to the front panel. At this point the wizard generates a code on the block diagram.

6. Start the VI.



7. Check the diagram. It should look similar to this diagram.



The minimum elements that the diagram should contain are:

  • An engine loop - this piece of code starts the engine and keeps the VI running, until the engine stops.
  • An indicator terminal - this is just the front panel indicator representation on the diagram.
  • DataSocket URL Frame (6.1 version only) - the frame associates the indicator with the selected tag; refer to the link below for more information on this piece of code.
See Also:
KnowledgeBase: Code Generated by HMI G Wizard - What is it Good For and Do I Need It?
6 Ratings | 4.17 out of 5
 Print |  PDF

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/).