OPC Server Configuration
NI-FBUS OPC Data Access Server is easy to configure.
For FOUNDATION Fieldbus H1 communication, you need:
-
Setup the NI FOUNDATION Fieldbus interface card
-
Install NI-FBUS Communications Manager (or NI-FBUS Configurator)
-
Import the device description files of your devices
Refer to the AT-FBUS Getting Started Manual, the PCI-FBUS Getting Started Manual, or the PCMCIA-FBUS Getting Started Manual according to your interface card.
For FOUNDATION Fieldbus HSE communication, you need:
-
Setup the FBUS-HSE/H1 linking device
-
Install NI-FBUS Communications Manager (or NI-FBUS Configurator)
-
Import the device description files of your devices
Refer to the HSE Linking Device Getting Started Manual.
After configuration, you can connect the devices to the interface card and the linking device. NI-FBUS OPC Data Access Server will detect the devices and their blocks automatically.
OPC Data Type Mapping Rule
There are three data types in FOUNDATION Fieldbus: SIMPLE, ARRAY, and RECORD.
The SIMPLE type and ARRAY type variables are regarded as leaf nodes in the OPC address space. The RECORD type variable is regarded as a branch node, which means that you cannot access the record type variable directly but access its fields one by one.
The following table shows the data type mapping rule.
Table 1. OPC Data Type Mapping Rule
FOUNDATION Fieldbus Address Space
NI-FBUS OPC Data Access Server defines the address space according the FOUNDATION Fieldbus hierarchy:
-
The top level is the link(s)
-
The 2nd level is the device(s) connected to each link
-
The 3rd level is VFD under each device
-
The 4th level is the block(s) under each VFD
-
The 5th and 6th levels are the parameters under each block. SIMPLE and ARRAY type parameters are leaf nodes and a RECORD type parameter is a branch node.
Figure 1 shows a typical FOUNDATION Fieldbus address space.
Access FOUNDATION Fieldbus with a Simple OPC Client
Server Explorer, an OPC client, comes with the NI-FBUS software. The following steps show how to access FOUNDATION Fieldbus with the Server Explorer:
1. Launch Server Explorer
2. Connect the NI-FBUS OPC Data Access Server:
-
Right click “NIFB_OPCDA.3” -> “Connect to server…” and a “OPC Connection” dialog pops up
-
Click “Connect” to close the dialog and the server icon becomes green
3. Add an OPC group:
-
Right click “NIFB_OPCDA.3” -> “Add/Edit Groups…” and a “OPC Server: NIFB_OPCDA.3” dialog pops up
-
Click “Add >>” on the dialog
-
Click “OK” to close the dialog and a group “Gr1” icon is added under the server icon
4. Add the OPC items:
-
Right click “Gr1” -> “Add/Edit Items…” and a “OPC Group: Gr1” dialog pops up
-
Select items in “Item Definition” area
-
Click “Add >>” and add items to “Name (Device\Item)” area
-
Click “OK” to close the dialog and the item icons are added to the group icon and the items are listed in the right area of Server Explorer
5. Read an OPC item:
-
Right click on the item you want to read -> “Properties…” and a “OPC Item” dialog pops up
-
Switch to “Read & Write AsyncIO”
-
Click “Read!” button
6. Write an OPC item:
-
Right click the item you want to write -> “Properties…” and a “OPC Item” dialog pops up
-
Switch to “Read & Write AsyncIO”
-
Input the value and click “Write!” button.
Development Tips
Use these tips to help you develop a more efficient FOUNDATION Fieldbus OPC application.
-
Read multiple items at a time instead of reading items one by one
Because the OPC server is optimized for multiple item operation, reading multiple items at a time is faster than reading items one by one. For the same reason, add multiple items at a time, and refresh multiple items at a time.
-
Add several OPC groups instead of only one
For most applications, the items to read are much more than the items to write. Adding several OPC groups instead of only one can organize the OPC items efficiently.
For example, put the items that you want to monitor into a group and put the items that you want to write, into another group with a slow update rate, such as 10s. In this way, the write operation will not be delayed by the read operation. OPC clients normally support multiple server instances and/or multiple groups for one OPC server. The OPC clients only support multiple server instances and only one group for each server. You can create several server instances instead.
-
Do not put too many static items into a monitoring group
Parameters in FOUNDATION Fieldbus can be divided into two groups: static items (in VIEW_2 and VIEW_4.x) and dynamic items (in VIEW_1 and VIEW_3.x).
You can put the static items into a slow update rate OPC group because these items seldom change.
-
Set a proper update rate for each OPC group
Because the FOUNDATION Fieldbus H1 rate is only 31.25Kb/s, the OPC group update rate cannot be too fast. Setting a proper update rate for each OPC group can save the communication bandwidth.
You can find the recommended fastest update rate for a specific OPC group by the following these steps:
-
Connect the NI-FBUS OPC server by an OPC client, such as Server Explorer
-
Add a group "G1"
-
Add the items you want to monitor to the group
-
Set the group update rate to a small value, such as 100ms, and the real update rate shown by the OPC client as the recommended update rate.
Conclusion
The NI-FBUS OPC Data Access Server provides FOUNDATION Fieldbus with the open OPC interface. With the server’s help, we can access the FOUNDATION Fieldbus network efficiently.