You are on page 1of 25

SOFREL PCWin - OPC Server

Function Specifications File


V 2.34
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 2

LACROIX Sofrel
2, rue du Plessis
35 770 VERN SUR SEICHE

Telephone: 02 . 99 . 04 . 89 . 00 Fax: 02 . 99 . 04 89 . 01

SOFREL PCWin - OPC Server

Function Specifications File

Reference........ : PCW-DSF_OPCV232-ag.doc
Version ........... : V 2.34
Date ................ : 18 June 2007
Classification.... : Public

By.................. : Gilles ROUAULT

Approved by........ : MB

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 3

LIST OF UPDATES
First version : 1.10 Date: 09 / 07 / 98
Previous version : 2.33 Date: 26 / 10 / 05

DESCRIPTION OF MODIFICATIONS

Date Name Paragraphs Reasons

V 1.11 :
24/9/99 GR References Added reference [1] and renumbered
1.1 Added reference [1]
2.3.2.1 New paragraph
2.3.2.2 New paragraph
2.3.2.3 New paragraph
V 1.12 :
22/10/99 LL 2.3.2.1 Modified description of the ACK item
GR 2.3.2.1 Added explanation on HOLDCOMM and STOPCOMM
Added SENDING item and modified description of
ACQUISITION
V2.10
05/05/00 LL Document entirely overhauled document
V2.11
14/11/00 LL 2.2 Added trace levels; TraceLev in [Global] section
2.4, 2.5 et 2.8.1 Description of HISTRATE item
2.7 Added BASERATE parameter
2.8.3 Details on UPDATE item
2.8.3.3 Description of SECTION3 corrected
V2.12
09/03/01 LL 2.4 Description of functioning of HSTARTNOTIFY for handling initial
history values.
2.5 Description of functioning of HISTPOLL for handling stamp-
dated value searches.
V2.13
11/12/03 LL 2.5 Description of the functioning of history polling from V2.0.23.
V2.30
02/03/04 PL 2.8, 2.3 Added groups of stations from server version 2.0.30.
V2.32
7/04/05 LH 2.2 Addition of a level of traces operator to replace the traces meter
of reference from server version 2.0.32.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 4

V2.33
SG Change of document number to match server version.
V2.34
24/04/07 LH / SF 3.2.1 Addition of the AlwaysNotify key
2.8 New pagination
Deletion of the paragraph covering OCCibleNotification
2.3
mechanism implementation
2 Addition of a general architecture diagram
2.5 Archive management: the archive viewing summary/history
alternation no longer exists. Each item is dealt with according to
type (history or summary).
Addition of the description of the new viewing mode
implemented from this version 2.0.34.

3.2.1 Addition of the “Lot” key

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 5

REFERENCES

[1] OPC Data Access Custom Interface Specification V1.0a (OPCDA10A.doc)

[2]: OPC: OLE for Process Control: a communication standard based on


OLE/COM technology, which is the new data exchange method between MS-
Windows applications.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 6

CONTENTS

1. INTRODUCTION 7
1.1 Purpose 7
1.2 Reference documents 7
1.3 Terminology and abbreviations 7
1.3.1 Terminology 7
1.3.2 Abbreviations 7

2. DESCRIPTION OF FUNCTIONALITIES 8
2.1 Starting PCWin 8
2.2 Trace management 8
2.3 Browser management 10
2.4 Managing time-stamped values 10
2.5 Managing archives 11
2.6 Multiple client management 12
2.7 Asynchronous communications management 13
2.8 OPC items 13
2.8.1 SYSTEM Variable 14
2.8.2 Station parameters 16
2.8.3 Station variables 17
2.8.4 Station group parameters 22

3. OPERATING CONDITIONS 23
3.1 Operating environment 23
3.2 Configuration file 23
3.2.1 Main configuration file 23
3.2.2 Station configuration files 25

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 7

1. INTRODUCTION

1.1 Purpose
This document presents OPC server implementation specifications based on
SOFREL’s PCWin software. The server implements the functionalities of the OPC
2.0 standard.

1.2 Reference documents


Reference Title
OPC standard Data Access Custom Interface Standard v2.0
June 19, 1998
External SOFREL Document Interfacing PCWin with a OPC v1.70 server

1.3 Terminology and abbreviations


1.3.1 Terminology
PCWin is a remote monitoring and control software package for SCADA central
stations developed by SOFREL. It provides data access to SOFREL remote
terminal units and centralizes the data on the SCADA central station. PCWin can
be controlled via a PLC based on OLE Automation. The PLC is used in PCWin’s
client software.

1.3.2 Abbreviations
Not applicable.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 8

2. DESCRIPTION OF FUNCTIONALITIES
The functionalities available in the SofrelOPCServer server allow standardized access to the
data in Sofrel supervisory control stations and the PCWin software package. Data access is
based on COM/OLE technology and occurs via OPC 2.0 interfaces. Optional interfaces are
only implemented if they can be of any use in a server running PCWin.
The SofrelOPCServer server is available in two versions, which are functionally identical with
regard to the OPC 2.0 standard. The first version is an in-process server (implemented
though a dynamic library), and the second version is a local or remote server (implemented
in an executable).

Sofrel
PCWin OPC OPC OPC
Server Client

2.1 Starting PCWin


The SofrelOPCServer server starts PCWin when first connecting, if PCWin is not
already running. It does not shut down PCWin when it stops, because it is not
necessarily the only PCWin user. However, it is possible to force PCWin to stop
using OPC function “SYSTEM/STOP”.
When PCWin is not running, an OPC client can restart it using the “SYSTEM/GO”
function.

2.2 Trace management


The SofrelOPCServer server transmits traces during the main operations that occur while it is running. The
traces issued are classified by trace level. Trace levels represent trace category groups, which can all be
independently activated through bit combinations. The existing categories of traces are listed in the following
table:

Index of bit in Trace Prefix used for this Active trace category
level level category
0 1 IN/OUT Input/output trace for functions

1 2 ACCESS Accessor call trace (values read and written)

2 4 CYCLE Trace of object lifecycle events (construction and


destruction)

3 8 ALGO Trace of algorithm usage

4 16 CALLS Trace of function results (parameters and results of the


call)

5 32 OLE I/O Input/Output trace OLE interface methods

6 64 OLE CALL OLE interface methods result trace (parameters and


results of the call)

7 128 SUIVIOP Operator-level trace (functional monitoring with the names


of items OPC in light)

8 to 31 NO TRACE Reserved

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 9

The prefix is a character string placed prefixing the trace message proper
identifying the category the message trace.
The trace level is a global operating parameter of the SofrelOPCServer, which is
defined even when no clients are connected and identified. It can be modified
statically with the aid of the “TraceLev” key in the [Global] section of the server
configuration file called “SofrelOPCServer.ini ”, which resides in the “OPC” subfolder
of the PCWin installation folder. Any such modifications only take effect when the
SofrelOPCServer is restarted. This parameter can also be modified dynamically with
the aid of OPC component “SYSTEM/TRACELEV”. This type of modification takes
effect immediately and is stored in the server configuration file. The default value of
trace levels is 0, which corresponds to no trace.
These traces are sent by default to an instance of the XS_CSuiviApp.exe PCWin
application. The OPC server automatically starts this program when a trace is
requested. It automatically stops XS_CSuiviApp.exe when it ends, which causes the
monitoring window to close.
The user can however close this monitoring window at any time, in which case the
traces are sent to the debugger controlling execution of the SofrelOPCServer via the
OutputDebugString function (if the debugger is running). The monitoring window can
be reopened by modifying the server’s trace level.
Trace level changes in an existing monitoring window reuse the same window.
However, only traces of the new level are sent to the window when levels change.
Trace messages are formatted as follows:
Client: date time function[line]: (SUCC|ERR)[result]{ : message}
Optional message components are surrounded by square brackets. The
expressions in brackets are syntax groups. The ‘|’ operator indicates a choice
between two possible expressions.
The date format is DD-MM-YYYY and the time format is HH :MM :SS.SSS.
Function names are explicit and take into account the complete name space in
which the function is defined (class or namespace name). The result is returned
either with the “SUCC” keyword if the operation was successful or with the “ERR”
keyword. The full error message is surrounded by curly braces after the result. If the
error has no description, its full error code is returned in hexadecimal format. The
“message” part is optional and only appears for certain trace messages. It is used
more particularly for messages of the CALLS category to indicate the list of
parameters and the function’s return value.
Activity traces of various different clients are differentiated by prefixing them with the
client name whenever possible. The name is supplied by the client when it calls
IOPCCommon::SetClientName, or a name automatically generated by the server
using the ID the client supplies in “SYSTEM/CLIENTID”. However, for the execution
of internal server functions (timer recall and PCWin functions), for which there is no
client as such, the name cannot be that of a client. Internal operation traces are
therefore identified as “SofrelOPCServer”.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 10

2.3 Browser management


The OPC server handles system configuration through a data tree structure called
“browser”. The browser handles the OPC interfaces and also acts as a level-2
cache, PCWin itself being a level-1 cache for station variables.
The browser is created when the server starts and is initialized with data supplied by
PCWin. It is then kept synchronized with the PCWin configuration through the
notifications it receives when:
‚ a datapoint is added to PCWin (variable, station or group of stations) ;
‚ a datapoint is deleted (variable, station or group of stations) ;
‚ a datapoint is renamed (variable, station or group of stations) ;
‚ a datapoint is modified (change in the value of any variable’s attribute).

2.4 Managing time-stamped values


Time-stamped values are accessible via OPC item “variable/HVALUE”. An
alternative way of accessing them is via OPC item “variable/VALUE” thanks to
configuration parameter HISTMIX, which can equal 0 or 1. Its default value is 0,
which allows time-stamp values to be read via OPC item HVALUE. If however its
value is forced to 1, time-stamped values are transferred to OPC item VALUE and
HVALUE is then invalid.
The value of the HISTMIX parameter can then be statically modified with the aid of
the “HistMix“ key in the [Reprise] section of the server configuration file.
SofrelOPCServer must be restarted for such changes to take effect. It can also be
dynamically modified with the aid of OPC item “SYSTEM/HISTMIX”. This type of
modification takes effect immediately and is saved in the server configuration file.
To handle the case of clients that cannot receive several history values in a single
notification, successive notifications can be issued separated by a time delay. It can
be checked with the HISTRATE parameter in the [Reprise] section of the server
configuration file. This parameter can also be dynamically modified with the aid of
item OPC “SYSTEM/HISTRATE”. Each group rounds up the specified time delay to
the next value by a multiple of its update rate. A nil value corresponds to burst
operation, in which all history values are transferred in a single notification.
HVALUE history values are only notified when new values are available in the
PCWin archives. As a result, these items are flagged OPC_QUALITY_BAD when a
client logs on, and no value must be returned to it. To allow initial notification of the
last reported value for the clients who so desire, the HSTARTNOTIFY parameter
has been added to the [Global] section of the server. When it equals 1, the last
reported value for a client is notified for each subscription to a HVALUE item. In
such cases the client program has to handle any duplicate history values it receives.
This parameter is also dynamically accessible via item SYSTEM/HSTARTNOTIFY.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 11

2.5 Managing archives


History and report data for the PCWin archive server can be accessed via specific
station variable attributes. OPC items can be defined for these attributes using the
“variable/attribute” syntax. Attribute names vary according to variable type (TC, RC,
TM, etc…).
A timer controls periodic polling of the archive server to retrieve the data. Polling
time is determined by the HISTPER configuration parameter, which is expressed in
minutes (its default value is 5). It can be statically modified under “HistPer” in the
[Reprise] section of the server configuration file. This type of modification only takes
effect when the server restarts, however, it can be automatically modified by means
of OPC item “SYSTEM/HISTPER”.
Systematic polling of the archive server can be deactivated by setting HISTPOLL
parameter in the [Global] section to 0, in which case polling of clients only occurs if
the last date of communication with the station postdates the client’s the last station
polling date. This improvement means that station calls are only performed when
they are necessary. If the HISTPOLL parameter is set to 1, polling systematically
occurs when the timer runs out. In such cases the station does not have to be called
to retrieve new histories. This optimization is activated by default.
From version 2.0.23, the OPC server detects modifications in the PCWin database
and retrieves the data at each period if there has been a write operation. Parameter
HISPOLL has no further purpose and is ignored.
The rate of returning report values is also controlled by system item
“SYSTEM/HISTRATE”, which is described in the section dealing with time-stamped
values.
From version 2.0.34 onwards and in order to improve server performance, all items
to view are broken down into sets. This breakdown into sets allows the server to
provide faster notification for its OPC clients in the event of a very large
configuration.
The maximum number of items per set is defined in the [Global] section "Lot”
parameter; the default value is 100 items.
Furthermore, the report/history viewing alternation no longer exists; items are
viewed independently of their type (history or summary).

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 12

2.6 Multiple client management


The SofrelOPCServer server accepts several simultaneous client connections.
However, since the in-process version is dynamically linked to each executable
using it, it can only handle clients in the same addressing space. The local server
version on the other hand makes no distinction between clients, who are all located
in different addressing spaces.
A COPCServer object is created when clients log on. This object is only used for a
particular client. However, server data are shared among all such objects. More
particularly, there is only one instance of the browser per instance of the
SofrelOPCServer server (in-process or executable). All modifications made by a
client are therefore immediately taken into account by the other clients. In particular,
the values of system items (archive polling period, communication mode with PCWin
stations, datapoint management via OPC item “variable/VALUE” and active trace
level) are common to all clients. The only exception to this rule is OPC item
“SYSTEM/CLIENTID”, which represents the client ID and is unique to each client.
This item is therefore an attribute of the COPCServer class. Modification of this item
by one of the groups is therefore acknowledged by all the groups the server has
created. The groups of other server objects are not notified of this modification.
The client can identify itself directly via the OPC item using the syntax
“SYSTEM/CLIENTID(ID)”, where ID is the client number. Clients do not have to
identify themselves to use the OPC server, in which case they are automatically
assigned ID 0. Several clients can use the OPC server without being identified, but
in such instances the SofrelOPCServer server cannot guarantee that all clients will
receive all the notifications for time-stamped data.
The recovery files used for each client are located in subfolder “OPC\n” in the
PCWin installation folder, where “n” is the client ID. However, the configuration files
for client 0 remain in subfolder “OPC” to remain compatible with version 1.0 of the
SofrelOPCServer server. So it is important that clients systematically identify
themselves via item “SYSTEM/CLIENTID” using the same ID, to ensure that history
and report polling dates for client 0 are not transmitted to several clients.
Client identification must occur within a specified time limit, according to the items
added at the start of this group. The default timeout is 10 seconds, bit it can be
modified in the server’s general configuration file. During the timeout, the
COPCServer component disables notification mechanisms for all its groups, and
historical data are not transmitted immediately. However, this timeout stops as soon
as the client identifies itself, at which point all groups are re-enabled.
It is also advisable for the client to record a name in the server via the
IOPCCommon::SetClientName method. This name is used by the trace mechanism
to identify the name under which traced calls are made. If the client fails to provide
its name or is a “OPC 1.0a client”, the default name “Client n” is generated and used
(“n” being the client ID). Furthermore, the generic name “SofrelOPCServer” is used
for tracking processes not connected with client activity. Among other things, this
concerns initialization processes and processes occurring during callbacks from
PCWin and timers.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 13

2.7 Asynchronous communications management


The SofrelOPCServer server handles asynchronous queries of the IOPCAsyncIO
and IOPCAsyncIO2 interface b creating objects that describe asynchronous
operations and placing them in a list of asynchronous operations to be performed.
This list is maintained at the level of the group receiving the asynchronous query.
Asynchronous operations stored in this list are then executed in the background
when a timer callback function is called. Similarly, notifications of OPC items whose
variables they reference have been modified are also performed asynchronously by
the same timer’s callback function.
The timer’s basic default interval is 100 ms, but this can be modified in parameter
BASERATE in the [Global] section of the server configuration file. Asynchronous
operations are however only performed every 100 server notifications, which
therefore corresponds to a default interval of 1 second between two executions. For
each asynchronous operation performed, a notification is sent to the client that
issued the query. The notification uses the standard notification mechanism of the
IDataObject OLE interface. Asynchronous operation objects are then deleted from
the list of operations to be performed.
By default, the server can store an arbitrary number of asynchronous queries
awaiting execution. However, this behavior can be changed by setting a value for
the “MaxIOPending” key in the configuration file. This key contains the maximum
number of operations awaiting execution that the server can accept for each type of
asynchronous operation (read, write or refresh). This key’s default value is 0,
meaning there is no limit to the arbitrary number of operations.

2.8 OPC items


The syntax for OPC items uses the paths in the browser’s tree structure to reference
the attributes of the variables referenced by the items. The separator used in these
paths is ‘/’ (forward slash). The root is not specified. The SYSTEM variable can be
accessed by using the name “SYSTEM”, and the list of stations is accessed using
the name “STATIONS”. The stations themselves are placed on the STATIONS
branch and can be accessed by using the names specified in the PCWin
configuration.
The various attributes accessible in the different variables are referenced in the
following sections.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 14

2.8.1 SYSTEM Variable


The SYSTEM variable contains attributes providing access to the main
configuration options of the SofrelOPCServer server. Among these items, only
the SYSTEM/CLIENTID item is distinct for each COPCServer component.
Name Type Attribute
HISTMIX VT_BOOL OPC_READABLE, OPC_WRITEABLE
When this flag is set to TRUE, time-stamped data can be transferred to the VALUE field instead of
the HVALUE field of stations variables.

Name Type Attribute


HISTPER VT_I4 OPC_READABLE, OPC_WRITEABLE
This parameter indicates the polling time for PCWin archives for retrieving report and history data. It
is expressed in minutes, its default value being 5. It cannot be set to 0.
Name Type Attribute
HISTINT VT_I4 OPC_READABLE, OPC_WRITEABLE
This parameter is a number of days before the current date and determines the start date for report
and history data searches, the end date being the current date. Its default value is 7 days. This
parameter is ignored during subsequent searches, and the start date is the date of the last value
retrieved by the previous search.
Name Type Attribute
HISTRATE VT_I4 OPC_READABLE, OPC_WRITEABLE
This parameter indicates the rate at which history and report values are retrieved (one notification
per value). Its value corresponds to a number of milliseconds between each notification. Its default
value is nil, corresponding to a burst mode of data retrieval. In this mode, all datapoints are
retrieved in a single notification. This mode is more efficient, but is not supported by all clients.
Name Type Attribute
HSTARTNOTIFY VT_BOOL OPC_READABLE, OPC_WRITEABLE
This parameter allows the last notified value for a client to be retrieved when subscribing to an item
of the HVALUE type. Its default value is 0, meaning no initial notification.
Name Type Attribute
RUNNING VT_BOOL OPC_READABLE
This attribute determines whether no not PCWin is active.
Name Type Attribute
STOP VT_BOOL OPC_WRITEABLE
Setting this attribute value to TRUE forces PCWin to stop.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 15

Name Type Attribute


GO VT_BOOL OPC_WRITEABLE
Setting this attribute value to TRUE starts PCWin.
Name Type Attribute
COMIMM VT_BOOL OPC_READABLE, OPC_WRITEABLE
This parameter puts PCWin in immediate or deferred communication mode with regard to stations
for transmitting setpoints.
Name Type Attribute
TRACELEV VT_I4 OPC_READABLE, OPC_WRITEABLE
This parameter represents the trace level used by the OPC server. Trace level 0 means “no trace”.
Changing trace level displays a PCWIN monitoring server window if it is not already open or has
been closed.
Name Type Attribute
CLIENTID VT_I4 OPC_READABLE, OPC_WRITEABLE
This attribute lets a client identify itself at the level of the OPC server. Clients must ensure that their
ID is unique at server level. Furthermore, they must reuse the same ID for each session. This ID
allows the server to determine resume dates for report and history data polling.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 16

2.8.2 Station parameters


Station parameters are common to all the stations.
Name Type Attribute
CALL VT_BOOL OPC_WRITEABLE
Setting this attribute value to TRUE forces PCWin to poll a station.
Name Type Attribute
HOLDCOMM VT_I4 OPC_READABLE, OPC_WRITEABLE
If this attribute is written, the station is polled continuously for the specified period of time if the
station is not in communication, or modifies the time period if the station is already in
communication. The unit in question is the second.
Name Type Attribute
STOPCOMM VT_BOOL OPC_WRITEABLE
Setting this attribute’s value to TRUE stops in advance current communications initiated via the
HOLDCOMM or CALL attribute, by an mechanism internal to PCWIN or by the station itself on a
spontaneous call.
Name Type Attribute
VALIDITY VT_BOOL OPC_READABLE
This parameter determines the validity of a station. A station is invalid when so configured in PCWin
or when PCWin is not running. The data of an invalid station is invalid, which means that the last
known values in the OPC server’s cache are returned instead.
Name Type Attribute
ACK VT_UI1 OPC_READABLE, OPC_WRITEABLE
This parameter specifies the alarm acknowledgement management rule, its possible values being:
‚ 0: no acknowledgement management;
‚ 1: acknowledgement;
‚ 2: no acknowledgement.
The writing of this parameter is only taken into account for the current communication.
Name Type Attribute
CODATE VT_BSTR OPC_READABLE
This parameter determines the last date on which a station was polled. This date is returned by
PCWin when it finishes polling the station. It is formatted in accordance with the date-formatting
conventions for Windows users.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 17

2.8.3 Station variables


Station variable attributes vary according to the type of variable. They are
described for each type in the following sections:

2.8.3.1 TS-type variables


Name Type Attribute
VALUE VT_BOOL OPC_READABLE
This attribute provides access to the variable’s value.
Name Type Attribute
HVALUE VT_BOOL OPC_READABLE
This attribute reads the last time-stamped value for this variable.
Name Type Attribute
EVTCOUNT VT_R8 OPC_READABLE
This attribute gives the value of the daily report event timer.
Name Type Attribute
TIMER VT_R8 OPC_READABLE
This attribute gives the value of the daily report’s time meter.
Name Type Attribute
ACQUISITION VT_BOOL OPC_READABLE
This attribute determines the origin of the value. Variables with this parameter set to FALSE are
generated by PCWin, the others being retrieved from the station.
Name Type Attribute
VALIDITY VT_BOOL OPC_READABLE
This attribute determines the validity of the variable. A variable in invalid when so configured in
PCWin or when PCWin is not running. The values returned by invalid variables are those stored in
the browser’s cache.
Name Type Attribute
UPDATE VT_BSTR OPC_READABLE
This attribute determines the last time the value was updated in PCWin (whether or not it was set in
the operator dialog box, by the communication or by the OPC client). This date is updated further to
any PCWin notification, even if the value in question has not changed. This item therefore qualifies
the value’s validity irrespective of bandwidth mechanisms. The format used for this date complies
with the formatting conventions for the user currently logged on to Windows.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 18

2.8.3.2 TC-type variables


Name Type Attribute
VALUE VT_BOOL OPC_READABLE, OPC_WRITEABLE
This attribute provides access to the value of the variable. Writing this item forces the related
FORCED item to TRUE, and transmits if COMIMM = TRUE (or stores it in the PCWin’s buffer zone
PCWin if COMIMM = FALSE).
Name Type Attribute
HVALUE VT_BOOL OPC_READABLE
This attribute reads the last time-stamped value for this variable.
Name Type Attribute
FORCED VT_BOOL OPC_READABLE, OPC_WRITEABLE
This attribute indicates forcing of the TC setpoint. FALSE means that the setpoint is free, and TRUE
means that it has been forced by the SCADA central station. Writing this item causes polling of the
station if COMIMM = TRUE.
Name Type Attribute
SENDING VT_BOOL OPC_READABLE
This parameter determines where any modifications made to this variable’s values will be sent.
FALSE indicates that the target is PCWin and that the datapoint is handled internally, while TRUE
indicates that the value will be sent to the station.
Name Type Attribute
VALIDITY VT_BOOL OPC_READABLE
This attribute determines the validity of the variable. A variable is invalid when so configured in
PCWin or when PCWin is not running. The values returned by invalid variables are those stored in
the browser’s cache.

Name Type Attribute


TOSEND VT_BOOL OPC_READABLE
This attribute indicates the state of setpoint transmission. Its possible values are as follows:
‚ FALSE for a setpoint sent to the RTU;
‚ TRUE for a setpoint awaiting transmission to the RTU.

Name Type Attribute


UPDATE VT_BSTR OPC_READABLE
This attribute determines the last update of the value in PCWin (whether or not it was set in the
PCWin operator dialog box, by the communication or the OPC client). This date is updated further
to PCWin notifications, even if the value in question has not changed. This item therefore qualifies
the value’s validity irrespective of bandwidth mechanisms. The format used for this date complies
with the formatting conventions for the user currently logged on to Windows.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 19

2.8.3.3 RC-type variables


Name Type Attribute
VALUE VT_R8 OPC_READABLE
This attribute provides access to the value of the variable.
Name Type Attribute
HVALUE VT_R8 OPC_READABLE
This attribute reads the last time-stamped value for the variable.
Name Type Attribute
SECTION1 VT_R8 OPC_READABLE
This attribute indicates the value of the first section in the daily report.
Name Type Attribute
SECTION2 VT_R8 OPC_READABLE
This attribute indicates the value of the second section in the daily report.
Name Type Attribute
SECTION3 VT_R8 OPC_READABLE
This attribute indicates the value of the third section in the daily report.
Name Type Attribute
INDEX VT_R8 OPC_READABLE
This attribute gives the value of the counting index at the time of the daily report.
Name Type Attribute
ACQUISITION VT_BOOL OPC_READABLE
This attribute determines the origin of the value. Variables with this parameter set to FALSE are
generated by PCWin, the others are retrieved on the station.
Name Type Attribute
VALIDITY VT_BOOL OPC_READABLE
This attribute provides the validity of the variable. A variable is invalid when so configured in PCWin
or when PCWin is not running. The values returned by invalid variables are those stored in the
browser’s cache.
Name Type Attribute
UPDATE VT_BSTR OPC_READABLE
This attribute determines the last update of the value in PCWin (whether or not it was set in the
PCWin operator dialog box, by the communication or the OPC client). This date is updated further
to PCWin notifications, even if the value in question has not changed. This item therefore qualifies
the value’s validity irrespective of bandwidth mechanisms. The format used for this date complies
with the formatting conventions for the user currently logged on to Windows.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 20

2.8.3.4 TM-type variables


Name Type Attribute
VALUE VT_R8 OPC_READABLE
This attribute provides access to the value of the variable.
Name Type Attribute
HVALUE VT_R8 OPC_READABLE
This attribute reads the last time-stamped value for the variable.
Name Type Attribute
MINVAL VT_R8 OPC_READABLE
This attribute indicates the minimum value of the daily report.
Name Type Attribute
AVGVAL VT_R8 OPC_READABLE
This attribute indicates the average value of the daily report.
Name Type Attribute
MAXVAL VT_R8 OPC_READABLE
This attribute indicates the maximum value of the daily report.
Name Type Attribute
ACQUISITION VT_BOOL OPC_READABLE
This attribute determines the origin of the value. Variables with this parameter set to FALSE are
generated by PCWin, the others are retrieved on the station.
Name Type Attribute
VALIDITY VT_BOOL OPC_READABLE
This attribute provides the validity of the variable. A variable is invalid when so configured in PCWin
or when PCWin is not running. The values returned by invalid variables are those stored in the
browser’s cache.
Name Type Attribute
UPDATE VT_BSTR OPC_READABLE
This attribute determines the last update of the value in PCWin (whether or not it was set in the
PCWin operator dialog box, by the communication or the OPC client). This date is updated further
to PCWin notifications, even if the value in question has not changed. This item therefore qualifies
the value’s validity irrespective of bandwidth mechanisms. The format used for this date complies
with the formatting conventions for the user currently logged on to Windows.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 21

2.8.3.5 RA-type variables


Name Type Attribute
VALUE VT_R8 OPC_READABLE, OPC_WRITEABLE
This attribute provides access to the value of the variable. Writing this item forces the related
FORCED item to TRUE, and transmits if COMIMM = TRUE or stores it in the PCWin’s buffer zone
PCWin if COMIMM = FALSE.
Name Type Attribute
HVALUE VT_R8 OPC_READABLE
This attribute reads the last time-stamped value for the variable.
Name Type Attribute
FORCED VT_BOOL OPC_READABLE, OPC_WRITEABLE
This attribute indicates forcing of the RA set point. FALSE means the setpoint is free, and TRUE
indicates that it has been forced by the SCADA central station. Writing this item causing polling of
the station if COMIMM = TRUE.
Name Type Attribute
SENDING VT_BOOL OPC_READABLE
This parameter determines where any modifications made to this variable’s values will be sent.
FALSE means that it will be sent to PCWin and handled internally, and TRUE means that the value
will be sent to the station.
Name Type Attribute
VALIDITY VT_BOOL OPC_READABLE
This attribute indicates the variable’s validity. A variable in invalid when so configured in PCWin or
when PCWin is not running. The values returned by invalid variables are those stored in the
browser’s cache.
Name Type Attribute
TOSEND VT_BOOL OPC_READABLE
This attribute indicates the state of setpoint transmission. Its possible values are as follows:
‚ FALSE for a setpoint sent to the RTU;
‚ TRUE for a setpoint awaiting transmission to the RTU.

Name Type Attribute


UPDATE VT_BSTR OPC_READABLE
This attribute determines the last update of the value in PCWin (whether or not it was set in the
PCWin operator dialog box, by the communication or the OPC client). This date is updated further
to PCWin notifications, even if the value in question has not changed. This item therefore qualifies
the value’s validity irrespective of bandwidth mechanisms. The format used for this date complies
with the formatting conventions for the user currently logged on to Windows.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 22

2.8.4 Station group parameters


Stations group parameters are common to all station groups.
Name Type Attribute
CALL VT_BOOL OPC_READABLE, OPC_WRITEABLE
Writing TRUE to the value of this attribute forces PCWin to poll a group of stations.

Name Type Attribute


VALIDITY VT_BOOL OPC_READABLE, OPC_WRITEABLE
This parameter determines the validity of a group of stations. A group of stations is invalid when so
configured in PCWin or when PCWin is not running. The validity of a group can be modified by
OPC. When a group of stations is declared invalid, all current and pending automatic and periodic
polling is deactivated. When a group is validated, automatic and periodic polling is validated.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 23

3. OPERATING CONDITIONS

3.1 Operating environment


The SofrelOPCServer server works with any client compatible with the OPC 2.0
standard.
It is supplied both in the form of a DLL file containing the server management
components and as a standalone executable file. These COM components must be
registered in the registry before being used. This must be done using the
REGSVR32.EXE utility for the DLL server, specifying the “/RegServer” option on the
command line for the EXE server.
The InProc (DLL) server is registered under the name SofrelOPCServer.
The Local (EXE) server is registered under the name SofrelOPCServerExe.

3.2 Configuration file


3.2.1 Main configuration file
The SofrelOPCServer server uses configuration file “SofrelOPCServer.ini”, which
resides in the “OPC” subfolder of PCWin’s installation folder. This configuration file
contains the server’s general persistent data. Its syntax is as follows:

[Reprise]
HistMix = 0
HistPer = 5
HistInt = 7
HistRate = 0
ComImm = 0
[Global]
BaseRate = 100
StartDelay = 10
MaxIOPending = 0
TraceLev = 0
AlwaysNotify = 0
Lot=100

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 24

The [Reprise] section contains the “HistMix”, “HistPer”, “HistInt”, “HistRate” and
“ComImm” keys.
‚ “HistMix” key is a DWORD-type key taking values 0 or 1. When set to 1, it transits time-
stamped values for a datapoint to OPC VALUE items instead of transmitting them to HVALUE
items.
‚ “HistPer” key is a DWORD-type key containing PCWin archive polling times in minutes for
histories and reports. Its default value is 5 minutes. the value 0 is prohibited and cannot be
used.
‚ “HistInt” key is a DWORD-type key containing the number of days to subtract from the current
date to determine the first polling date when the server is first started. Its default value is 7 days.
‚ “HistRate” key is a DWORD-type key containing the timeout in milliseconds between two
notifications for the history and report values of a given item. Its default value is 0,
corresponding to combined retrieval of all histories in a single notification (burst mode).
‚ “ComImm” key is a DWORD-type key that can be set to 0 or 1. Setting it to 1 forces PCWin to
communicate with the stations immediately. Its default value is 0, which allows PCWin to defer
communications with the stations and to group and process queries in sets.

NB: all these keys can be dynamically modified using the OPC server’s “system”
item. Such modifications take effect immediately and the new values are
saved in the SofrelOPCServer.ini configuration file.
The [Global] section contains the “BaseRate”, “StartDelay”, “MaxIOPending”,
“TraceLev” and “AlwaysNotify” keys.
‚ “BaseRate” key is a DWORD-type key. It expresses the base rate in seconds for the timer used
to execute asynchronous operations and transmit histories. Its default value is 100 milliseconds.
‚ “StartDelay” key indicates the amount of time allowed for clients to identify themselves by
means of the item OPC “SYSTEM/CLIENTID” before the first item notifications occur. It is
expressed in seconds, its default value being ten.
‚ “MaxIOPending” sets the maximum number of operations pending execution for each type of
asynchronous operation. Its default value is 0, which means there is no limit to the number of
pending operations.
‚ “TraceLev” key is a DWORD-type key containing the trace levels used by the OPC server. Its
default trace level value is 0, meaning no trace. This value can be dynamically modified with the
aid of the “SYSTEM/TRACELEV” item.
‚ "AlwaysNotify" key is a BOOLEAN key; it determines the server’s behavior when optimizing
the number of notifications for a VALUE item change. When this key is 0 (default value), the
server makes a single notification for several simultaneous operations (subscription,
synchronous or asynchronous read, refresh). When this key is 1, the server performs a
notification for each operation.
‚ Optional "Lot" key is a DWORD key; it determines the number of items to process in a set when
consulting the archiving server. Its default value is 100.

NB: none of these keys (with the exception of “TraceLev”) can be dynamically
modified by an OPC server item.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.
SOFREL PCWin - OPC Server - Function Specifications File - V 2.34
11 July 2007 25

3.2.2 Station configuration files


The SofrelOPCServer server also uses an .ini file for each client and station
declared in the PCWin configuration file; they each contain the dates of the last
variable polling for the station and client in question. The structure of these
configuration files is the same for all the clients. Station configuration files are
grouped by client in subfolders in the server configuration folder. These folders
are named using the client ID in OPC item “SYSTEM/CLIENTID” or using a
default ID number.
For client ID 0, the files are stored in the server configuration folder to ensure
backward compatibility with the version 1.0 server.
Each “.ini” file contains a section for each station variable. The keys of these
sections are respectively named according to the various attributes of these
values as they appear in the syntax for OPC items. These are string-type keys
containing the value of the last date on which the attribute was queried. The date
format used is the Windows DATE.

This document is the property of LACROIX Sofrel and may not be disclosed to any third part without its written permission.

You might also like