CyPro OPC Server Manual v3
CyPro OPC Server Manual v3
Robotina d.o.o.
Industrijska cesta 2b
6310 Izola, Slovenia
tel: ++386 5 663 2420
fax: ++386 5 663 2439
e-mail: [email protected]
AP-CYP-700-002-240602
Table of contents • What is CyPro OPC Server?
Table of contents
Table of contents .............................................................................................................. 2
Introduction....................................................................................................................... 3
What is CyPro OPC Server?.................................................................................. 3
Concepts & Features ............................................................................................. 3
OPC Fundamentals................................................................................................ 4
OPC Objects and Interfaces ........................................................................ 4
OPC Data Access Overview........................................................................ 4
Hardware Requirements ........................................................................................ 5
Installation .............................................................................................................. 6
User Interface ................................................................................................................... 7
Main Window.......................................................................................................... 7
Toolbar ................................................................................................................... 7
Project Tree & Project Item View ........................................................................... 8
Root ............................................................................................................. 8
Project.......................................................................................................... 8
Programming Device ................................................................................... 9
Socket .......................................................................................................... 9
Project Item Bar ................................................................................................... 10
Status Bar............................................................................................................. 10
Menus................................................................................................................... 11
File menu.............................................................................................................. 11
Commands menu................................................................................................. 11
Using CyPro OPC Server............................................................................................... 12
Registering and Unregistering CyPro OPC Server .............................................. 12
Adding CYP Project ............................................................................................. 12
Updating CYP Project .......................................................................................... 12
Removing CYP Project ........................................................................................ 13
Deleting programming device .............................................................................. 13
Hiding/showing Tags............................................................................................ 13
Renaming Tags.................................................................................................... 14
Setting/forcing Tag Value..................................................................................... 14
Configuring CyPro OPC Server ........................................................................... 15
Using CyPro OPC Server and CyPro Simultaneously......................................... 16
Debugging VCP network...................................................................................... 17
Tag pairing ........................................................................................................... 18
Licensing ........................................................................................................................ 19
Appendix......................................................................................................................... 20
Keyboard Shortcuts.............................................................................................. 20
Toolbar Buttons Reference .................................................................................. 20
Error Messages.................................................................................................... 20
2
Introduction • What is CyPro OPC Server?
Introduction
In this chapter the following topics will be introduced:
• basic information’s
• OPC fundamentals
• hardware requirements
• installing
Other chapters will be dealing with user interface and various aspects of CyPro OPC Server.
For information’s about VCP technology and CyPro programming environment, please refer to
the CyPro Manual and the appropriate hardware manual.
PC
RS232
VCP
Information necessary for its work CyPro OPC Server gets from CyPro project, i.e. CYP file.
CYP file contains information on NADs, programming devices or PRGs and sockets. Every
variable in socket is represented as single tag. CyPro OPC Server can import more then one
CYP file, so it can control many VCPs, running different programs, in network.
For User interface CyPro OPC Server uses concept of Windows Explorer. On left side you see
Project Tree, and on the right side is Project Item View which varies according to Project Item
currently selected.
To ease engineer’s life CyPro OPC Server has some interesting features:
3
Introduction • OPC Fundamentals
CyPro OPC Server does not support public groups and persistent storage; these features are
optional by OPC specification.
OPC Fundamentals
OPC is based on Microsoft’s OLE/COM technology.
OPC
OPC Client Server
Vendor B
OPC
Server
Vendor C
Different vendors may provide OPC Servers. Vendor supplied code determines the devices
and data to which each server has access, the data names, and the details about how the
server physically accesses that data.
OPC
Server
Vendor A
OPC
OPC Client #1 Server OPC Client #2
Vendor B
OPC
Server
Vendor C
OPC Client #3
The OPC Groups provide a way for clients to organize data. For example, the group might
represent items in a particular operator display or report. Data can be read and written.
Exception based connections can also be created between the client and the items in the
group and can be enabled and disabled as needed. An OPC client can configure the rate that
an OPC server should provide the data changes to the OPC client.
There are two types of groups, public and local (or ‘private’). Public is for sharing across
multiple clients, local is local to a client. Refer to the section on public groups for the intent,
purpose, and functionality and for further details. There are also specific optional interfaces
for the public groups.
Within each Group the client can define one or more OPC Items.
4
Introduction • Hardware Requirements
Group
Item 1
Item 2
Item 3
The OPC Items represent connections to data sources within the server. An OPC Item, from
the custom interface perspective, is not accessible as an object by an OPC Client. Therefore,
there is no external interface defined for an OPC Item. All access to OPC Items is via an OPC
Group objects that “contains” the OPC item, or simply where the OPC Item is defined.
Associated with each item is a Value, Quality and Time Stamp. The value is in the form of a
VARIANT, and the Quality is similar to that specified by Fieldbus.
Note that the items are not the data sources - they are just connections to them. For example,
the tags in a DCS system exist regardless of whether an OPC client is currently accessing
them. The OPC Item should be thought of as simply specifying the address of the data, not as
the actual physical source of the data that the address references.
Hardware Requirements
Any PC capable of running MS Windows 98 is satisfactory, although the recommended
minimum is Pentium 166 with 32Mb RAM and Windows NT 4.0. CyPro OPC Server will
occupy about 3Mb of the disc space. A standard RS232 COM port is required for data
transfer. Some VCPs are equipped with the RS485 serial port only, and in such case, the
external RS232/RS485 converter is required.
5
Introduction • Installation
Installation
To install CyPro OPC Data Access Server, start the installation archive and follow the
instructions.
No files are copied to the windows directory. No windows system files will be replaced or
changed.
To uninstall CyPro OPC Server first shut down server if it is running, then start Control Panel,
Add/Remove Programs, select CyPro OPC Data Access Server and press Add/Remove
button.
Uninstall procedure removes all installed components and registry entries. User created files,
i.e. configuration data, will not be deleted.
6
User Interface • Main Window
User Interface
This chapter will introduce you to CyPro OPC Server user interface. It will explain all parts of
main window and show how they interact between themselves. Information presented here is
intended for quick introduction to CyPro OPC Server. Details will be covered in next chapter.
• Main window
• Toolbar
• Project Tree & Project Item View
• Project Item Bar
• Status Bar
• Menus
Main Window
Main window consists of Project Tree, Project Item View, Project Item Bar, Toolbar and Status
Bar. Most important sections are Project View and Project Item View. Every node in Project
Tree has corresponding Project Item View.
Toolbar Project Tree Project Item Bar Project Item View
Toolbar
Toolbar section is located just under main menu. As in other Windows applications its function
is to speed up use of application. All actions on toolbar can be performed from keyboard or
menu so toolbar can be turned off. This is done either by unchecking View/Standard toolbar
item or by right clicking at the menu and unchecking Standard toolbar item. If you need larger
tool buttons you can turn on text labels the same way. With text labels toolbar can become
quite large so you can enable toolbar wrapping; tool buttons will be distributed in more than
one line.
Following figure displays wrapped toolbar with text labels turned on. Details on each tool
button will be explained in next section.
7
User Interface • Project Tree & Project Item View
Figure 8 - Toolbar
Root
In Root View you can get overview on current state of CyPro OPC Server. View is divided into
two parts. In upper you can see which projects are imported in CyPro OPC Server. Displayed
data are Project Name and complete Project Filename (including path). From this view you
can add, update or delete project, and hide or show all tags in project; these actions will be
explained in detail in following chapter.
Important part here is Server info. Here you can see when is server started, working time, how
many clients are connected, group count for all connections, total tag count and maximum tag
count allowed by license.
Project
Project View offers list of programming devices in project and project description. Possible
actions here adding, updating or deleting project and deleting programming device. Also
possible are hiding and showing all tags in project or selected programming device. Details on
these actions are in next chapter.
8
User Interface • Project Tree & Project Item View
Programming Device
As previous view, Programming device View is very simple, it offers list of sockets for selected
programming device. You can see socket NAD, direction and description. Actions allowed
here are same as for previous view plus “Delete programming device”. Details on these
actions are in next chapter.
At the bottom of the view you can see programming device NAD and socket count.
Socket
In Socket View you can see details for selected socket: names of all tags along with their type,
quality, timestamp and value. Tag name represents path to tag. It can comprised of project
name, programming device NAD, direction, sender or receiver NAD, and socket variable
name, depending on the configuration settings. Here you can do same actions as in previous
view plus override/force tag value. Details on these actions are in next chapter.
9
User Interface • Project Item Bar
Located at the bottom of the view are some information’s about currently selected socket. You
can see socket description, direction, NAD, tag count and network cycle time (amount of time
passed from last send/receive).
One very useful feature in debugging is socket communication notification. When socket is
communicated on VCP network its icon will flash. Output sockets flash green and input
sockets flash yellow.
Status Bar
Status bar is located at the bottom of the window. Its primary use is to show current
communication status. It is divided in five sections. In first you can see hint text; it’s a brief
description of selected tool button or menu item. Second section is indicator if configuration
has been modified. Next is tag count section. In it you can see total tag count versus
maximum tags allowed by license. Fourth section shows communication status for selected
COM port. Last section features two LEDs; they show COM port activity: Tx for transmitting,
and Rx for receiving.
10
User Interface • Menus
Menus
Important CyPro OPC Server menus are File and Commands, they provide following actions:
File menu
Menu item Shortcut Description
New configuration Ctrl + N New configuration
Open configuration Ctrl + O Opens previously saved configuration.
Save configuration Ctrl + S Saves OPC Server configuration
Save configuration as Saves OPC Server configuration with new name
Add project Ctrl + P Adds CYP project to configuration
Delete project Delete CYP project form configuration
Update project Update CYP project in configuration
Update All Update all CYP projects in configuration
Client shutdown Requests shut down of connected client
Server shutdown Shut down CyPro OPC Server
Exit Close CyPro OPC Server form
Commands menu
Menu item Shortcut Description
Connect/disconnect Ctrl + D Connect/disconnect server to COM port
Delete programming device Delete programming device from configuration
Set PLC/SCADA tag value Override tag value
Force PLC/SCADA tag value Force tag value
Stop forcing Stop forcing tag value
Hide tags Hide tags
Show tags Show tags
Rename Rename selected tag
Revert to original name Rename to tag’s original name
Config Ctrl + G Brings up CyPro OPC Server configuration dialog
When CyPro OPC Server is minimised to system tray you can access some of its features by
right clicking CyPro OPC Server icon in system tray. By double clicking tray icon you will show
CyPro OPC Server main window.
11
Using CyPro OPC Server • Registering and Unregistering CyPro OPC Server
If for some reason you need to unregister CyPro OPC Server you can do this by selecting
Commands/Config/Unregister CyPro OPC Server. Unregistration is performed automatically
during CyPro OPC Server uninstallation. If you unregistered CyPro OPC Server, to use it, you
must register it again.
Project can also be imported by clicking on the toolbar or by right clicking on Root
View icon or any Project View icon in the Project Tree and then selecting Add.
12
Using CyPro OPC Server • Removing CYP Project
If you choose to update project with tags referenced by OPC client you will be asked for
confirmation. Confirmation is needed because tag handles are lost so OPC client behavior can
become unpredictable as it will try to access tags that no longer exists on server. If possible all
tag renames are preserved.
You can also update all projects in CyPro OPC Server. That is done by selecting File/Update
CYP project can also be removed by clicking tool button or by right clicking on
Project View icon in the Project Tree and then selecting Delete.
In case some tags from the project you want to delete are used by OPC client you will be
warned and asked for confirmation. Choices you are offered are: Yes for force deleting of
project; No for cases where you are deleting more then one project, only those without
referenced tags will be deleted; Cancel to cancel deleting.
If you force delete project with referenced tags OPC client behavior may become
unpredictable; it will try to access tags which no longer exist on server.
on tool button.
Hiding/showing Tags
When you import CYP project all of its tags are distributed to OPC clients. For large projects
this can be very bothersome. For instance if project has 2 programming devices and 4 sockets
with 10 tags on average, that is 80 tags, and you are interested only in few. CyPro OPC
Server enables you to remove unnecessary tags by hiding them from OPC client.
Hidden tag is indicated by small stop sign at the upper left corner of tag icon. That notification
is also visible on tag’s parent socket icon.
13
Using CyPro OPC Server • Renaming Tags
In case some tags, you are trying to hide, are referenced by OPC client you will be warned
and asked for confirmation. Offered choices are: Yes for force hiding of tags; No for cases
where you are hiding more then one tag (i.e. hiding whole socket), only unreferenced tags will
be hidden; Cancel to cancel hiding.
If you force hiding of tag that is referenced, OPC client behavior may become unpredictable; it
will try to access tags which no longer exist on server (it exists, but is completely hidden from
OPC client).
Tags can again be shown to OPC client following the same principles for tag hiding.
Renaming Tags
In CyPro OPC Server default tag name is comprised of project name, NAD of programming
device, direction, socket NAD and socket var name or only some of them, depending on
configuration settings. This names are often cumbersome, so CyPro OPC Server enables you
to rename tags. Tag can be renamed in several ways: you can press F2, you can click again
on already selected tag, you can right click tag and select Rename or you can do it by
selecting Command/Rename. Tag name must be unique. By right clicking on tag you can
select Original name and revert tag name to original.
In case tag you are trying to rename is being referenced by OPC client you will be warned and
asked for confirmation.
If you force rename of tag that is referenced, OPC client behavior may become unpredictable;
it will try to access tags which no longer exist on server (it exists, but under new name).
You can stop forcing tag value by selecting tag(s) and clicking tool button.
Setting/forcing tag value can works with multiselect. Tag value checking is performed with
respect to tag type. For example only valid values for bit type are 0 or 1.
14
Using CyPro OPC Server • Configuring CyPro OPC Server
CyPro OPC Server can connect to A-bus with several COM ports simultaneously. Which COM
ports are used is determined by checking COM1 through COM8 check boxes.
OPC server NAD is CyPro OPC Server network address. To other VCPs in network CyPro
OPC Server is just another VCP, so it has to have it’s own network address (NAD). NAD must
be unique on netwok, i.e. CyPro OPC Server cannot have same address as some other VCP
in netwok. It is strongly recommended that you leave OPC server NAD at deafult value of 1.
Uncertain value timeout specifies the relative amount of time which should elapse from last
socket send or receive before changing communication status to Uncertain. Bad value timeout
specifies the relative amount of time which should elapse from last socket send or receive
before changing communication status to Bad. Both timeouts can be set separately for input
and output sockets. If timeout value is set to 0 then that timeout is disabled. In general, the
following condition should be respected:
Data change check interval is rate at which CyPro OPC Server will check for data changes; for
changed tags OPC callback event will be generated and OPC client notified of data changes.
15
Using CyPro OPC Server • Using CyPro OPC Server and CyPro Simultaneously
In CyPro OPC Server tag names are constructed from project name, NAD, socket name and
variable name. Which of these components are used is determined by checking appropriate
check boxes in “Tag naming” group.
Some SCADA toolkits (Wizcon) have problems with the names larger than 32 or some other
number of characters. CyPro OPC Server can issue warning if some of the tags have names
longer then specified number of characters. Whether warning is active is determined by Warn
if tag name is longer then X characters check box where X is replaced by desired number of
characters.
Show window if no parameters check box determines if CyPro OPC Server main window is
shown when server is started as standalone application.
CyPro OPC Server offers one feature especially handy in cases of possible malfunctioning:
logging. You can enable/disable logging by checking appropriate checkboxes. Checking Log
events checkbox causes CyPro OPC Server to record all OPC interface calls. If Log data
callbacks is checked CyPro OPC Server will record all DataChange callbacks; this can occur
very frequently and cause log file to grow large very quickly. If you experience problems with
CyPro OPC Server you should enable logging and send log file to technical support along with
bug report. Log file is located in same directory as CyPro OPC Server executable.
CyPro COM
VCP VCP VCP
OPC COM
If one or both VCP’s are not physically close to VCP, it is possible to use RS232/A-bus
converter instead.
CyPro COM1
OPC VCP VCP VCP
COM2
CyPro COM
VCP VCP VCP
OPC
16
Using CyPro OPC Server • Debugging VCP network
This solution should be used if only one computer and only one serial port is available. To
work with CyPro, CyPro OPC Server should be manually disconnected and vice versa. To do
this, both programs have command to disconnect serial port.
To disconnect serial port in CyPro, right click to NAD field on status bar, and select “none”.
To disconnect serial port in CyPro OPC Server, use toolbar button “Connect/Disconnect”.
Please note that network master should be also handled manually. For programing/monitoring
(CyPro) network master should be stopped. For using A-bus network with CyPro OPC Server,
network master should be configured and running.
To read more about A-bus network please read CyPro User Manual, section Networking.
Communication activity indicator shows any communication that happens on selected COM
ports. Green light indicates sending, red light indicates receiving. Socket icon will also flash
when it is received or sent.
COM port status can show status of only one COM port. By right clicking port status panel you
can select which COM port you will monitor. Communication status can be in following states
Communication status
good communication is OK
uncertain two seconds passed since last socket communication
bad “Bad quality timeout” happened since last socket communication
disconnected communication is inactive; possible reasons are missconfigured or
inactive network master, disconnected or improperly connected
communication cable, etc.
Another feature is “Network cycle time” property located in Socket View. It shows amount of
time (in ms) passed between two communication cycles for that socket and is measured for
each socket in configuration.
In CyPro OPC Server tag quality is mostly affected by communication status and time passed
between two communication cycles. Communication timeouts are adjusted in config dialog
(Commands/Config) and they will determine change in quality. To help you spot problems with
tag qualities icons of “bad” or “uncertain” tags are grayed. This graying of icons can be seen in
Project Tree and propagates through whole branch, right up to the root item. If all tags in the
socket are of good quality their icons are displayed in color.
17
Using CyPro OPC Server • Tag pairing
Tag pairing
Tag pairing is aspect of CyPro OPC Server that requires special attention. Some applications
need to modify some value in VCP on both SCADA side and VCP side through operator
panel. That situation, due to A-bus limitations, should be handled by using tag pairs feature.
Due to the A-bus and socket architecture, problem may arise when value should be changed
from both sides, VCP and SCADA. That values are transferred in separate sockets so values
from OPC can overlap values in VCP and vice versa.
To solve problem you need to use tag pairing. It is process by which you logically connect two
tags from different sockets. One tag is from input and other from output socket. When tags are
paired they are not treated by CyPro OPC Server as two separate tags but as one.
Tag pairing is performed by making modifications to VCP code. You will need to perform
following steps for every variable that needs to be changed on SCADA and VCP side.
1. For each paired variable allocate two additional variables, with suffixes "_pair" and
"_pair_old". For example, for variable sp you should add sp_pair and sp_pair_old.
All variables should be of same type.
2. In your CyPro code add following lines:
That is all. After project add or update CyPro OPC Server automatically recognizes paired
tags and behaves accordingly. Paired tag icons are displayed with overlaid letter P in lower left
corner.
Synchronization between OPC and VCP is done in following way: paired tags in OPC server
have two states idle and change. Normally tag is in idle state. When tag value is changed from
OPC side, tag goes into change state. Tag value then must do at least one (at most two)
roundtrip to and from VCP. After every roundtrip it is checked if received value is same as sent
one and if is tag returns into idle state. Tag can also return to idle state if value cannot
roundtrip and "Uncertain timeout" occurs. Only when tag is in idle state, base variable value
(socket incoming in OPC server) is copied into _pair variable (socket outgoing from OPC
server) and thus returned to VCP.
18
Licensing • Tag pairing
Licensing
Licensing (activation) of CyPro OPC Server is very easy. You may choose between several
license models:
If your application uses more tags then maximum tag number allowed by license, OPC server
will not stop immediately, but after two hours. After that time communication will stop, all tag
values will be set to 0 and qualities will be set to OPC_QUALITY_OUT_OF_SERVICE (bad
quality). This allows developers to test even the biggest application without licensing.
To order a license from your supplier, you should provide following information:
You will be given an activation code. This code should be entered in Help/Activation code.
New license will be accepted immediately, you don’t have to restart OPC Server.
19
Appendix • Keyboard Shortcuts
Appendix
Keyboard Shortcuts
Key Action
Ctrl + D Connect/disconnect from A-bus
Ctrl + G CyPro OPC Server Configuration
Ctrl + M Minimize to system tray
Ctrl + N New configuration
Ctrl + O Open configuration
Ctrl + P Add project
Ctrl + S Save project
F2 Rename tag
Error Messages
CFG-001: Invalid NAD
• NAD must be numerical value; can occur during configuring CyPro OPC
Server
CFG-002: Invalid uncertain value timeout
• Uncertain value timeout must be numerical value, and cannot be lower
then 1; can occur during configuring CyPro OPC Server
CFG-003: Invalid bad value timeout
• Bad value timeout must be numerical value, and cannot be lower then
Uncertain value timeout; can occur during configuring CyPro OPC Server
CFG-004: Invalid data change check interval
• Data change check interval must be numerical value, and cannot be lower
then 1; can occur during configuring CyPro OPC Server
CFG-006: Data change check interval cannot be modified while there are groups
created
20
Appendix • Error Messages
21