P-CIM OPC Communication
P-CIM OPC Communication
P-CIM OPC Communication
User Guide
Contents
II
OPC Browser, an OPC client that requests information from an OPC server connected to a
PLC. The OPC Browser enables bidirectional communications between P-CIM and an OPC
server.
OPC Gateway, an OPC server, that receives data from P-CIM OPC servers. Using OPC
protocol the data is translated and sent to the OPC client that sends it to external devices and
programs.
P-CIM station
A P-CIM station can act as both an OPC client and OPC server, or can be a client or server only. The
diagram below illustrates how a P-CIM station is both an OPC server and OPC client.
PLC
PROTOCOL
P-CIM Servers
BasicSrv
DBSR
PfwAlarm
C A L L B A C K
PfwDrvr
TxtSrv
P R O T O C O L
PROTOCOL
The P-CIM OPC client (Browser) receives data from the server, whereas the P-CIM OPC server
(Gateway) sends P-CIM data to any OPC client.
In this bidirectional process, data from the PLC arrives to the OPC server.The data is translated using
OPC protocol, and sent to the OPC client (Browser). The data is then sent to P-CIM servers and using
call back protocol..
The data sent to the OPC Gateway( Gateway) where it is translated using OPC protocol and sent to
external programs.
Requirements
Operating System
Windows XP Professional
Protocols
Windows XP , 2000 & 2003 serevr are required for remote OPC server connections.
Settings
The following must be defined on the station using OPC communications:
NetBEUI protocol
DCOM
Copy the NetBEUI files from the Windows XP CD. Instructions can be found at: http://
support.microsoft.com by searching for NetBEUI and selecting How to install NetBEUI on
Windows XP.
2.
Select the following: Start/ Settings/ Control Panel/ Network/ Dialup Connections.
3.
Right click Local Area Connection and then click the Properties button.
4.
Scroll the list, select NetBEUI protocol and then click the Install button.
5.
Open the Network dialog box, Select the following: Start/ Settings/ Control Panel/ Network.
2.
Open the Protocol tab, and click the Add button to open the Select Network Protocol dialog box.
3.
DCOM configuration is not required when both the client and the server reside on the same
computer DCOM configuration is not required.
2.
Type dcomcnfg into the Open field and click OK. The DCOM Configuration Properties dialog
box is displayed.
3.
4.
From the Components Services list, right click PfwOPCGateway to open the PfwOPCGateway
Properties dialog box.
5.
Click the Identify tab and select the interactive user and system options.
6.
Click Apply.
7.
8.
Select Customize.
9.
Click the Edit button to open the Launch Permission dialog box.
From Section 1:
1.
Check the Customize option and then click the Edit button. The Registry Value Permissions
dialog box opens.
2.
Click the Add button to display the Add Users and Groups dialog box.
3.
Select the user/group that will be able to access the OPC server.
4.
5.
From Section 2:
1.
Check the Customize option from the Access Permissions option and then click the Edit
button. The Registry Value Permissions dialog box opens
2.
Select the user/group that will be able to launch the OPC server.
3.
4.
From Section 3:
1.
Check the Customize option from the Configuration Permissions option and then click the
Edit button. The Registry Value Permissions dialog box opens.
2.
Select the user/group that has permission to access the OPC server.
3.
4.
5.
Click OK and OK again to save these definitions and to exit the Properties dialog box.
Select the following: Start/ Settings/ Control Panel/ Administrative Tools/ Computer
Management/ Local User and Groups.
2.
3.
4. Select a user and then click the Add button to open the Select Users or Groups dialog box.
5.
Enter the name of the user and then click the Check Names button to add the users details
OR
Double click the name of the user and click the Add button.The users name is added to the list.
6. To enable sharing folders between computers in the workgroup, locate the following entry in the
Local Security Policy window: Network Access: Sharing and Security model for Local
Accounts.
7. Double-click the entry to change the current policy.
8. From the pull-down menu select the following option: Classic - local users authenticate as themselves.
10
OPC Browser
The OPC Browser module can be used in a P-CIM project to access process data from an OPC
server.
During runtime, the OPC Browser receives data from the PLC after it has been processed by the OPC
server software, and then the OPC Browser sends the information to the P-CIM project.
OPC technology enables the following actions:
Checking communications.
The protocol used by the PLC must match the protocol used by the OPC server.
The following diagram displays how the OPC Browser can be used in a P-CIM project.
PLC protocol
PLC
OPC protocol
P-CIM callback
P-CIM project
The OPC Browser can be opened without starting up P-CIM. However, P-CIM must be
running to enable connection to the OPC Gateway server.
Workflow
The following workflow can be used for working with the OPC Browser:
11
From the Tools menu of the P-CIM icons group,click the P-CIM OPC Browser icon
Open the Connect dialog box: From the OPC Browser interface, click the Connect icon
or,
From the Server menu click the Connect option.
12
2.
3.
The OPC Browser is connected to the OPC server and the OPC Browser interface opens.
Open the Connect dialog box: In the OPC Browser interface click the Connect icon
or from the Server menu click the Connect option.
2.
Click the Network OPC Servers button and browse for the computer where the remote OPC
server is installed.
3.
Click OK to make the connection between the servers. The OPC servers available on the remote
computer are added to the list of OPC servers in the Connect dialog box, and the name of the
remote computer is added to the Network Computer field.
13
When making remote OPC server connections, check that you have the appropriate authorization.
Error! Reference source not found., page 8 for more information. Both local and remote computers
must be defined on the same domain or in the same workgroup.
4.
Select a remote OPC server and then click the Connect button to connect between the selected
OPC server and the OPC Browser.
The INI file name of the remote OPC server has the following format:
OPC_NetworkComputerName_OPCServerName.ini
When first accessed the OPC Browser has the following sections:
14
Section
Description
Menu bar
Toolbar
Address bar
Displays the full name and address of the item currently selected in the OPC
Browser.
Server window
Displays the OPC server group tree structure. When expanded the tree has
the following structure:
Server name, Group name, Sub-group name
Group window
Items window
Displays the items of the selected group or sub-group in the Server window
from which items can be added into the list of advised items.
Displays selected items from the Items list. When monitoring is defined,
these items are scanned according to predefined conditions.
Menu/Tool bar
The OPC Browser menu bar is dynamic, after a connection has been made to an OPC server
additional menus and options are available. An asterisk * next to a menu/option indicates that it is
available both when the OPC Browser is online or offline.
Icon
Option
Description
Save
*Exit
15
*Item
*Connect
Disconnect
Refresh
When clicked, the OPC Browser reads the items from the tree of
the selected OPC server again and updates the OPC Browser
window.
Reconnect
Disconnect all
servers
Show Items
Server
Properties
Add group
Remove group
Add item
Opens the Add Item dialog box where items that require
constant monitioring are defined.
Remove item
Write item
Opens the Writing dialog box whereyou can modify the selected
advised items value.
Add multiple
items
Opens the Multiple Advise dialog box where you can define
batches of items that require constant monitoring.
An advised item is an item that is constantly monitored by the
P-CIM client modules. For example, Operator Worksation.
View
*Status bar
Toggles the Status bar where the total number of advised items
and the total number of items in a selected group are displayed.
Address bar
Toggles the address bar. The information in the address bar can
be copied and added to objects during project development.
16
Monitoring
P-CIM item
syntax
When activated, displays the Server| Topic| defined for the item
in the OPC server Item syntax of a selected item (or advised
item) in the interfaces Address bar.
*OPC Browser
configuration
When the Monitoring option is selected, data is transferred between the OPC Browser and the
OPC server. Advised items and their details are displayed in the Advised Items window. This
process requires extensive CPU memory resources. We recommend using this option only when
absolutely required.
From Version P-CIM 7.50 the OPC browser is capable of supporting EGU conversion functions:
bcd, byte, nib and alarm. To use these functions add the character d before each function. For
example: dbcd, dbyte.
Disconnecting:
Disconnecting a single OPC server :select the OPC server from the Server window and
Disconnect icon
from the toolbar click the
or from the Server menu select the Disconnect option.
Disconnect all OPC servers connected to the OPC Browser: select the Disconnect
All option from the Server menu.
Reconnecting:To reconnect to the OPC server that was last disconnected, click the
Reconnect icon from the toolbar
or from the Server menu select the Reconnect option.
Refreshing: The OPC Browser with items and their values that were added/ removed
to/ from the selected OPC server, click the
Refresh icon
or from the Server menu select the Refresh option.
An OPC server that has items that are advised (by the Operator Workstation, DBSR or other
modules), cannot be disconnected until their items become unadvised
If the OPC server has advised items and you wish to disconnect; shutdown P-CIM and then
restart the application.
All connected OPC servers are automatically disconnected when P-CIM is shutdown.
17
Groups
Groups with any number of items can be created where each group has global parameters specific to
the group. This option increases efficiency in a P-CIM project.
An advised item is processed in the OPC Browser, after it has been added, and results are displayed
in the Advised Items window.
A list of all OPC Browser groups is displayed in the Groups window.
Adding a new group
Groups are created/ modified in the Group dialog box. To open this dialog box either right click in the
Servers window or from the Items menu select the Add Group option.
Field
Description
Name
Group name.
Update rate
Indicating the frequency that the group of advised items is scanned. For example, if
1000 msec is defined the group is scanned every 1000 msec.
Deadband
Specifying the required percentage of change in the scale defined for the item in the
OPC server before notifying the OPC Browser of the data changes.
Deadband default = 0.
Time Bias
Indicates the time zone where the data was collected. Time Bias indicates the time
difference between the server and the client. By default= -120
18
Select the group and then either right click and select Remove Group or, from the Items menu select
the Remove Group option.
The OPC Browser has a default group named Root that cannot be deleted.
Items
Items can be advised and added to groups. All items that are defined in the application are displayed in
the OPC Items window. When an item is added to a group it becomes an advised item and is displayed
in the Advised Items window.
Since the OPC Browser is used for test purposes, not all OPC items need to be added to
the Advised window.
To display the items list, right-click the OPC Server name and choose Show Items from the
menu.
3.
In the Server window tree, select a branch and then select a group.
4.
Select an item from the OPC Items window and then right click on the item and select the Add
Item option or
From the Items menu double click on the item, select the Add Item option.
In the Server window tree, select a branch and then select a group.
2.
From the OPC Items List window, right click and select Add Item.The Add Item dialog box is
displayed.
19
3.
If you know the item Name and Path select the Name button and then type in this
information.
If you do not know the full path, type in the name of the item and then check the Full Path
option to complete the location.
4.
Click the Add Item button to add the selected item to the Advised Items window.
5.
The Copy button can be used to copy the item and its path into another location.
2.
Data blocks must first be deleted from the Database Editor before they are removed from the
OPC Browser
1.
In the other module,change the status of the selected item to not advised. (for example, by
closing the display).
2.
From the Groups window select a group and from the Server window select an advised item.
2.
Open the Writing dialog box, right click and select the Write Value option
or in the Items menu select the Write option.
20
3.
4.
Click OK to confirm the new definitions and to exit this dialog box.
2.
3.
4.
From the Groups window select a group and then in the OPC Items window select the first item
from which to create multiple advised items.
5.
From the Items menu select the Multiple Advised option. The Add Multiple Items dialog
box opens, and the From field displays the name of the selected item.
6.
7.
Options Menu
This menu has the following options:
Monitoring
21
Monitoring button.
Description
Item name
Value
Data type
Displays the items data type as defined in the OPC server. For example, word,
double word.
Time Stamp
Displays the time of the last update of the item by the OPC Browser.
Column
Description
Quality
Each OPC items value has an indication of its quality. This is known as the OPC
Item Quality. The quality of an item is based on whether or not the physical device
has provided a value for the Item ID.
Quality status can be:
Good, indicating that a value has been sent by the physical device for the
OPC item.
Bad, indicating that a value has not yet been received for the OPC item and
the value is unknown.
Access
22
When the Monitoring option is selected, data is transferred between the OPC Browser and the
OPC server. Advised items and their details are displayed in the Advised Items window. This
process uses extensive CPU memory resources. Afcom recommends using this option only
when necessary.
Select the OPC Browser Configuration option. The General tab is displayed.
The OPC Browser Configuration dialog box has the following fields:
23
Description
Connection
settings
Timeout
Log Alarm
Handler
Logging
options
Log(0-2)
0 = not logged
1 = logged
2 = internal use only
2.
This dialog box is used to define the continual communication of OPC servers connected to the OPC
Browser. It has the following fields:
Field
Description
Communication
(10-36000)
Communication
test attempts
24
Time attempts
25
Server = OPCSrv
Item = Itemname
The following syntax can be used to advise items per group: groupname(itemname)
For example, Group 1 will have the following syntax: Group1(DBSR.P-CIM.$WDAY)
From the P-CIM Group, click the Animation Editor icon to access the Animation Editor.
2.
3.
4.
The example below displays the Server|Topic!Item of an object that has input properties.
Creating datablocks
Data blocks are generally defined for generating alarms and history collection.
From the P-CIM Group, double click the Database Editor icon to access the Database Editor. The
example below displays the AV1 data block.
26
The Database Editor can only be fully accessed when P-CIM is running.
OPCsrv|PFWOPCGateway.Server!DBSR.PCIM.A1
Where:
Server = OPCSrv
Topic = PFWOPCGateway.Server
Item = DBSR.PCIM.A1
27
BasicSrv
DBSR
PfwAlarm
PFWDrvr
TxtSrv
The diagram below illustrates how data is received from P-CIM servers, translated by callback protocol
and sent to the OPC Gateway.
The data is then translated by OPC protocol and sent to external OPC clients. This is a bidirectional
process.
the
OPC item settings can be updated during runtime, If you wish to define new items or settings before
the OPC client runs, open the Gateway manually.
To open the Gateway manually: From the P-CIM Runtime icons group double click the OPC
Gateway Editor icon.
28
Field
Description
Synchronous
Read
When enabled the OPC Browser polls the OPC Gateway for advised items every
60 seconds using synchronous read..
Synchronous
Write
When checked enables the OPC Browser to write advised items values in
synchronous connection.
Case Sensitive
Communication
test interval
Defines the time interval between each communication test. Default = 30 seconds.
Range: 10-36000 seconds.
Communciation
test attempts
Defines the number of communication attempts that will be made by the OPC
Browser until failed. Default = 3 attempts. Range: 1-100
Time between
reconnect
attempts
When P-CIM is not running, it is automatically started up if the OPC Gateway icon is double clicked in
the P-CIM Group. Right clicking the OPC Gateway traybar icon displays three options:
About: when clicked displays details about P-CIM and the OPC Gateway.
29
To access OPC Gateway Editor dialog box: From the traybar right click the OPC Gateway icon and
select the Edit option.
Description
Name
Server
Indicating the type of P-CIM server used, which can be: BasicSrv, DBSR,
PfwAlarm, PfwDrvr or TxtSrv.
Note: The BasicSrv, PfwDrvr, and TxtSrv.servers items can only be assigned to
OPC items in the P-CIM OPC Gateway Editor dialog box.
Topic
Indicating the name of the DDE format topic, which is always Pcim.
Item
Data type
Indicating the type of data block. The following block types are available:
Boolean, byte, double, float, long, short and string.
Access
Indicating whether the item is Read, Write or Read and Write in the OPC client.
Table
Add
Delete
Change
Save
Close
30
Field
Settings
Name
Item 1
Server
DBSR
Topic
Pcim
Item
D:1
Data type
Boolean
Access
Read
1.
2.
Complete the dialog box fields using the information in the table above
t
3.
4.
To view/ read/ write the OPC item, connect the OPC client to the OPC Gateway.
If the OPC client is already connected it may need refreshing manually when new items are
added.Other OPC clients are automatically updated.
31
Branch
Containing
PfwOPCGateway.Server
Indicates which OPC key is used to reference the OPC server. This
name is automatically displayed in the Servers List in the client.
DBSR
PfwAlarm
User
This branch is a container for the OPC items defined in the OPC
Gateway Editor.
32
This situation could occur because the OPC server is case sensitive. The following definitions must be
set when working with an OPC server that is case sensitive:
The OPC Browser fails to connect to the OPC server,or connects but does not
display the OPC tree..
Possible Cause: Single Thread Connections to OPC Servers
The OPC server is connected via a single-thread connections (and not via multi-thread connections).
The following definitions must be set when connecting to an OPC server in a single-thread connection:
33
NO-SEK Stations
P-CIM No-SEK station is able to connect to a remote OPC server only if the P-CIM Master node is
equipped with a site License and Unlimited IO SEK support.
From a NO-SEK node, the OPC Browser will only be able to connect to a remote OPC server which
resides on the P-CIM-Master station.
Message
Description
34