Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 6, 2006


Feedback


Yes No

Related Links - Developer Zone

Related Links - Products and Services

An Example of How to Use NI-FBUS Configurator Software

3 ratings | 3.33 out of 5
Print

Overview

This document functions as a hands-on tutorial for getting started with your Fieldbus hardware and the NI-FBUS Configurator software for process control.

Introduction

The purpose of this session is to give you first-hand experience with the National Instruments NI-FBUS Fieldbus Configuration System (NI-FBUS Configurator). This document is written on the assumption have successfully installed all Fieldbus hardware and software. Furthermore, the assumption is made that you have properly imported the device descriptions for the devices that you want to use.

In the first exercise, you will configure the Fieldbus network and some devices. In the second exercise, you will make basic connections between function blocks. In the third exercise, you will configure your PID control application using the NI-FBUS Configurator and download (or embed) that configuration to the Fieldbus.

In this hands-on session, you will learn about the following types of control applications:
  • Basic connections to AI and AO signals
  • PID control

    Exercise 1: Network and Hardware Configuration

1.1. Launch the NI-FBUS Configurator by selecting Start » Programs » National Instruments FBUS » NI-FBUS Configurator.

1.2. A dialog box appears informing you that NIFB.EXE has not been launched and asks if you want to launch it now. Select YES. It takes a few moments for NIFB.EXE to launch and for the NI-FBUS Configurator to load.

1.3. In the Add Links dialog box (shown below), select the segment you want to bring online. Check Interface0-0, and select OK.



This starts the process of the NI-FBUS Configurator automatically detecting all valid devices connected to the network. If the connected devices are registered by the Fieldbus Foundation as compliant devices and the device description files have been imported, the NI-FBUS Configurator can detect not only the device but also the function blocks contained within the device. This can take a few minutes, but once complete, the NI-FBUS Configurator screen should look like the screen shown below. You are now ready to configure your control strategy using the available function blocks.


[+] Enlarge Image

Exercise 2: Basic Connnections to AI and AO Signals


This example shows how basic connections are made to function blocks.

2.1. Double-click on Function Block Application. This opens a clean window to the right of the tree view. In this document, this window will be called the Function Block APplication (FBAP) window.

2.2. Drag one of each of the following types of function blocks from the tree view to this new FBAP window:
  • AI block,
  • AO block

2.3. In the toolbar, there is a button with a spool of wire. This is the wiring tool. You use the wiring tool to connect data together for the purpose of passing that data value from one function block to the next. Connect the AI and AO modules together, as shown below. You use the pointer tool (The tool on the toolbar that looks like a hand) to arrange blocks or nudge wires in order to make the FBAP code look more organized. The Zoom menu (The tool on the toolbar that looks like a magnifying glass) has several options to make the code within the FBAP more manageable.




The Significance of Fieldbus Modes
One of the more confusing aspects of Fieldbus for the novice user is the function block modes -- what are the modes and how do I get a block into the desired mode?

The MODE_BLK parameter for a function block has four fields - TARGET, ACTUAL, PERMITTED, and NORMAL. PERMITTED and NORMAL are defined by the device manufacturer. PERMITTED contains a list of all allowable modes for that block. NORMAL is the mode the device manufacturer expects the block to be in during normal use. The ACTUAL mode is the operating mode of the function block on the device. TARGET is a field that is writable by the user. Writing this field tells the device to change to the specified mode. The device will attempt to change the mode. If it is successful, the ACTUAL mode will reflect the target mode. Note that if the block is not currently scheduled, it will always be in Out Of Service (OOS) mode. A block is scheduled by placing it in a FBAP window and downloading the configuration to the device. Before this is done, the function block is not actually executing on the device -- it is Out Of Service. Any writes to change its mode are ineffective until the block is scheduled to execute on the device.

The most common modes are Auto, Cascade, Manual, and Out Of Service. In Auto mode, the block is running under its normal automatic control. In Cascade mode, the block is running under automatic control and is receiving its Set Point from another function block. (The PID and AO often receive their Set Points from a wire connecting an upstream block.) In Out Of Service mode, the block is not running at all. Normally, this mode is used during block configuration. Also, some devices require that the function block be in Out Of Service mode when writing certain parameters. In Manual mode, you can write the output of the block directly, so the block is under manual rather than automatic control.

2.4. At this point, we could download the configuration so that the function blocks can begin executing. However, if the device is controlling a real-world signal, it is generally better to set the parameters appropriately before downloading to avoid unexpected output values resulting from unconfigured parameters. Note that function blocks will not go into Auto mode until after they have been scheduled to execute by placing them in the FBAP window and downloading. If you would like to download now, see step 2.8 below.

2.5. Fine-tune your application by adjusting the scaling. For an AI block, you will set as many as three types of scaling -- XD_SCALE, OUT_SCALE, and L_TYPE. The diagram below shows how each of these parameters is used.


[+] Enlarge Image


You can confirm or change these parameters by double-clicking on the AI function block. Within the FBAP window, you find several tabs with different parameters grouped by type. Confirm the scaling parameters in particular and check that others are reasonable. To make changes to a function block parameter, place your mouse over the existing value and single click. This brings up an edit field. When you are ready to write all the new values, click on either the Write Changes button at the bottom of the screen or the button at the top of the screen. If you have already downloaded the configuration, you might get a write warning telling you that the block is in the wrong mode for the request. This is because some devices require that certain parameters be written only in OOS mode. Acknowledge the warning and click the OOS button. Allow a couple of seconds for the device to get into OOS mode before clicking Write Changes again. After the changes have been written, change the block back to its original mode. Another common cause for write warnings is trying to write an invalid value to a parameter. Devices will refuse values that are out of range. To correct this problem, note the parameter that caused the warning and change it to an appropriate value. You can get help for any parameter by clicking on a parameter and reading the help text listed in the Help Window on the right-hand side of the screen. The Help often provides information such as range on a particular parameter. If the Help Window is not active, select Help Window from the Window menu.

2.6. Next, you can modify the scaling of the AO module. Make the adjustments to the AO Function Block by double-clicking on the block. Scaling for the AO block is similar to that of the AI block, only in the reverse direction. PV_SCALE and PV for an AO block correspond to the OUT_SCALE and OUT of the AI block -- they are the values that are seen on the bus.

2.7. You may also want to decrease the macrocycle of your FBAP. The macrocycle is the least common multiple of all the loop times on a given Fieldbus segment. You edit the schedule by double-clicking on the Schedule option from the tree view side of the screen. Try making the Loop Time shorter. Notice that you will get a warning if you schedule blocks too closely. Also, if the schedule requires additional modifications, you can drag and drop the blocks directly on the schedule. You need to download the configuration again for the new schedule to take effect. (You can make all of these modifications before the first download.)



2.8. Now you are ready to download your Configuration. You can select Download Configuration from either the Configure menu or by clicking on the Download Project button.

The Download Configuration utility pops up a window and gives you the following options for downloading:
  • Write Contained Block Parameters -- Writes all contained parameters (parameters that are internal to the function block, such as the scaling and alarm limit settings) from the function block windows. This is especially useful if you are changing parameters in multiple function blocks and do not want to take the time to write them block by block.
  • Clear Devices -- Clears the existing configuration in the devices before downloading. Using this ensures that the linkages you see in the FBAP window are the only linkages in the device.
  • Automatic Mode Handling -- Automatically takes the blocks Out Of Service (OOS) as needed during the download process and returns them to normal mode after the configuration is downloaded. If this option is not checked, you will be prompted to take the blocks to OOS as needed and will have to set them back to AUTO by hand after the download completes.
  • Verify & Diff -- After downloading, the NI-FBUS Configurator uploads the actual configuration from the devices and compares it to the configuration file in the NI-FBUS Configurator.

The two most common download options are shown below. Select Download when you are ready to download your configuration. Downloading can take several minutes to complete. When finished, the NI-FBUS Configurator pops up a dialog box informing you that the download operation is complete.



2.9. Test your configuration. Testing within the NI-FBUS Configurator is accomplished two ways. First, you can start the Monitor utility from the Configure menu or by clicking on the Monitor button. Note that the menu option only appears if the FBAP is open. The below configuration monitors only wired outputs and block modes every two seconds. You select what you would like to monitor with the checkboxes.


[+] Enlarge Image


Another useful method to monitor or test an application is to open the parameter window for any individual function block and observe the appropriate parameters. Check the Periodic Updates box if you want to cause the parameters to be read at the specified rate when the block is running.

Exercise 3: PID Control of a Simulated Process


This exercise assumes you have already gone through Exercise 2. For this reason, details about downloading, modifying function blocks, writing parameters, or testing are not provided. If you do need help on these topics, refer to the previous exercises.

3.1. Open the FBAP window.

3.2. To create your PID Feedback control application, use control templates that come with the NI-FBUS Configurator. Right-click in an empty area of the FBAP window. Highlight the option FBAP Templates and select PID Feedback Control. A dialog box asks if you want to use the parameters saved in the template. Since this is a generic template, your function block’s parameters are probably more suitable than the template’s parameters. Choose No. (Note that you can create your own templates and define the parameters of the function blocks. In this case, you might want to choose the template parameters.) This operation places a PID template on the FBAP window. Notice the blocks are grayed out - a visual indication that the blocks are unassigned.
  • Right click on the AI template block, highlight Replace With, and select an appropriate AI function block.
  • Right click on the AO template block, highlight Replace With, and select an appropriate AO function block.
  • Right click on the PID template block, highlight Replace With, and select an appropriate PID function block.

3.3. The PID block requires tuning parameters such as GAIN, RESET, and BAL_TIME set specifically for the process. To get a better response from the PID Control algorithm, you might also have to change some parameters in the AI block. The PV_SCALE of the PID block (which gives the PID the range of its IN parameter) should match the OUT_SCALE of the AI block (the range of the value that the AI is passing to the PID). Likewise, the OUT_SCALE of the PID block (the range of the value that the PID is passing to the AO) should match the PV_SCALE of the AO block (which gives the AO the range of its CAS_IN parameter).

3.4. Specify the set point of the PID. You can either write the parameter SP.VALUE directly or wire an input to CAS_IN. First try writing the parameter directly. (Remember that you have to download the configuration before the PID will run.) Then, try using a second AI block to provide the set point for the PID control algorithm. Connect the OUT of an AI block to the CAS_IN of the PID block. Again, the PV_SCALE of the PID block (which gives the PID the range of its input parameters) should match the OUT_SCALE of the AI block (the range of the value that the AI is passing to the PID). Adjust the AI and PID parameters as needed. Below is a diagram of how the final FBAP should look.


[+] Enlarge Image


3.5. You might want to decrease the macrocycle if you have not done so already so that the loop is more responsive.

3.6. Download this new configuration and test by changing the set point through the analog input and observing the SP and PV parameters of the PID function block. You may want to confirm the modes of each of the blocks for proper operation. If any of the modes are incorrectly set, first try to use the mode buttons within the function block parameter windows.

The proper modes should be:
  • First AI -- Auto
  • Second AI -- Auto
  • PID -- Cascade
  • AO -- Cascade

    Summary

At this point, you should be familiar with basic operations in the NI-FBUS Configurator. If you would like additional information, you can download the NI-FBUS Configurator User Manual.
3 ratings | 3.33 out of 5
Print

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