148
OPC Factory Server User's Manual

User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Embed Size (px)

Citation preview

Page 1: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

OPC Factory Server

User's Manual

Page 2: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft
Page 3: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

___________________________________________________________________________1

OPC Factory Server Contents

Section Page

EN

GLI

SH

OPC Factory Server

Page 4: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

___________________________________________________________________________

2

OPC Factory Server Contents

Section Page

EN

GLI

SH

Page 5: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

___________________________________________________________________________3

OPC Factory Server Contents

Section Page

EN

GLI

SH

1 Presentation 1/1

1.1 Introduction 1/1

1.2 PLC Compatibility 1/2

1.3 Communication Media Supported 1/2

2 Installation 2/1

2.1 Contents of the Product 2/1

2.2 Hardware and Software Configuration 2/2

2.3 Installation Procedure 2/4

2.4 Defining the Parameters for Local or Remote Operation 2/7

3 Configuration Tool 3/1

3.1 Description 3/1

3.2 Server Tab 3/3

3.3 Symbols Tab 3/5

3.4 Alias Tab 3/7

3.5 Analog Tab 3/9

3.6 MB serial Tab 3/10

Page 6: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

___________________________________________________________________________

4

OPC Factory Server Contents

Section Page

EN

GLI

SH

3.7 Simulator Tab 3/10

3.8 Misc. Tab 3/11

3.9 Advanced Tab 3/12

3.10 GUI : Menus, Tool Bar and Status Bar 3/12

3.11 Saving/Restoring Configuration 3/13

3.12 OFSconf Options 3/14

4 Functions of the Product 4/1

4.1 Definition of a Group of Items 4/1

4.2 Synchronous Services : Read / Write 4/1

4.3 Asynchronous Services 4/2

4.4 Periodic Read Service 4/3

4.5 Mechanism for Adjusting the Communication Time-Out with a

Device 4/4

4.6 Mechanism for Managing the PLC Operating Mode 4/4

4.7 Mechanism for Accessing the OFS Server 4/5

4.8 Symbolic Support 4/6

4.9 Browse Support 4/6

Page 7: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

___________________________________________________________________________5

OPC Factory Server Contents

Section Page

EN

GLI

SH

4.10 Concept Link 4/6

4.11 Simulator 4/7

5 Type of variables handles by the server 5/1

5.1 PL7 Variables 5/35.1-1 Standard Objects 5/35.1-2 Grafcet Objects 5/45.1-3 Standard Function Blocks 5/55.1-4 Table Objects 5/6

5.2 Concept Variables 5/8

5.3 ModSoft variables 5/9

5.4 Local Variables 5/10

6 Using the Server 6/1

6.1 Introduction 6/1

6.2 The Operating Phases of the OFS Server 6/2

6.3 Groups of Items 6/3

6.4 Managing Tables 6/4

6.5 Consistency of the Read Operation 6/5

6.6 Consistency of the Write Operation 6/6

6.7 Asynchronous Operation 6/7

Page 8: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

___________________________________________________________________________

6

OPC Factory Server Contents

Section Page

EN

GLI

SH

6.8 Using Periodic Reading 6/8

6.9 Using Dead-Banding 6/96.9.1 Definition 6/96.9.2 Description of the Dead-Banding Mechanism 6/96.9.3 Using Dead-Banding in a Client Application 6/10

6.10 Adjusting the Time-Out 6/12

6.11 Managing the PLC Operating Mode 6/12

6.12 Communication 6/13

6.13 Managing the Symbols 6/176.13-1 PL7 exported symbol table file 6/186.13-2 PL7 exported application file 6/186.13-3 Concept exported symbol table file 6/196.13-4 Modsoft exported symbol file 6/196.13-5 CSV symbol table file 6/20

6.14 Browse support 6/21

6.15 Managing Standard PL7 Function Blocks 6/23

6.16 Concept Link Support 6/23

6.17 Error Handling 6/246.17-1 Error Feedback Mechanism 6/246.17-2 Objects Outside the Software Configuration 6/27

6.18 Specific Items 6/28

Page 9: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

___________________________________________________________________________7

OPC Factory Server Contents

Section Page

EN

GLI

SH

7 User's Guide 7/1

7.1 OPC custom 7/1

7.2 Description of the OLE Automation Interface Exposed 7/27.2-1 Error Codes 7/47.2-2 CreateObject : Creating the OFS Server in Visual Basic 7/47.2-3 AddGroup : Creating a Group of Items 7/57.2-4 RemoveGroup : Removing a Group of Items 7/87.2-5 AddItems : Adding Items to a Group 7/97.2-6 OPCRead : Reading the Items in a Group 7/127.2-7 ActiveStatus : Activation/Deactivation of the Periodic

Reading of a Group 7/157.2-8 OnDataChange : Periodic Reception of Notifications 7/167.2-9 AddCallbackReference : Subscribing to the Notification

Service 7/187.2-10 DropCallbackReference : Unsubscribing to the Notification

Service 7/197.2-11 PercentDeadBand : Managing the Dead-Banding of a

Group 7/207.2-12 OPCWrite : Writing Items in a Group 7/217.2-13 GetErrorString : Obtaining an Error Message 7/237.2-14 MajorVersion : Information on the OFS Server 7/25

8 Performance 8/1

8.1 Target Performance 8/1

Page 10: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

___________________________________________________________________________

8

OPC Factory Server Contents

Section Page

EN

GLI

SH

9 Appendix 9/1

9.1 Tutorial on Creating a Client Application in Visual Basic 9/19.1-1 CreateObject : Creating an OPC Server Object 9/49.1-2 AddGroup : Adding a Group 9/59.1-3 AddItems : Adding Items in a Group 9/69.1-4 OPCRead : Synchronous Reading of a Group 9/79.1-5 Periodic Reading of the User Group 9/89.1-6 OPCWrite : Writing the Value of the Items in a Group 9/119.1-7 DropCallbackReference and RemoveGroup : Closing the

Tutorial 9/129.1-8 GetErrorString : Managing OPC, OFS and Win32 Errors 9/139.1-9 MajorVersion : Information on the OFS Server 9/14

9.2 Tutorial on Creating a Client Application in C ++ 9/159.2-1 Creating an OPC Server Object 9/169.2-2 Adding a Group 9/169.2-3 Adding Items to a Group 9/179.2-4 Synchronous Reading of a Group 9/179.2-5 Periodic Reading of the User Group 9/179.2-6 Writing the Value of the Items to a Group 9/179.2-7 Closing the Tutorial 9/189.2-8 Managing OPC, OFS and Win32 Errors 9/18

9.3 OFS server compatibility 9/19

9.4 Glossary 9/20

9.5 Abbreviations 9/21

9.6 Recommendations in the Event of a Problem 9/22

9.7 Exhaustive List of Error Codes 9/239.7-1 Main errors defined by OLE 9/239.7-2 Errors Defined by the OPC Standard 9/249.7-3 Errors Defined by the OFS Server 9/25

Page 11: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Presentation 1

___________________________________________________________________________

1/1

EN

GLI

SH

Section 11 Presentation

1.1 Introduction

OFS (OPC Factory Server) is a multi-PLC data server able to communicate with real-time I/O devices in the TSX Compact, TSX Micro, TSX Momentum, TSX/PCX/PMXPremium and TSX Quantum families, and serve data to OPC clients.

This means that it provides a group of services (primitives) to client applications foraccess to control system variables.

OFS is OPC (Version 1.01a) compliant, i.e. it will function with any OPC (Version1.01a) compliant client and with two types of OPC compliant software :

• Ready-to run supervisory software from any vendor (in this case, the OFS will actas a driver, providing connection to any Schneider Automation supported PLCs),

• Custom developed supervisory software using either the OLE automation or OLEcustom interface.

Note:

Knowledge of one of the following languages is required when creating a client applicationfor the OFS, in particular for OLE Automation, OLE Custom programming and exceptionmanagement :

• Microsoft Visual Basic, version 5.0 or later, SP3,

• Microsoft Visual C++, version 5.0 or later,

• Microsoft VBA in Excel, version 8.0 (Office 97) or later.

Valve, %MW0

OFS

ServerClient

Read (PLC@ no.1,"Pump",...)

Write (PLC@ no.2,"%MW0",...)

PLC #2: Premium PLC #3: Micro

Clientsapplications O

LEA

utom

atio

n

OLE

Aut

omat

ion

Interface exposed

Pump, %MW1

PLC #1: Quantum

Page 12: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

1/2

___________________________________________________________________________

EN

GLI

SH The OFS server provides the interface between a group of PLCs and one or more

client applications in which the values of some of the data of these PLCs are to beviewed and/or modified.

The main characteristics are :

• Multi-PLC,

• Multiple communication protocols,

• Multi-client,

• Access to variables via address or symbol,

• Local or remote access to server,

• Exposes its services via both the OLE Automation and OLE Custom interfaces,

• Compatible with the OPC standard Version 1.01a.

1.2 PLC Compatibility

The OFS server operates with the Schneider Automation TSX Micro andTSX/PCX/PMX Premium PLC ranges (UNI-TE V2 communication protocol) as wellas the TSX Quantum, TSX Momentum and TSX Compact ranges (Modbus protocol).

The OFS server is not compatible with Series 7, Series 1000 SchneiderAutomation PLC ranges or A-linie (AEG).

1.3 Communication Media Supported

The OFS server is compatible with the following media :

• UNI-TE V2 Prototcol :

- UNITELWAY,

- FIPWAY,

- ISAWAY,

- ETHWAY,

- XIPWAY.

• Modbus Protocol:

- Modbus+,

- Modbus TCP/IP.

Page 13: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Installation 2

___________________________________________________________________________

2/1

EN

GL

ISH

Section 22 Installation

2.1 Contents of the Product

The OFS product comprises :

• One CD-ROM with setup instructions,

• Product Code ID.

Depending on your Product Code ID, the CD ROM may give you access to :

• The OFS server,

• The OFS simulator,

• The OFS Configuration Tool,

• XWAY Drivers,

• Documentation,

• Sample of Symbol Tables,

• OPC Clients :

- Tutorial Client in Visual Basic (including source code),

- Tutorial Client in C ++ (including source code),

- Test Client in Visual Basic (not supported*),

- Test Client in C ++ (not supported*),

- Test Client in HTML (not supported*),

- Test Client in Excel (not supported*).

Note :

The OFS product does not contain any cable for communication between the PC andthe PLC.

Note (*) :

The term "not supported" means that Schneider Automation does not provide anytechnical support for these tools and examples.

Note :

The documentation is in Acrobat Reader format (pdf file). If you don’t have this tool alreadyinstalled on your machine, it is given on the CD in the Redist\Acrobat directory.

Page 14: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

2/2

___________________________________________________________________________

EN

GL

ISH 2.2 Hardware and Software Configuration

Configuration for NT 4.0 and Windows 95 :

• Pentium 133 MHz (minimal configuration), Pentium 166 MHz (standard configuration) ,

• 32 Mb of RAM.

Recommended configuration for NT 4.0 :

• Pentium 200 MHz,

• 48 Mb of RAM for executing the client application,

• 64 Mb of RAM for developing the client application.

The OFS product requires a PC "Wintel" platform : Intel x86 processor with either of thefollowing Microsoft Windows 32-bit operating systems :

• Windows 95 upgraded with Service Pack 1 (or later) with the DCOM option ,

• NT 4.0 upgraded with Service Pack 3 (or later).

Note :

The DCOM option is necessary under Windows 95 even for running the OFS serverlocally. The DCOM version required is version 1.1 (or later) and is included on the OFSinstallation CD-ROM. To install DCOM, follow the instructions given in the ReadMe.txt fileon the installation CD-ROM in the Redist\W95\dcom directory.

Note :

The OFS product is not compatible with a RISC platform, in particular with NT 4.0on a Digital Alpha processor.

To determine which version of Windows and which service pack is installed on yourPC :

• Windows 95

Open the Control Panel, then click on the "System" icon, the displayed page shows yoursystem version :

- 4.0.950 = no service pack installed - install service pack 1,

- 4.0.950a = service pack 1 is installed, click on OK,

- 4.0.950b = service pack 2 is installed, click on OK.

To verify that DCOM is installed, Open the Control Panel, then click on the “Add/Remove Programs”.

If DCOM is installed, you should find a line : “ DCOM for Windows 95 ”.If you don’t have this line and you are sure that DCOM is installed (for instancebecause you installed Internet Explorer 4.0) go on and ignore the installshield warning.Otherwise you should install DCOM option before installing the server.

Page 15: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Installation 2

___________________________________________________________________________

2/3

EN

GL

ISHTo install DCOM, follow the instructions given in the ReadMe.txt file on the installation

CD-ROM in the Redist\W95\dcom directory.

• Windows NT

Open Programs\Administrative Tools\Windows NT\Diagnostics - your system versionis displayed, it should be at least :

- Version 4.0 (Build 1381: Service Pack 3).

Under NT4.0, DCOM is always installed.

Page 16: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

2/4

___________________________________________________________________________

EN

GL

ISH 2.3 Installation Procedure

Foreword :

Under NT 4.0, it is necessary to have sufficient administrator rights before executing theinstallation program (see Section 2.4).

The installation procedure for the OFS product is as follows :

Insert the CD-ROM in the CD drive. The CD is Auto-run, therefore if your PC is set up for thisfeature you should see the OFS main window as shown below. If Auto-run is disabled or doesn'twork :

• Click on the Start button in the taskbar,

• Select Settings -> Control Panel then click,

• Click on the Add/Remove Programs icon in the Control Panel,

• Click on the Install/Uninstall tab then click on the Install button and follow theinstructions,

• The Install Tool will automatically find the OFS Setup program on the CD, display the pathand file name then prompt you to conclude the installation.

The window shown below is displayed showing the OFS installation options.

The first thing to do is to enter into the dialog box either your CD-KEY or the wordDEMO in uppercase (the CD-KEY is your product-ID, located on a piece of paperincluded with the CD-ROM).

The following components may be installed (depending on your CD-KEY) :

- OFS Configuration Tool ,

- OFS Server ,

- XWAY Drivers :UNITELWAY,FIPWAY,ISAWAY,ETHWAY,XWAY TCP/IP.

Page 17: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Installation 2

___________________________________________________________________________

2/5

EN

GL

ISHNote :

The above components must be installed in the order of Configuration Tool, Server,Drivers.

1. Click on the black button labelled Configuration tool ,

• Follow the messages which appear on the screen to perform the installation.

• At the point where the installation program prompts for a directory, the defaultdirectory is C:\Program Files\Modicon Telemecanique.

Note:

During installation of the OFS Configuration Tool under Windows 95 , the followingwarning may be displayed :

"Setup cannot continue because some system files are out-of-date on yoursystem. Click on OK if you would like setup to update these files for you now. Youwill need to restart Windows before you can run setup again.Click Cancel to exit setup without updating the system files".

- Click the OK button,- Reboot when the system prompts you to,- Restart Windows 95 and install the OFS Configuration Tool again.

2.When installation of the Configuration Tool is complete, the installation start-upscreen is once more displayed - now click on Server ,

• Follow the messages which appear on the screen to perform the installation.

• The installation program offers the following options :

- Installation and parameter definition for the client and server stations :

- Installation (under "SERVER" directory) of the server for local AND remoteoperation,- Definition of the client station parameters for remote operation withthe server.

If this option is chosen, setup prompts for the name of the remote client -(\\<name of machine>). The remote client name may be entered in plain text,as a TCP/IP address (eg. 139.160.218.102) or as a Domain Name System(DNS) name.

Note :

To change from one type of installation to another, simply restart the installationprogram.

Page 18: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

2/6

___________________________________________________________________________

EN

GL

ISH - Optional installation (under "TUTORIAL" directory) of the Visual Basic and

C++ tutorials,

- Optional installation (under "NOTSUP" directory) of the programs which arenot supported (see Section 2.1),

- Optional installation of direct link to Concept V2.1 Programming Workshop(Concept is a programming tool from TSX Quantum, TSX Monentum PLCrange). Setup verifies the presence of the Concept Programming Workshopon the machine in the indicated directory.

Note :

Since the Configuration Tool and the VB tutorial programs were written using VisualBasic V5, any version of Visual Basic subsequently installed should be V5 in orderto avoid compatibility problems.

Comment :

When executing the installation program under Windows 95, messages indicatingproblems with version and corruption of Windows system DLL may appear (forexample : COMPOBJ.DLL, DDEML.DLL).

These messages should be ignored (Windows 95 automatically correctsthese problems), as they do not affect operation of the terminal.

3. To uninstall the OFS product, open "Add/Remove Programs" in the Control Panel,and delete "OFSconf V x.y.z IE xx" and "OPC Factory Server" as required.

Notes :

- In the case of an upgrade from a previous version, first uninstall the old versionand then install the new one. Performing an uninstall does not affect the parameterconfiguration data.

- Some problems may arise if the path of the destination directory (directory wherethe Server and Configuration Tool are to be installed) is too long and the hard driveon your PC has been converted from FAT to NTFS. In this case, try to use shortfile names.

e.g. C:\OFS - instead ofC:\Program Files\Modicon Telemecanique\OFS

In particular, avoid spaces in file names.

Page 19: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Installation 2

___________________________________________________________________________

2/7

EN

GL

ISH2.4 Defining the Parameters for Local or Remote Operation

The OFS server can operate in local and remote modes.

• Execution under Windows 95

Remote execution mode requires additional adjustment to be made using theDCOMCnfg.exe tool available from Microsoft.

- Server Station :

- Start DCOMCnfg.exe from the Windows\System directory,

- From the list in the Application folder select "Schneider-Aut OPC FactoryServer",

- Click on the "Properties" button - the "Properties" Dialog Box appears,

- In the security folder select "Use Custom Access Permission",

- Click on the "Edit" Button - the "Access Permissions" Dialog Box appears,

- Click on the "Add" button then add users and grant them access - thenclick on "OK" to close the Dialog Box,

- Close the “Properties” Dialog Box by clicking “OK” button.- In the default security tab, check the «Enable Remote Connections » checkbox- Close the «DCOMcnfg » Dialog Box by clicking «OK» button.- Reboot the PC

- Client Station :

- Start DCOMCnfg.exe from the Windows\System directory,

- From the Application folder click on the "Default Security" tab,

- In the "Default Security" folder click on the "Edit Default" button then edit/addusers and access rights. Close down the tool as above.

• Execution under NT 4.0

Remote execution requires additional adjustment to be made using theDCOMCnfg.exe tool supplied with NT 4.0.

These configuration settings must be made while logged on to the machine with anaccount having the necessary administration rights to give access and executionpermission to the Server station.

- Server Station :

- Start DCOMCnfg.exe from the Windows\System32 directory,

- From the list in the Application folder select "Schneider-Aut OPC FactoryServer",

Page 20: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

2/8

___________________________________________________________________________

EN

GL

ISH - Click on the "Properties" button - the "Properties" Dialog Box appears,

- Click on the "Identity" tab and select "The Interactive User",

- In the security folder, select "Use Custom Access Permission",

- Click on the "Edit" button, the "Acces Permission" dialog box appears,- Click on the "Add" button, add users and grant them access,

- Click on "OK" to close down the dialog boxes,

- Select "Use Custom Execute Permission",

- Click on the "Add" button, add users and grant them access,

- Click "OK" to close down the dialog boxes.

Note :

The following parameters (default parameters) must be defined in the "Defaultproperties" tab :

- Option : "Enable Distributed COM on this computer" checked,- Field : "Default Authentication level" set to "Connect",- Field : "Default Impersonation level" set to "Identify".

- Client station :

To give access rights to the server from the client station :"Default security" tab, select the rights for access and execution.

• Summary of OFS Server remote operation

OFS server OFS serveron Windows 95 on NT 4.0

Client application on Windows 95 YES YES

Client application on NT 4.0 YES YES

Notes :

- Under Windows 95, the OFS server must be started manually before any connectionattempt from a remote client.

- When the server is running under Windows 95, in case of connection problems, it maybe useful to modify the check box about DCOM security in the misc tab of the configurationtool (see 3.8).

Page 21: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Configuration Tool 3

___________________________________________________________________________

3/1

EN

GL

ISH

Section 33 Configuration Tool

3.1 Description

The OFS Configuration Tool is an essential component of the OFS product. Itenables the user to configure the OFS server and its simulator to interface withNetworks, Devices and Symbol Tables.

Notes :

- All modifications to the Server configuration are static - for them to take effect, the Servermust be shut down and restarted.

- All modifications are made in real-time in the Windows registry. You can follow what isbeing modified reading the status bar. You don’t need to quit the software to validate.

To run the OFS Configuration Tool, proceed as follows :

• Click on the Start button in the taskbar, then move the pointer to"Programs"\"Modicon Telemecanique"\"OFS Configuration Tool" and then clickthe left hand mouse button,

• The Configuration Tool main window opens as shown below,

Page 22: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

3/2

___________________________________________________________________________

EN

GL

ISH The OFS Configuration Tool window comprises a Menu Bar, with a Tool Bar under,

and eight Page Tabs. These are :

• Server : access to debug interface, customize shutdown procedure, definetrace log,

• Symbols : define the file extension of symbol table recognized by the server,

• Alias : define alias on driver, PLC address, symbol table,

• Analog : define analog type for dead banding,

• MB serial : future extension to parameter serial ports for ModBus serial protocol,

• Misc. : miscellaneous parameters,

• Simulator : rule of evolution of simulated variables for the simulatorOFS_simu.exe which shares all other parameters with the OFS.exeproduct,

• Advanced : server advanced parameters.

Each Tab accesses a page of configuration options. There is no default Tab, theactive Page is the last one used. The functions of each Page are now described inLeft-to-Right order.

Note :

All Icons, Buttons, Checkboxes, etc. are provided with "Tool Tips".

Page 23: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Configuration Tool 3

___________________________________________________________________________

3/3

EN

GL

ISH3.2 Server Tab

Within the "Server" Page Tab, the user may enter or modify parameters for ServerDebug Window Start-up, Server Shutdown or Log Trace Files.

In the "Debug Interface" frame, there are two Option Buttons to define server start-up parameters :

• Active,

• Not Active.

The default setting is "Not Active" meaning that the server appears only as an icon inthe taskbar. When in this state, you cannot open the server window, i.e. you cannotaccess the server debug features.

If you want to know what is appended when the server is started and when your clientapplication calls each OPC interface, you need to activate the server debug interface.Note however, that this option is reserved for advanced users, since you could modifythe state of an OPC group without using the dedicated interface from the clientapplication. Above the "Active" Option Button, there is an empty location for ahidden button. Add the "/HIDE" option in the OFSconf.exe shortcut, if you wish toshow the "Hidden" Option Button.

How to add an option will be discussed in section 3.12 "OFSConf options".

The "Hidden" option hides the server (no window, no icon in the taskbar). This could beuseful if you don’t want the end user to be able to close the server during a session.The user then has no means of knowing if the Server is running except, under NTonly , using the Windows NT Task Manager (press shift + ctrl + esc), "Processes" tab,search OFS.exe.

Within the "Shutdown" frame, you can customize the server shutdown procedure.Typically, this is useful in a DCOM environment with remote clients, to warn eachclient that the shutdown procedure is in progress. Each client must be properlydisconnected from the server before the end of server shut-down else the link with theserver will be lost.

The Shutdown Batch File offers the user the means to perform certain pre-programmedactions before Server shutdown (e.g.: send message warning Client of imminentshutdown).

The supplied batch sample :

"C:\Program Files\Modicon Telemecanique\OFS\Server\shutDown.bat"

demonstrates how to send a message to a remote client PC under NT. You need tocustomize this batch (edit it under NotePad) to indicate the name of the remotecomputer on your network.

Page 24: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

3/4

___________________________________________________________________________

EN

GL

ISH A Shutdown Batch File name may be entered in the Text Box provided or found using

the Browse facility, (the yellow "open" toolbar and the "open" menu become availablewhen you focus on the pathname type textboxes). An alternative way is to drag anddrop a batch file from Windows Explorer to OFSconf.exe

To enter text from the keyboard, place the pointer in the Text Box and click. Thepointer changes into the familiar text entry cursor. Validate your choice by clickingthe "OK" button to the right of the Text Box.

Additionally, a Shutdown Counter is provided where a numeric delay in seconds beforethe batch file is executed, may be entered. This counter is only used if a shutdownbatch file name has been specified. Default setting is 10 seconds.

The "Log Trace" frame offers the user the possibility to store debugging traces in a file.

Three Text Boxes for pathnames are provided for entry of Log Trace File names usedin Debug, Xway or Modicon protocols respectively.

An option is also provided in the form of a checkbox whether to overwrite the previouslog file. If selected of course, the contents of the previous log file are lost.

The "OPC spy mode" when checked, offers an enlarged option for debugging traces.

"Debug trace SDK symb" is associated with symbol management.

"Debug trace SDK opt" is associated with communication requests.

After server start-up, you can dynamically overwrite those options for the currentserver session only, via the "Misc.", "Spy mode", "Debug Symbol" and "Debug Request"menus, available when the "Debug Interface" is activated.

Page 25: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Configuration Tool 3

___________________________________________________________________________

3/5

EN

GL

ISH3.3 Symbols Tab

Within the "SYMBOLS" page, the user may define or edit the link between a SymbolTable file extension and Symbol Table file format recognised by the server.

By default, the grid is automatically populated with the following :

SUFfix Type of symbols table file

SCY PL7 exported symbols table file

FEF PL7 exported application file

TXT ModSoft exported symbols table file

PRJ ConCept project file

CCN ConCept exported symbols table file

CSV Comma Separated Values file

To define or edit an extension (generally three letters without a dot) :

• Double click on an empty or occupied field respectively in the "SUFfix" column. ADialog Box opens prompting you to enter/edit a file extension,

• Click on "OK" - the file extension is entered/modified in the selected field,

• Double click on the corresponding field in the "Type of Symbol Table file" column. AList Box opens displaying the available file formats. These are :

1. PL7 exported symbol table file,

2. ConCept exported symbol table file,

3. PL7 database (not available for the first version of the product),

4. ConCept database (requires the ConCept OFS Programming Workshopinstalled on the PC),

5. Modsoft exported symbol table file,6. Comma Separated Val (comma, space or tab separator in a text filegenerated by MS Excel).

• Click on your choice of file format, then click on "OK" - the chosen file format is thenentered in the selected field of the "Data base or neutral file" column.

• A click of the right mouse button displays a pop-up menu of supplementary editingoptions which change according to which zone of the page the pointer is positioned.The full complement of options are:

- Sort the column,

- Add an item,

- Modify this field,

- Delete all the row,

- Erase field(s).

Page 26: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

3/6

___________________________________________________________________________

EN

GL

ISH Note :

Do not specify the dot separator to the left of each extension.

In the "Consistency appli. in PLC / Symbols file" frame, you can specify what levelof safety you want for the coherence between the symbol tables and the applicationin the PLC :

• Strict level : on difference, the connection with the device will be rejected,

• Read only level : on difference, the device will be in read only mode,

• Warning level : on difference, a warning is returned to the client application.

Page 27: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Configuration Tool 3

___________________________________________________________________________

3/7

EN

GL

ISH3.4 Alias Tab

The "Alias" page allows the user to define/edit a label corresponding to a networkdriver, a PLC address and, if it exists, the symbol table of the variables used.

To define/edit an Alias :

• Double click on an empty or occupied field respectively in the "Alias" column. ADialog Box opens prompting you to enter or edit respectively the Alias string,

• Click on "OK" - the Alias string is entered/modified in the selected field,

• Double click on the corresponding field in the "<driver>:<PLC addr>" column. ADialog Box opens, displaying a list of Alias drivers and prompts the user to chooseone and enter/edit the corresponding PLC address. If the Alias driver is for a networkusing TCP/IP, the option is also given to enter/edit a DNS name. In this case, it is thedefinition entered/edited last (DNS or definitive PLC address) that appears in theselected field of the "<driver>:<PLC addr>" column on clicking "OK". For MBT, anadditional "Bridge" index could be entered.

A PreLoaD option (PLD Column) exists for the case when a symbol table is verylarge and would normally take several minutes to load. When selected (by enteringa 1 in the "PLD" column), the Preload option causes the symbol table to be loadedat Server start-up and no longer at the first creation of an item for the device. ThePreload option is disabled by entering "0" (zero) or by deleting the content of thecell in the "PLD" column.

Symbol tables may be defined by their entire path name or just by a file name whichhas been previously defined in a Default file folder. The Default file name and path maybe entered from the keyboard in the Text Box provided, it may be browsed or locatedwith the Windows Explorer then "Dragged and Dropped". Click on the "OK" button tovalidate.

Aliases may be created dynamically by a special tool - the "Extra Dynamic Alias" TextBox allows the user to define the number of entries available for extra Aliases. Enterthe desired number in the Text Box and click on the "Extra Dynamic Alias OK" buttonto validate. Default is 5 extra aliases.

The last column, "Comment", allows optional entry of a comment associated with analias.

• A click of the right mouse button displays a pop-up menu of supplementary editingoptions which change according to which zone of the page the pointer is positioned.The full complement of options is :

- Sort the column, Add an item, Modify this field, Delete all the row, Erasefield(s),

- NotePad (to be used on text files only).

Page 28: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

3/8

___________________________________________________________________________

EN

GL

ISH • The "Options" > "Preload all" allows checking of the PLD column for each alias

having a symbols table. Click again on the menu to uncheck the menu and reset thePLC column.

We recommend the defining of aliases if the end-user wishes to use the OPC browsefeature which shows the symbols to be entered in the OPC groups directly from theclient application.

Note :

It is not recommended to use more than one alias, simultaneously, for the same device withan associated symbol table. Only the symbol table of the first alias used for that device willbe loaded into memory.

Page 29: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Configuration Tool 3

___________________________________________________________________________

3/9

EN

GL

ISH3.5 Analog Tab

The "Analog" page is used for "Deadbanding" purposes. It permits the user todefine a Variable Range Label and assign minimum and maximum values to it. Foreach value, the Deadband is a percentage of the range assigned to that value. TheDeadband percentage is a Group attribute and serves to filter the notification ofwhen a float value changes.

To define/edit a Variable Range Label :

• Double click on an empty or occupied field respectively in the "Analog TypeName" column. A Dialog Box opens prompting you to enter or edit respectively,the label string,

• Click on "OK" - the label string is entered/modified in the selected field,

• Double click on the corresponding field in the "LOW Eng. Unit" column. A DialogBox opens, prompting the user to enter a numeric value corresponding to the lowend of the range,

• Double click on the corresponding field in the "HIGH Eng. Unit" column. A DialogBox opens, prompting the user to enter a numeric value corresponding to thehigh end of the range. Click on "OK" to finish.

Note :

The Configuration Tool will not permit a value less than that entered in the "LOWEng. Unit" field, to be entered in the "HIGH Eng. Unit" field.

• A click of the right mouse button displays a pop-up menu of supplementaryediting options which change according to which zone of the page the pointer ispositioned. The full complement of options is :

- Sort the column,

- Add an item,

- Modify this field,

- Delete all the row,

- Erase field(s).

• Click on the desired option to perform the action on the selected field.

Example of analog type :

Analog Type Name LOW Eng. Unit HIGH Eng. Unit

AnalogType -1.5 +2.4

Page 30: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

3/10

___________________________________________________________________________

EN

GL

ISH 3.6 MB serial Tab

Since the first version of OFS does not provide the support of ModBus serialprotocol, this tab is a future extension that allows parameter definition of the fourserial ports COM1 to COM4.

3.7 Simulator Tab

The Simulator is merely an instance of the Server running without any real devicesconnected. It is used typically in the DEMO version of the product.

A number of controls are provided for configuring the Simulator operation.

• In the "Simulator tuning" frame :

- Factor : relates to the time period by which variables are updated. If set to "1"(the default value), simulated variables are modified at the update rate of thegroup and each time a "read device" is performed (Synchronous or Asynchronous).If set to "N" (where N is an integer value greater than 1), there would be onechance in N that the simulated variable would be modified. Enter a positivenumeric value in the Text Box and click the "Max Value" button to validate.

- Max Value : indicates the maximum value for the simulated variables.

• In the "Initialization Values" frame :

When started, the Simulator initializes variables according to how the followingmutually exclusive Option Buttons are set :

- Random : if selected, the Simulator variables are initialized to random valuesnot exceeding the value entered in "Max Value",

- Not random : if selected, all variables are initialized to zero and on incremented1 by 1 to maxi value.

Page 31: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Configuration Tool 3

___________________________________________________________________________

3/11

EN

GL

ISH3.8 Misc. Tab

The "Misc ellaneous" page presents a number of operational features which may beenabled/disabled by checking the corresponding Checkbox.

• In the "Features" frame these are :

- Change PLC status : when checked, allows the Server to change the operatingmode of the PLC (eg. RUN -> STOP or STOP -> RUN) else the client applicationwill receive the "EOL_E_FEATURE_DISABLED" error : This feature has beendisabled by the administrator,

- DNS scanning : when checked, authorizes the Server to use DNS to identifyPLCs,

- Change Activity : when checked, authorizes the active attribute of an item orgroup to be modified from the Server Debug Interface. For safety reasons, youmay wish to disable this option. In that case, only the client application can modifythe active property of the group,

- OPC Extensions : when checked, authorizes use of Schneider AutomationOPC extensions and custom interfaces, designed by Schneider and not part ofthe OPC Specification,

- DCOM Security : when checked, DCOM security is active. In case of a problemof remote connection with DCOM, it may be useful to disable the DCOM securityin order to gain free access to the OPC Factory Server,

- Verify Devices : when checked, verifies that a device is connected when avariable for it is created, for the FIRST TIME ONLY. Else the device presenceverification will be postponed to the reading or writing of the variable,

- Dynamic Config : allows dynamic configuration without restarting the server.When checked, the external tool :

C:\Program Files\Modicon Telemecanique\OFS\Server\STLoader.exe,

Can be started to refresh symbol tables and dynamically create extra aliasesaccording to the number specified in the Extra Dynamic Alias number in the"Alias" tab.

• In the "Group" frame these are :

- Min Update Rate : the "Group" Text Box allows the user to specify a numericvalue in ms, for the minimum update rate of a variable,

- Enter the value in the Text Box, then click on the "Min Update Rate" button tovalidate. Default setting is 500 ms.

Page 32: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

3/12

___________________________________________________________________________

EN

GL

ISH 3.9 Advanced Tab

A number of options are offered for advanced users.

• In the "Time-out" frame :

- The ModBus and Unite Text Boxes allow the user to enter a positive numericvalue in milliseconds. for the respective device time-outs. Enter the value andclick on the corresponding "OK" button to validate. Default setting is 1000 ms. forboth time-outs.

• In the "Avoid driver contention" frame :

- Max. Pending Req. : is the value of the maximum number of messages thatmay be queued for a device. Enter the value and click on the "MaxPendingReq."button to validate. Default setting is 20.

• In the "Impact on the CPU loading" frame on the "server" machine :

- XwayRec Rate : This parameter is specific to the XWAY network. It is thenumeric value in milliseconds, at which the message reception task is executed(typical value - 50 to 100). Too small a value increases the CPU overhead. Enterthe value and click on the "XwayRcvRate." button to validate. Default setting is100 ms.

3.10 GUI : Menus, Tool Bar and Status Bar

The Menus and Toolbar of the OFS Configuration Tool contain the usual copy, cut,paste, toolbar buttons plus some additional ones :

• RegEdit : the system editor for the registry. See the "caution" reminder in thenext chapter. RegEdit gives complete access to the registry. OFSconf is a registryeditor only, dedicated to OFS,

• The "Open" toolbar is available only on "pathname" type textboxes,

• DCOM : the DCOM drop-down menu offers the facility to verify if DCOM isinstalled on your PC under Windows 95 and if so, to run the DCOM ConfigurationTool (can also be run from an icon). Under NT4, DCOM is installed by default,

• Print : prints the current configuration in a text file (can also be run from an icon),

• Options : offers various page alignment and resizing options on the grid,

Some standard icons are also provided :

• NotePad : runs the Windows NotePad accessory. Useful to edit Symbol Tablefiles and Log trace,

• Calc : runs the Windows Calculator accessory for convenience.

Page 33: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Configuration Tool 3

___________________________________________________________________________

3/13

EN

GL

ISHIn the status bar , before the date, there is a counter of missing mandatory

information in a grid or in a textbox. If you quit the software without fixing themissing data displayed in red with the label <mandatory>, a warning is displayed. Itis recommended that the counter be maintained at zero else the server could fail.

A warning is also displayed if you forget to validate the new value in a textbox by<enter> or by clicking on the "OK" button.

3.11 Saving/Restoring Configuration

You need to run RegEdit, the system utility which allows the user to view theWindows registry directory for the OFS and/or copy it to another PC.

To copy or save the configuration data :

1. Click on the "RegEdit" icon - the Registry Editor Window opens. Allconfiguration data are stored under the following Registry key:

HKEY_CURRENT_USER\Software\Schneider Automation\OpcSrv

Explore the path shown above until the branch is completely open.

Click on the "Registry" menu and from the drop-down, click on "Export Registry File" .A Dialog Box opens,

2. Click on "Selected Branch" in the "Export range" frame, then enter thedestination path and file name with a .reg extension and "Save",

3. Transfer the file to the destination PC, then double click on the .reg file. Thedestination PC registry data is then updated.

Caution:

Be careful! Any modifications in the registry should be done by advanced users only. Thereis no "undo" and it’s possible to crash your PC if you accidentally modify or delete a wrongkey.

Page 34: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

3/14

___________________________________________________________________________

EN

GL

ISH 3.12 OFSconf Options

The OFSconf options can only be set in the shortcut.

METHOD :

1. "Start" > "Settings" > "Taskbar & start menu" ,

2. Click "Advanced" button,

3. Go to C:\WINNT\Profiles\All Users\Start Menu\Programs\Modicon\Telemecanique\OFSConfiguration Tool.lnk,

4. Right-click > "Properties", 2nd tab "Shortcut",

5. Go to the field :

Target = "C:\Program Files\Modicon Telemecanique\OFS\OFSconf\OFSconf.exe"

6. Add the option after the last quote which appears only if there are space(s) ina long name,

7. Click "Close" button.

Example:

Target = "C:\Program Files\Modicon Telemecanique\OFS\OFSconf\OFSconf.exe" /HIDE

Note :

Do not forget the space separator before the slash of each option.

Known options :

• /HIDE show "hidden" option in the "Server" tab: hide the server icon.

• /RESET reinitialize all the parameters in the registry. Be careful! This meansthat you lose all your previous configuration.

Page 35: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Functions of the Product 4

___________________________________________________________________________

4/1

EN

GL

ISH

Section 44 Functions of the Product

4.1 Definition of a Group of Items

All of the services of the OFS product are based on the concept of a group ofitems : a group of variables of any PLC which can be accessed either by theiraddresses or by their symbols.

• It is possible to define several groups,

• A group may concern several PLCs : each item may have a different PLC address,

• A group concerns various communication media and PLCs : each item may referto a different communication driver. If a PLC can be accessed via severalcommunication media, it is possible to mix variables addressed via different mediawithin one group,

• A group can be made up of different types of item : it is possible to mix all thetypes of object managed by the OFS server,

Example :

Mixing words, double words and floating points within one group.

• Depending on the service called, a group is transcribed on one or more communi-cation requests,

• All items in the same group share the update rate and deadbanding percentage.

4.2 Synchronous Services : Read / Write

• These services are used for partial or complete reading or writing of a group ofitems.

• The periodic scanning of the evolution of variables (read polling) must be handledby the client application.

• The term "synchronous" means that the client application which calls up theseread or write services is blocked for the time during which the result is beingobtained. The instruction which follows a synchronous read or write call in thecode of the client application will only be executed when all the communicationrequests corresponding to that call have been processed. This term does notmean synchronization with the PLC. It means that, during a synchronous readoperation, the OFS server does not guarantee that all the variables in a groupwill be read in the same PLC scan if this group is transcribed on severalcommunication requests. The OFS server provides a mechanism for ascertainingthe number of requests necessary to read the whole of a group of items (only forsynchronous groups).

Note :

The conditions ensuring that the items in a group are consistent with one another (reador written in the same PLC scan) are described in Sections 6.5 and 6.6.

Page 36: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

4/2

___________________________________________________________________________

EN

GL

ISH 4.3 Asynchronous Services

• These services are used for partial or complete reading or writing of a group ofitems.

• The periodic scanning of the evolution of variables (read polling) must be handledby the client application.

• The client application is not blocked for the time during which the data are beingobtained.

• The results values are notified to the client using the notification mechanism (thislatter should be enabled).

• For the synchronization with the PLC, everything discussed for synchronousservices is valid (see 4.2).

Page 37: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Functions of the Product 4

___________________________________________________________________________

4/3

EN

GL

ISH4.4 Periodic Read Service

The periodic scanning of variables : read "polling" and the notification of thechange of their value are handled by the OFS server.

• The client application must program a function called "WakeUp" , on which it willbe informed (notified) by the OFS of the changes in value which have occurred onthe items of all the groups which are scanned periodically.This means that the "WakeUp" function is unique in the client application : itreceives all the notifications from the OFS server, then it must redistribute them tothe processing functions specific to each group which is scanned periodically.

Note :

For ready-to-run supervisory software, the “WakeUp ” function should be pre-programmed. If it is not the case, the notification mechanism may not be used.

The name of this "WakeUp" function is set by the OPC standard : OnDataChange.

Warning :

Processing which takes up a significant amount of CPU time (eg : displaywhich is too complex) should not be performed in the "WakeUp" function, asthis may adversely affect the performance of the Operating System.

• The OFS server performs the notification by group , and not individually by item.This means that, for a given group, the OFS server transmits the list of itemswhose value has changed to the client application "WakeUp" function.In the case of a table type item, the OFS server transmits the whole table even ifonly a subset of the elements has changed in value.

The following concepts are associated with the periodic read service :

• Assignment of a scanning PERIOD ("RATE") to a group : time between two readoperations during the "polling" performed by the OFS server. This concept reflectsthe need to monitor the variables at different rates.

Example :

Display the PLC time every second, and display a temperature every minute.

• Assignment of DEAD-BANDING to a group : filtering of the notifications whenthe values of the variables of the group change. The notification takes place if, atthe end of the group scanning period, variables have changed by more than acertain percentage with respect to their old value (see Section 6.9 for the use ofdead-banding).

Example :

Inform the client application only if temperatures have changed by more than10%.

Note :

Dead-banding is only applied to floating point variables.

The purpose of these two concepts is to be able to control (limit) the flow of thenotifications sent to the client application, to avoid saturating the system.

Page 38: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

4/4

___________________________________________________________________________

EN

GL

ISH 4.5 Mechanism for Adjusting the Communication Time-Out with a

Device

This mechanism enables the user to view or modify the communication time-outwith a given device. This time-out is the period during which the OFS server waitsfor an answer from a given device after sending it a request.

The default values can be set using the configuration tool (see 3.9). These defaultsvalues apply either to all XWAY devices or all MODBUS devices.

Modification of the time-out for a given device is possible using a specific item (see6.10).

4.6 Mechanism for Managing the PLC Operating Mode

This mechanism enables the user to view or modify the operating mode of a PLC :Run, Stop and Init.

Note :

The OFS server only provides the basic service for changing the operating mode of aPLC. Since the change of state of the PLC may have repercussions on the process, allthe preliminary checks are the responsibility of the client application .

Example :

Programming a message in the client application requesting the operator to confirm thechange of the PLC operating mode.

Page 39: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Functions of the Product 4

___________________________________________________________________________

4/5

EN

GL

ISH4.7 Mechanism for Accessing the OFS Server

There are two methods of accessing the services provided by the OFS server.

• Local access

The client application and the OFS server are on the same station.

• Remote access via DCOM

The client application and the OFS server are on separate stations, connectedvia the Microsoft TCP/IP network :

OFS station

MODBUS Network XWAY Network

Data2.ASC(Modsoft)

LocateClientApplication

DatasSymbole.SCY(Concept, PL7)

Ethernet TCP/IP Network

Client station OFS station

MODBUS Network XWAY Network

Data2.ASC(Modsoft)

RemoteClientApplication

LocateClientApplication

DatasSymbole.SCY(Concept, PL7)

DCOM

Page 40: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

4/6

___________________________________________________________________________

EN

GL

ISH 4.8 Symbolic Support

Symbolic support enables the replacement of the address of any variable in theitem definition, by it's name in the PLC application (ex: use "Symb1" instead of theXway address "%MW1" or instead of the Modsoft address "400001"). It is handledas a string substitution and has no effect on Read/Write operations.

The supported symbol table formats are:

• PL7 exported symbol table file,

• Concept exported symbol table file,

• Modsoft exported symbol table file,

• CSV symbol table file (Excel exported format).

For more detail, see 6.13

4.9 Browse Support

The OPC Browse Interface is supported by the OFS product. This enables usersto browse symbols available for a given PLC, provided that the OPC Client used,supports the Browse interface. This is an easy way to determine which variablescan be created for a given device.

Note :

Only PLCs declared with the Configuration Tool and associated with a Symbol Table canbe browsed.

4.10 Concept Link

The direct link with the Concept database enables :

• Symbolic Support,

• Browse Support,

• Access to unlocated variables and to structured data.

Concept and OFS can run simultaneously on the same Concept project. More than one Conceptproject can be open at a time (see 6.16).

Page 41: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Functions of the Product 4

___________________________________________________________________________

4/7

EN

GL

ISH4.11 Simu lator

The Simulator enables testing of the application without the actual devices. It providesa simple animation of all created variables. Except for device access, it is identicalto the actual Server.

Note :

The only restriction is that it does not support writing to array items.

Page 42: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

4/8

___________________________________________________________________________

EN

GL

ISH

Page 43: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Type of variables handles by the server 5

___________________________________________________________________________

5/1

EN

GL

ISH

Section 55 Type of variables handles by the server

Preface :

This section gives an exhaustive list of the various types of objects managed by the OFSserver, and indicates the access permitted for each type : read only (R) or read/write(R/W).

The general syntax for an item is :

<item >::=<Driver Name >:<Device Address >!<Variable Definition >[:<arraylength >[;<postfix >]]

The <Driver Name>:<Device Address> part can be replaced by an alias createdwith the Configuration Tool (see 3.4).

If an alias is not used, Driver Name should be one value of the following list and theDevice Address is the address of the device on the communication medium :

Driver Name Example of Device Communication MediumAddress

UNTLW01 0.254.0 UNI-TELWAY

FIP01, FIP02 0.31.0 FIPWAY adapter 01 or 02

ISAWAY01, ISAWAY02 0.5 ISAWAY adapter 01 or 02

ETHWAY01 0.5 ETHWAY adapter 01

XIP01, XIP02, XIP03 0.5 XWAY TCP/IP adapter 01 or 02 or 03

MBP00,MBP01 PM.12 or DM.15.3 MODBUS+ adapter 0 or 1

MBT 139.160.218.102 MODBUS TCP/IP

The Variable Definition part can be either a variable address (see the "Syntax"column in the other tables of this chapter) or a symbol (see 4.8).

For Modbus+ users, if you plan to use simultaneously Concept and OFS, use DMpaths . Otherwise you may not be able either to connect to the PLC with Concept or todownload your application.

For the variables that support this feature, the array length part enables the user tocreate items that are actually arrays and gives the number of the array element.

The Postfix part can be R : R means READ-ONLY and is a way to create an itemthat will always be considered as READ-ONLY .

For Modsoft variables, F and D postfix values are also supported (see 5.3).

Page 44: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

5/2

___________________________________________________________________________

EN

GL

ISH Note :

The Driver Name, Device Address and Variable definition are mandatory.The array length and the postfix are optional.

Examples : "FIP01:0.31.0!%MW12" "XIP01:0.5!%MW100:10""XIP02:0.5!%MW100;R" "MBP00:DM.1.2!400001""TSX2!Toto" "QTIP!Titi"

Note :

The MBT Device Address field uses a postfix of ";xx" to designate the destination indexused in the Modbus+ mapping table defined in the Ethernet to Modbus+ bridge. The "xx"is the decimal value of the index. For example, "139.160.218.103;50".

Page 45: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Type of variables handles by the server 5

___________________________________________________________________________

5/3

EN

GL

ISH5.1 PL7 Variables

5.1-1 Standard Objects

• System objects :

Object Syntax Access TSX 37 PCX/TSX 57

System bit %Si R[/W] Y Y

System word %SWi R[/W] Y Y

System double word %SDi R[/W] Y Y

Note :

Some of these objects can only be modified by the system : the PL7 workshop installationmanual indicates exactly the type of access (R or R/W) permitted for each of the systemobjects defined.

• Memory objects (variables and constants) :

Object Syntax Access TSX 37 PCX/TSX 57

Internal bit %Mi R / W Y Y

Internal byte %MBi R / W Y Y

Internal word %MWi R / W Y Y

Internal double word %MDi R / W Y Y

Floating point (32 bits) %MFi R / W Y Y

Constant word %KWi R Y Y

Constant double word %KDi R Y Y

Floating point %KFi R Y Yconstant (32 bits)

Common word on %NW{j}k R / W Y Ynetwork 0 j = station no.

k = word no.

Common word on %NW{i.j}k R / W Y Yother networks i = network no.

j = station no.k = word no.

Note :

The OFS server does not permit direct access to word extract bits , unlike PL7 language.To access a particular bit of a word, a client application programmed with the OFS servermust access the word using a read primitive and itself apply the "mask" necessary toextract the required bit(s).

Page 46: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

5/4

___________________________________________________________________________

EN

GL

ISH 5.1-2 Grafcet Objects

Object Syntax Access TSX 37 PCX/TSX 57

Step state %Xi R Y Y

Activity time %Xi.T R Y Yof a step

State of a step %Xj.i R N Yin a macro-step

Activity time of a %Xj.i.T R N Ystep in a macro-step

State of the IN step %Xj.IN R N Yof a macro-step

Activity time of the %Xj.IN.T R N YIN step of a macro-step

State of the OUT %Xj.OUT R N Ystep of a macro-step

Activity time of the OUT %Xj.OUT.T R N Ystep of a macro-step

Note :

The macro-steps on available only on PCX/TSX 57 version 3.0 or later.

Page 47: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Type of variables handles by the server 5

___________________________________________________________________________

5/5

EN

GL

ISH5.1-3 Standard Function Blocks

Object Syntax Access TSX 37 PCX/TSX 57

PL7_3 timer : %Ti

Current Value %Ti.V R Y Y

Preset Value %Ti.P R / W Y Y

Done Output %Ti.D R Y Y

Running Output %Ti.R R Y Y

IEC 1131-3 timer : %Tmi

Current Value %TMi.V R Y Y

Preset Value %TMi.P R / W Y Y

Working Output %TMi.Q R Y Y

One-Shot : %Mni

Current Value %MNi.V R Y Y

Preset Value %MNi.P R / W Y Y

Running Output %MNi.R R Y Y

Counter Up/Down : %Ci

Current Value %Ci.V R Y Y

Preset Value %Ci.P R / W Y Y

Empty Output %Ci.E R Y Y

Done Output %Ci.D R Y Y

Full Output %Ci.F R Y Y

Register : %Ri

Input Word %Ri.I R / W Y Y

Output Word %Ri.O R Y Y

Full Output %Ri.F R Y Y

Empty Output %Ri.E R Y Y

Drum : %Dri

Full Output %DRi.F R Y Y

Number of current step %DRi.S R Y Y

Activity Length %DRi.V R Y Y

Page 48: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

5/6

___________________________________________________________________________

EN

GL

ISH 5.1-4 Table Objects

Reminders :

In read mode, the size of the tables is unlimited, except for bit tables (system and memory),which are limited to 450 elements.

• Tables of system objects :

Type of element Syntax Access TSX 37 PCX/TSX 57 Max. writesize

System bit %Si:L R Y Y -

System word %SWi:L R[/W] Y Y 58

System double word %SDi:L R[/W] Y Y 29

Note :

Access to system objects using the table syntax constitutes an extension to PL7language. The system objects defined in the TSX 37 and PCX/TSX 57 ranges are not allconsecutive, which may limit access using the table syntax in some cases.

• Tables of memory objects :

Type of element Syntax Access TSX 37 PCX/TSX 57 Max. writesize

Internal bit %Mi:L R / W Y Y 450

Internal word %MWi:L R / W Y Y 58

Internal double word %MDi:L R / W Y Y 29

Floating point (32 bits) %MFi:L R / W Y Y 29

Constant word %KWi:L R Y Y -

Constant double word %KDi:L R Y Y -

Floating point %KFi:L R Y Y -constant (32 bits)

Common word on %NW{j}k:L R/W Y Y 4network 0 j = station no.

k = word no.

Common word on %NW{i.j}k:L R/W Y Y 4other networks i = network no.

j = station no.k = word no.

Character %MBi:L R/W Y Y 116string

Page 49: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Type of variables handles by the server 5

___________________________________________________________________________

5/7

EN

GL

ISHNotes :

- Access to common words using the table syntax constitutes an extension to PL7 language.- The address (i) and the length (L) of a character string %MBi:L must be even.

• Tables of Grafcet objects

Type of element Syntax Access TSX 37 PCX/TSX 57 Max. writesize

Step state %Xi:L R Y Y -

Activity time %Xi.T:L R Y Y -of a step

State of a step %Xj.i:L R N Y -in a macro-step

Activity time %Xj.i.T:L R N Y -of a step ina macro-step

State of the IN step %Xj.IN:L R N Y -of a macro-step

Activity time %Xj.IN.T:L R N Y -of the IN stepof a macro-step

State of the OUT %Xj.OUT:L R N Y -step of a macro-step

Activity time of %Xj.OUT.T:L R N Y -the OUT step ofa macro-step

Note :

Apart from "step state", access to the other Grafcet objects using the table syntaxconstitutes an extension to PL7 language.

Reminder :

The macro-steps are available only on PCX/TSX 57 version 3.0 or later.

Additional information about macro-steps tables :

• The syntax %Xj.i:L consists of reading several consecutive steps (number L) of themacro-step (j).

Example : %X1.0:3 corresponds to %X1.0, %X1.1 and %X1.2.

• The syntax on a particular step (IN or OUT) of a macro-step (j) consists in readingthis step for several consecutive macro-steps (number L).

Example : %X1.IN:3 corresponds to %X1.IN, %X2.IN and %X3.IN. %X1.OUT.T:3 corresponds to %X1.OUT.T, %X2.OUT.T and %X3.OUT.T.

Page 50: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

5/8

___________________________________________________________________________

EN

GL

ISH 5.2 Concept Variables

StateRam Objects Range Item Syntax Access Array

IEC-1131

Coils 0x %Mi R / W %Mi:L

Input Status 1x %Si R %Si:L

Input Reg as UINT 3x %SWi R %SWi:L

Holding Reg as UINT 4x %MWi R / W %MWi:L

Holding Reg as UDINT 4x %MDi R / W %MDi:L

Holding Reg as REAL 4x %MFi R / W %MFi:L

Symbols are supported everywhere and all variables are represented by symbolssince there is no address syntax in the Concept language.

As an extension to the Concept language it is possible to use (Located Variablesonly) the IEC 1131 Syntax.

Example :

Variable "Toto", located on register 400023 can also be accessed by %MW23 (UINT)or %MF23 (Real) or %MD23 (UDINT). For %MF23 & %MD23 registers 23 and 24 areactuallyread. The syntax Toto:5 or %MW23:5 means an array of five registers startingat Toto (=400023).

The structures are supported. It is possible to access a structure either as an arrayof bytes (it is up to the user to know the internal fields and their type) or field by fieldwith the syntax :

<structure name>.<field name>

In that case, the server figures out the data type directly from the ConCept database.

Note :

Structure access may only take place with a device associated with a Concept projectfile (*.prj) as a Symbol Table file. Both located and unlocated devices may be accessedif the above is true.

To easily manipulate a structure, it is possible to create a group and into that groupto create an item for each field of the structure.

Notes :

- Access to unlocated variables and structures is ONLY possible if the IEC runtime hasbeen enabled into the PLC configuration.

- Moreover unlocated variables and structures should be really used into your PLCapplication to be readable/writeable with OFS. Actually with Concept, any unusedunlocated variables is not known by the PLC.

Page 51: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Type of variables handles by the server 5

___________________________________________________________________________

5/9

EN

GL

ISH5.3 ModSoft variables

The Modsoft supported syntax is only long addresses (6 digits) for the moment.

Ex: 400001.

The following syntaxes are NOT supported (do not confuse with array syntax) :

- 4:00001,

- 40001,

- 4x00001.

The access to any registers located into the 6x range-id is not possible.

The array syntax <reg number>:<length> is supported for range-id 0,1,3,4.

It enables you to read not only one register at a time but many registers (actually<length> registers).

For Holding registers, it is possible to create an item as a Float or as a Long intusing a postfix of F or D. Two consecutive registers will be used. The usual Rpostfix can be used at the same time.

Example : 400001;F Float for registers 1 & 2.

400012;D Long int (32 bits) for registers 12 & 13

400120;FR Float considered as read-only for registers 120 & 121

Object Range Item Syntax Access Array Max SizeWrite

Coils 0 00000i R/W 00000i:L 800

Input status 1 10000i R 10000i:L -

Input register 3 30000i R 30000i:L -

Holding register 4 40000I R/W 40000I:L 100

Reminders :

In read mode, the size of the tables is unlimited, except for bit tables (system and memory),which are limited to 2000 elements.

Page 52: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

5/10

___________________________________________________________________________

EN

GL

ISH 5.4 Local Variables

A pseudo-protocol (driver name: "LOCAL" ) is supported to enable the creation ofvariables that are only local to the server (no relation with any hardware device).Those local variables are always of type WORD (VT_I2), created with a name.

Syntax : "LOCAL" : ! <name>

Example : "LOCAL:!Bridge"

If two or more clients create the same local variable (same name), the value isshared which means that if one client changes the value the other(s) will be notified(if enabled). As long the value has not been written (after creation) the quality isreported as bad. This feature can be used typically to exchange data from oneclient to another.

Page 53: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/1

EN

GL

ISH

6 Using the Server

6.1 Introduction

Before the OFS server can be operated, it must first of all be installed (see Section2) and Configured (see Section 3). After these two phases, the OFS server is readyfor use.

Note :

When using ready-to run supervisory software, you may not have the ability to use allthe features that are listed in the following chapter (see the documentation of the OPCinterface of your supervisory software to verify that point).

• Configuration

Using the Configuration Tool described in Section 3, the user may :

- configure Symbol Tables,

- configure Aliases and Addresses,

- select other options.

• Operation

The Client should start the Server and initiate communications. Then the usermay:

- create groups,

- create items,

- perform synchronous Read,

- perform synchronous Write,

- enable notification for the group,

- activate the group.

At this time the server should send the notification of value changes automatically.

Section 6

Page 54: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/2

___________________________________________________________________________

EN

GL

ISH 6.2 The Operating Phases of the OFS Server

The main phases to be followed when programming a client application are asfollows :

• Creation of the OFS SERVER :CreateObject(...) primitive,

• Creation of the GROUPS of items :AddGroup(...) primitive,

• Creation of the ITEMS in a group :AddItems(...) primitive,

• READ or WRITE the items in a group :OPCRead(...) or OPCWrite(...) primitives; or ActiveStatus(...) property,

• Removal of groups :RemoveGroup(...) primitive,

• Removal from the server.

The periodic reading of a group of items requires the following additional operations :

• Use of notification :

- Subscription to the notification service :AddCallbackReference(...) primitive,

- Periodic reception of notifications ("WakeUp" function) :OnDataChange(...) primitive,

- Removal of the subscription to the notification service :DropCallbackReference(...) primitive,

• Management of dead-banding :PercentDeadBand(...) property.

The OFS server provides the following additional services :

• Obtaining information on the OFS server :

- MajorVersion , MinorVersion and BuildNumber properties,- StartTime and CurrentTime properties.

• Obtaining an error message :

- GetErrorString(...) primitive.

Note :

The above information is required only when creating new, customized applications.

Page 55: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/3

EN

GL

ISH6.3 Groups of Items

The OFS product distinguishes 2 types of group :

• User Group

- Any item can be located on any device

- It is not possible to know the number of requests necessary to read the whole group

- It is possible to perform a read of any part of the group

- The group is notifiable

- The group name can be any string.

• Synchronous Group

- All items should be located on the same device

- It is possible to know the number of requests necessary to read the wholegroup (# Nbr Request)

- Even when performing a read of part of the group, all items are read

- The group is notifiable

- The name should start with a $ or $$

$ : number of requests limited to 1

$$ : any number of requests

A synchronous group can contain a "#NbrRequest " specific item which is used toascertain the number of communication requests required to read all of a group ofitems.

This item is read only and is updated by the server each time an item is added, without havingto physically read the group (no network communication time used).

This item can only be used in a synchronous group.

Note :

The tutorial in Section 7.2 provides an example of using the "#NbrRequest "specific item.

Page 56: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/4

___________________________________________________________________________

EN

GL

ISH 6.4 Managing Tables

• The OFS server manages tables of variables , thus providing easy access to aset of contiguous variables of the same type.

• The OFS server supports several syntaxes according to the target PLC :

<SourceElement>:<Length>

The <SourceElement> field represents either the address or the symbol of the first element inthe table. The <Length> field represents the number of elements (of the sametype as the source variable) in the table.

Example :

For a variable with address %MW10 and symbol MYARRAY.A table of 20 elements commencing with this variable can be referenced in thefollowing two (equivalent) ways :

%MW10:20MYARRAY:20

Note :

This is the only syntax which can be used to reference a table in symbolic form forPL7 objects, as tables cannot be symbolized in the PL7 language.The Concept language supports symbolic reference to a table. In any case this syntaxcan be used with both Concept & Modsoft variables.

• In read mode, the OFS server only limits the size of bit tables to the size than canbe read with one request (450 bits for XWAY and 2000 bits for MODBUS). Forother types of element, the size of the tables is unlimited . However, tables shouldnot exceed the zones configured using the workshop.

• In write mode, the OFS server limits the size of tables : the maximum sizesaccording to the type of element are given in Chapter 5.

• A table of variables corresponds to a single item in a group.

Reminder :

This means that in the case of periodic reading of a group containing a table item, theOFS server sends the whole of the table to the client application, however manyelements in this table have actually changed in value.

Page 57: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/5

EN

GL

ISH6.5 Consistency of the Read Operation

• Consistency of a group of items :

The OFS server ensures that all the items in a group are consistent with oneanother (that is : read in the same PLC scan) if, and only if, the group is transcribedon a single request. This means that the client application can be sure of theconsistency of the items accessed in read mode when the #NbrRequest specificitem associated with the group or the device equals 1.

• Consistency of an item :

For a single item (standard object, Grafcet object, etc), the consistency is implicit,as this item will only be attached to a single request.

For a table item, the maximum number of elements which can be consistent withone another (read in the same PLC scan) depends on the communicationmedium :

Communication No. of elements consistent with one another (dep. on type)

medium bits words double words common characters Grafcet& fl. points words (string)

UNI-TELWAY 450 60 30 12 120 17( terminal port)

FIPWAY 450 60 30 12 120 17

ETHWAY 450 115 57 92 230 33

ISAWAY 450 115 57 92 230 33

XWAY TCP/IP 450 115 57 92 230 33

MODBUS+ 2000 125 62 - - -

MODBUS TCP/IP 2000 125 62 - - -

Note :

The communication media ISAWAY, ETHWAY and XWAY TCP/IP allow to read 908bits on a single request, with several tables (since bits tables are limited to 450elements).

• When the name of a user group is prefixed with '$' , the OFS server checks eachtime an item is added that the number of requests does not exceed the unit. Onethen speaks of the single request user group.

The OFS server (AddItems primitive) will not permit the addition of the item andindicates an error if a single-request group cannot be transcribed on a singlerequest.

Page 58: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/6

___________________________________________________________________________

EN

GL

ISH 6.6 Consistency of the Write Operation

The write primitive exposed by the OFS server is used to write one or more itemsat a time in a group. It must be possible to modify the items and they mustcorrespond :

• either to a single item, which may be any of the types which are handled,

• or to a table item of standard objects.

Note :

When there is a write request, the OFS server overwrites the old values in the PLC.The client application must be responsible for the prior confirmation of theoverwriting, if this is necessary.

If, when there is a write request which applies to several items, there are overlapsbetween items, it is the value associated with the last of these items which takespriority.

Example :

If the write operation applies to items "%MW0:5" and "%MW0", the value given for the 1stelement of item "%MW0:5" will be transient : it will only be retained in the PLC for as longas it takes for the request to write the second item ("%MW0") is taken into account.

Consistency of the variables with each other during a write operation

The consistency of the write operation is guaranteed at the level of the item, aseach item is transcribed on a single write request (1 request per item). This meansin particular that all the elements of a table item will be written during the samePLC scan , due to the size limits imposed on tables according to the type of theirelements.

However, for a write request which applies to several items, the OFS server doesnot guarantee that all these items will be written during the same PLC scan.

Consequently, if a client application needs to write several contiguous variables tomemory at the same time, it is recommended that these variables are referenced inthe form of a single table item, rather than several individual items.

Example :

To simultaneously write variables %MW0 and %MW1, it is advisable to use the table item%MW0:2, rather than 2 separate items %MW0 and %MW1.

Note :

A group which can be read on a single request (#NbrRequest item = 1) is not necessarilywritten on a single request.

Page 59: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/7

EN

GL

ISH6.7 Asynchronous Operation

With Asynchronous operation, the call of any asynchronous operation will returnimmediately. It doesn’t mean that the requested operation has been completed butthat the operation was either rejected (bad return code) or is on the way (goodreturn code).

The completion and the result of the requested operation will be notified using thenotification mechanism. For that reason it should be enabled before using anyasynchronous operation.

The four operations are :

• Read,

• Write,

• Refresh,

• Cancel.

Read/Write :similar to the synchronous operation with the same name (same functionalities,same restrictions apply).

Refresh :Ask for the notification of all the current values of all the active items of the group.The group should be active.

Cancel :

Can be used to stop an on-going Read, Write, Refresh operation. It is notpossible to know if the on-going operation has actually been stopped.

Page 60: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/8

___________________________________________________________________________

EN

GL

ISH 6.8 Using Periodic Reading

The use of periodic reading of items in a group comprises 4 steps :

• Subscription of the group to the notification service set up by the OFS server.

• Programming of the OnDataChange "WakeUp" function called by the OFS serverto notify changes in value which have occurred in the groups.

• Activation if not already done of all items that should be scanned

• Activation of the group to trigger the periodic scanning of the items of the groupfor which the OFS server is responsible : ActiveStatus property at TRUE value.

Note :

Synchronous reading and writing are possible during periodic reading.

Reminder :

- The OnDataChange primitive receives the notifications for all the groupsfor which the OFS server performs the read polling.

- The notification is performed by group , and not individually for each itemin a group. The OnDataChange primitive thus receives the list of the itemsin the group which have changed in value from one iteration to the next ofthe read polling.

The periodic reading of a group is stopped in 2 stages :

• Deactivation of the group : ActiveStatus property at FALSE,

• Stopping of the subscription of the group to the notification service.

Note :

For User Groups : it is at any time possible to activate/deactivate any item in the group.For Synchronous Groups : (name starting with $ or $$) all items are always consideredas active i.e. no partial activation/deactivation possible.

Page 61: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/9

EN

GL

ISH6.9 Using Dead-Banding

6.9.1 Definition

Dead-banding is associated with the periodic reading of a user group , and is amethod of filtering notifications of changes in the value of items : it avoidswaking up the client application when the variable changes within a dead rangearound the last value received.

Comment :

The dead-banding mechanism does not reduce the flow of requests between the serverand the PLC. It is used to reduce the number of notifications sent by the server, and thusprocessed by the client application : as a result, it saves CPU time .

6.9.2 Description of the Dead-Banding Mechanism

The OFS server uses dead-banding as it is specified in the OPC standard.

• Dead-banding only concerns real variables : "%MF" , called "ANALOG" variablesby the OPC standard.

Comment :

The OFS server uses this OPC term to describe "floating point" type PLC variables,even though this term does not correspond to the idea of analog variables generallyused in the control system field.

• Dead-banding is based on the following notions :

- The analog type , defined with min. and max. limits which represent the range ofvalues (interval) of the variables being handled.

Example :

AnalogType = [-1.0, 1.0]

The max. limit for an analog type (1.0 in the example above) is called EngineeringUnit high bound. The min. limit (-1.0) is called EU low bound.

- Usual notification range , which corresponds to the difference between themax. limit and the min. limit defined for an analog type.

In the previous example :

The usual range of variation of the "AnalogType" is : 2 = (1.0 - (-1.0)).

Page 62: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/10

___________________________________________________________________________

EN

GL

ISH - Notification threshold , which conditions the transmission of a notification to the

client application : the notification is transmitted if, and only if, the difference (inabsolute value) between the value read and last value sent is above this threshold.

The value of the threshold for an analog type is calculated by applying the dead-banding value defined for the group to the usual variation range for this type.

The dead-banding is a percentage variation between 0 (ie : 0%) and 1.0 (ie :100%).

To summarize, for an analog type, the notification condition is as follows :ABS (Value read - Last value sent) > Dead-banding * (Max. limit - Min. limit)

Comment :

All notifications are sent if the dead-banding is 0% or 100% (default value). In theprevious example :

If the dead-banding value assigned to the group is 10%, the notification threshold forthe "AnalogType" is :

0.2 = 0.10 (dead-banding) * 2 (usual variation range).

This means that only those variables in the group whose value varies by a differenceof more than 0.2 (in absolute value) will be notified to the client application.

6.9.3 Using Dead-Banding in a Client Application

• Declaration of the analog types :

Use the Configuration Tool, see Section 3.5.

Comment :

"AnalogType" is the name given to the analog type by the user.

Notes :

- It is possible to define up to 100 analog types

- The limits for an analog type cannot be modified by the user once the serverhas started . This is due to the fact that when it is started, the OFS server learns theanalog types defined in the registry. The OFS server must be stopped and thenrestarted for an alteration of the limits of an analog type to be taken into account.

• Defining the dead-banding value :

The dead-banding value associated with a user group can be set when the groupis created (AddGroup primitive) or dynamically adjusted during the server session(PercentDeadBand property).

Page 63: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/11

EN

GL

ISH• Attaching an item to an analog type :

The general syntax for an item, described in Section 5, contains an optionalparameter for stating the analog type to which it belongs, and also for informingthe OFS server of its notification threshold.

The syntax of an item with analog type is as follows :

<item> ::= <DriverName>:<PLCAddress>!<VariableName>[ @<AnalogTypeName>]

Comment :

The space before the @ character is optional.

Example of the definition of an item :

"FIP01:0.31.0!%MF330 @AnalogType".

Comments :

It is possible to have the same item twice in one group (eg : "%MF330") with and withoutthe analog type suffix (" @AnalogType"), in order to compare the effect of the dead-banding for filtering the notifications.

It is possible to have items of different analog types in one group (ie : several analog groupsreferenced in one group).

Page 64: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/12

___________________________________________________________________________

EN

GL

ISH 6.10 Adjusting the Time-Out

The Time-out defines the maximum length of time the Server will wait for an answerfrom a device after sending a request. The time-out is for the device and not themedium.

On Modbus+ , two links (DM or PM) may be established - the time-out value of onedoes not affect the other.

Default Time-out value for all devices may be defined with the OFS ConfigurationTool (see 3.9).This time-out may be configured dynamically, device per device using the specificitem #TimeOut (see 6.18).

6.11 Managing the PLC Operating Mode

The PLC operating mode can be controlled using the specific item #PLCStatus .The modification of any PLC operating mode by the server can be enabled /disabled using the configuration tool (see 3.8).

The current operating mode of the PLC is viewed by reading the #PLCStatusspecific item. The current operating mode of the PLC is modified by writing the#PLCStatus specific item.

The following values are associated with the different operating modes of the PLC :

STOP : 0 RUN : 1 (*) INIT : 2

(*) Not for Quantum

Note :

Modbus+ PLCs and Networks have Data Master (DM) or Program Master (PM) modes.To change the PLC operating mode, the PLC must be in PM mode.

Page 65: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/13

EN

GL

ISH6.12 Communication

• The OFS server enables several communication media to be usedsimultaneously : One client application can, for example, access a PLC viaFIPWAY and another via ISAWAY.

• The OFS server provides XWAY and MODBUS network transparency :A client application can access PLCs in a PLC network architecture containingbridges for switching between communication media.

The OFS server allocates :

• XWAY : one socket for each medium

• MODBUS+ : one path for each device (PM or DM)

• MODBUS/TCP-IP : one socket for each device

Note :

MODBUS+ paths are closed each time the last item referencing that device is removedand opened each time an item referencing that device is created.

Example for an access through a network :

Network 1

Station 1 Station 2 Station 3

Address = 1.1.0 Address = 1.2.0 Address = 1.3.0

Page 66: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/14

___________________________________________________________________________

EN

GL

ISH - <Network>.<Station>.<Gate>.<RackModule>.<ChannelAd0>

This addressing mode is used to access a slave PLC through the master PLC.Notes :

In this case, the value of the <Gate> field must always be 5.The <RackModule> field refers to the master PLC. Its value must be set asfollows :

(Master’s rack number * 16) + Master’s module number.The <ChannelAd0> field refers to the slave PLC. Its value must be set asfollows :

(Master’s channel number * 100) + Slave’s Ad0 number.

Example :

Notes :

1. The documentation "Reference manual of XWAY communication"(TSX DR NET E) is the reference for the description of the XWAY addressing mode.2. In point to point connection (UNI-TELWAY, ISAWAY), the default address0.254.0 can be used to reference the PLC.

Network 1

Station 1

Master's address = 1.1.0

Station 2

Rack 0

Rack 1

Module 1

Slave's address = 1.1.5.17.4 (if channel 0 on master)

Slave's address = 1.1.5.17.104 (if channel 1 on master)

Slave 4

Page 67: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/15

EN

GL

ISH• MODBUS addressing modes

- Over TCP/IP the only information needed is the IP address. This can be givenas four groups of numbers separated by dots or by a DNS name ex. “My Station”.In that case, the DNS scanning feature should be enabled (see 3.8 Misc Tab).

- Over Modbus+ the syntax is : <access level>.<node1>.<node2>.<node3>.<node4>.<node5>

The access level can be :

. PM = Program Master,

. DM = Data Master.

The node number should be used to give the full path. To access a device withoutany bridge, only access mode and node are required.

For TCP/IP - MODBUS+ bridges, the syntax is :

MBT:<bridge IP address>;<Modbus+ device node number>

If the configuration tool is used to define alias, a special dialog box « Bridgeindex » is displayed to enter the device node number (see 3.4).

Example:

• Behavior of the OFS server in the event of a communication problem with thePLC (PLC missing, disconnected, etc) :

- Whatever the type of communication problem, all the requests corresponding toone group will be transmitted, both in the case of a reading items and a writingitems.

- From the point of view of performance, this means that the execution period forthe read or write primitive may rise to n times the time-out period (where n is thenumber of requests associated with the group).

Comment :

There is no reiteration of requests on time-out.

Note :

For Networks with logical connections, if the connection is broken the serverautomatically tries to re-establish it. Ex. Modbus TCP/IP.

Node 7

address is PM.7 or DM.7

Page 68: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/16

___________________________________________________________________________

EN

GL

ISH The OFS server will indicate communication errors to the client application in

the following way : each item belonging to a request which has failed will marked"invalid " *, whether this is for a synchronous / periodic reading of a group, or for awriting of a group.

Note (*):

Whatever method to perform the Read is used : Invalid means that the Quality attributeis bad. Valid means that the Quality attribute is good.

Comments :

• The client application can determine whether the PLC has been reconnected byreaddressing a request to read (synchronous) the group concerned.

• During the periodic reading of a group, the quality of the items (Quality attribute) willchange from Bad to Good when the PLC is reconnected. Section 6.17 describes theQuality attribute associated with an item.

Page 69: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/17

EN

GL

ISH6.13 Managing the Symbols

The OFS server establishes the symbol/address translation using a symbol file .This symbol file could have been created by a programming workshop (Concept,Modsoft, PL7 ) or with an external tool such as a Text Editor (CSV format ).

The supported symbol file formats are :

• PL7 exported symbol table file (default extension SCY),

• PL7 exported application file (default extension FEF),

• Concept exported symbol table file (default extension CCN),

• Modsoft exported symbol table file (default extension TXT),

• CSV symbol table file (default extension CSV).

For each format, only symbols that are associated with enough information foraccessing variables are loaded and can be used (see below for details).

The symbol/address translation can also use Concept Project File (see 6.16).

The same symbol table file can be associated with many devices or groups.

The link between the symbol file and a group of items is established either :

• By creating a link between a Device and a Symbol Table. To do that, use theConfiguration Tool :

- Create an extension for the format you intend to use (ex. .txt for Modsoftformat),

- Create an alias for the device with the Configuration Tool,

- Link your Symbol Table with that Device.

• When the group is created by giving the name of the Symbol Table

Ex. Create Group1 = C:\test.csv

Note :

In any case the extension should have been configured before use (see 3.3).

The management of the symbols applies to a user group. Syntax of the name of agroup : <group name> [=<path of Symbol Table file> ]

The OFS server indicates an error to the client application if, when establishing thislink, it detects that the Symbol Table file does not exist or that it is invalid (itscontents are syntactically incorrect).

If a symbol file contains "clashes" (multiple declarations of one symbol or address)the OFS server only retains the 1st occurrence of this identifier, and does not takefollowing occurrences into account.

Page 70: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/18

___________________________________________________________________________

EN

GL

ISH For example, if a symbol file contains the following associations :

• "PUMP" associated with"%MW0",

• "PUMP" associated with "%MW1".

The OFS server will consider that the symbol “PUMP” corresponds to %MW0 only.This example corresponds to an incorrect file.

Note :

The use of symbols has no effect on the performance of the services for reading andwriting OFS server variables. The only difference in performance concerns the phasefor creating the group : the creation of a group of symbols is in fact longer, as it includesthe translation of the symbols into addresses when creating the items in the group(AddItems primitive).

6.13-1 PL7 exported symbol table file

To create such a file using the PL7 workshop :

• Open your application with PL7,

• Open the application browser,

• Open the data editor,

• Open any window of this editor (ex Memory Objects),

• Use the menu File->Export to create the file.

This exported file allows the consistency check (Application Name & Version) betweenthe symbol table file and the application running into the PLC (see 3.3).

6.13-2 PL7 exported application file

To create such a file using the PL7 workshop :

• Open your application with PL7,

• Use the menu File->Export Application to create the file.

This exported file allows the consistency check (Application Name & Version) betweenthe symbol table file and the application running in the PLC (see 3.3). The OFSdoesn’t use the configuration information of that file.

Page 71: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/19

EN

GL

ISH6.13-3 Concept exported symbol table file

To create such a file using the Concept workshop :

• Open your application with Concept,

• Use the menu File->Export,

• Select either Variables : text delimited or Program : IEC text,

• Do not select any section,

• Create the file with the appropriate extension (see 3.3).

The two other choices in the menu File-Export (Variables : Factory Link & Variables: Modlink ) should be avoided.

This exported file allows the consistency check (Application Name & Version) betweenthe symbol table file and the application running in the PLC (cf 3.3).

Only located variables access is possible using this kind of file since the necessaryinformation for accessing unlocated variables is not present. No structured variableaccess is possible for the same reason. All those kinds of symbols are ignored.

6.13-4 Modsoft exported symbol file

To create the application symbol file using the Modsoft workshop :

• Open your application with Modsoft,

• From the main command menu select “Utility”->”Symbol Table” to open the symboltable editor,

• Use the menu selection “File I/O”->”Export” to create the file.

This exported file doesn’t allow the consistency check (Application Name & Version)between the symbol table file and the application running in the PLC (refer tosection 3.3).

Modsoft applications may be commented by using the comment section of the file.However, the OFS server only uses the reference symbols.

Only symbols compliant to the IEC format are supported. Symbols defined for thebits extracted from registers are NOT supported; all symbols of that kind are ignoredas well as all symbols not IEC compliant.

Page 72: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/20

___________________________________________________________________________

EN

GL

ISH 6.13-5 CSV symbol table file

This kind of file can be created by tools such as Text Editors (ex Notepad) or othertools (eg. Excel 97).

The format of each line is very simple :

<Address><Separator><Symbol><Separator><Comment>

• The <Address> should be a valid address for the device associated with thatsymbol table file,

• The <Separator> can be either a comma, a space or a tab character,

• The <Symbol> can be any string without any comma/space/tab/special characterin it.

If some special features are to be used (array length, special postifix such as R),add them to address.

Example : 400001:10;R Array_StatusExample of array with 10 registers Read/Only

This file doesn’t allow the consistency check (Application Name & Version) betweenthe symbol table file and the application running in the PLC (see 3.3). If you plan touse Excel 97 use the comma as the separator.

Page 73: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/21

EN

GL

ISH6.14 Browse support

Symbol browsing is supported by the IOPC Browser Server Address Space interface.It has a Multi-level hierarchy :

One node for each device declared in the registry (Alias, Path, Symbol Table)whether or not that device is really connected.

For each node :

• A sub-folder called “#Specific ” for all specific items that can be created for thisdevice,

• A sub-folder for each structured variable or array (Concept project file only) thathas in turn a sub-folder if the structure contains arrays or sub-structures.

• The full list of application symbols declared in the symbol table file associatedwith the device (see section 3.4) or nothing (no symbol) if no symbol table wasdeclared for that device.

Devices that are connected but that have not been configured into the Aliastable can not be browsed.

Filter capability is supported, enabling the user to apply type filter (for example,asking for all the boolean variables), name filter (wildcard * supported), accessrights, located or unlocated (Concept proejct file only), structured or not.

It also possible to get with each symbol the associated address and the associatedcomment (filter “&a” for address and “&c” for comment or both “&a&c”).

It is also possible to filter variables base on their address.

Summary of the filter syntax (BNF syntax) :

<Symbol filter>[=<Address Filter>][&A][&C].

• <Symbol filter> : any symbol string including the * wildcard,

• <Address filter> : any address string including the * wildcard,

• &A : ask for the display of the address,

• &C : ask for the display of the comment.

Page 74: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/22

___________________________________________________________________________

EN

GL

ISH Examples of filters :

T* Ask for all symbols starting with T

B* &C Ask for all symbols starting with B and also ask for the associatedcomment (if any)

* =%UL Concept project file : ask for unlocated variables only

* =%MW1* Ask for all variables with addresses starting by %MW1

T* =%MX* &A&C Ask for all symbols starting with T and with address starting by%MX and ask for the display of both Address and Comment

In order to speed up the Browse interface (some software packages request theopening of all available Symbol Tables when they open the Browse interface) it ispossible to preload a Symbol Table when the server is started. This option shouldbe selected with the Configuration Tool when creating an Alias (see 3.4).

Page 75: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/23

EN

GL

ISH6.15 Managing Standard PL7 Function Blocks

Reminder :

It is only possible to modify the R/W fields of a Standard Function Block (eg :"Preset"field of a Monostable %MNi.P) if this Function Block has the "adjustable" property . The"adjustable" or "non adjustable" property is assigned in the Configuration editor of the PL7workshop.

On a call to write R/W field of a standard function block, the OFS server does notperform the preliminary check to ensure that this object has the "adjustable" property.This means that if the Function Block does not have this property, the OFS serversends back the generic error code for this item which corresponds to the failure of awrite request.

6.16 Concept Link Support

Using Concept Link is only possible with Concept 2.1 or later.

Each time you reinstall the Concept product, you should reinstall the OFS productjust after.

The Concept workshop and your .prj files should be located on the same machine .

Using the same project with Concept workshop and OFS at the same time ispossible provided that Concept is running in its own memory space (it is a 16 bitprogram) :

- edit your usual Concept shortcut properties,

- in the Shortcut tab, check the "Run in Separate Memory Space" check box.

To use the Concept Link, all you have to do is to specify your .prj project file (seesection 3.4 or 6.13 ) as a symbol table file for any device or group.

Using more than one Concept project at a time with OFS is possible. All you haveto do is to create the necessary alias and, for each one, specify a different .prj file

This prj file allows the consistency check (Application Name & Version) betweenthe symbol table file and the application running in the PLC (see 3.3).

Page 76: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/24

___________________________________________________________________________

EN

GL

ISH 6.17 Error Handling

6.17-1 Error Feedback Mechanism

• The error feedback mechanism is in 3 parts :

- The description of the result of the call (execution) of a primitive,

- The description of the validity of an item : Quality flag,

- The availability of a GetErrorString primitive responsible for feeding back thetext describing an error based on its code (see Section 7.2-13) .

• Description of the result of calling a primitive :

- For all primitives exposed, of any type (procedure or function), the result of thecall is indicated to the caller using an "exception" , in accordance with the char-acteristics of the exception management specific to each language, in particularwith respect to the behavior for a correct result.

This means in particular that an error detected for a "function" type primitive is notindicated to the caller by means of the value which it returns.

Exceptions which can be triggered are standard exceptions :

- E_xxx errors : standard exceptions defined by OLE and Win 32,

- OPC_E_xxx errors : exceptions specific to OPC,

- EOL_E_xxx errors : exceptions specific to the OFS server,

- OFS_E_xxx errors : exceptions specific to the OFS server.

- In addition to the operation described above, some of the primitives exposedcontain a pErrors parameter in their call interface (output parameter).

This pErrors parameter is defined for those primitives which can handle severalitems in one call (example, AddItems). It is used to :

- record a report for each item (an element in the pErrors table),

- indicate an error to the caller by a method other than the triggering ofexceptions. Typically when S_FALSE is sent back, there is no triggering ofexceptions, since the result of the primitive is of the success with warningtype. The pErrors parameter must be viewed to determine on which item theerror occurred.

The pErrors parameter is used, for example, to indicate for the AddItems primitivethat some of the items mentioned have an invalid syntax.

Page 77: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/25

EN

GL

ISH• Description of the validity of an item :

- The synchronous and periodic read primitives contain a pQualities parameterwhich describes the validity of the items concerned. They give a Quality attributefor each item.

For these primitives, this parameter is in addition to the pErrors parameter.

- The Quality attribute of an item is a value on 8 bits comprising 3 fields :Quality, SubStatus and Limit.

To obtain the error code which corresponds to the field concerned the relevantextraction mask must be applied and the value obtained in this way considered.

- The Quality field (2 bits) which gives the validity of the value of an item :

0 Bad The value of the item is incorrect for the reasonsgiven in the Substatus field

3 Good The value of the item is correct

- The SubStatus field (4 bits) which gives more detailed information on theQuality field, and whose meaning varies according to the value (Good, Bad)of the Quality field.

- SubStatus field for the value Bad in the Quality field :

0 Non-specific Incorrect value with no specific reason :various causes

6 Comm Failure Incorrect value due to a problem communicatingwith the PLC

- SubStatus field for the value Good in the Quality field :

0 Non-specific Correct value. No special conditions

- The Limit field (2 bits) is not managed.

Note :

All the other values which are not mentioned in the above tables are not significant.

Quality SubStatus Limit

2 1 07 6 5 34

Page 78: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/26

___________________________________________________________________________

EN

GL

ISH The table below summarizes the error feedback mechanism used by each of the

primitives exposed by the OFS server.

Primitive name Error feedback mechanism

OLE / OPC pError attrib. Quality attrib.exceptions per item per item

MajorVersion X

MinorVersion X

BuildNumber X

StartTime X

AddGroup X

RemoveGroup X

AddItems X X

ActiveStatus X

PercentDeadBand X

OPCRead X X X

OPCWrite X X

AddCallbackReference X

DropCallbackReference X

OnDataChange X(coded in the client application)

Page 79: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/27

EN

GL

ISH6.17-2 Objects Outside the Software Configuration

The OFS server does not have access to the software configuration of theapplications which it accesses.

If a group contains items which are outside the software configuration of theapplication in the PLC, the operation to read the group may fail on other items,which are compatible with the configuration, due to the fact that optimizationalgorithms are used in the read requests.

If the incorrect item is in a table, the OFS server sets the whole table to error, evenif only one subset of its elements is outside the configuration.

Example :

Application in which 522 words have been configured : from %MW0 to %MW521.

The reading or writing of a group containing table item %MW520:10 will send back anerror for the whole of this item, even though words %MW520 and %MW521 are in theconfiguration.

Note :

Words %MW520 and %MW521 in this example can be accessed individually.

Page 80: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/28

___________________________________________________________________________

EN

GL

ISH 6.18 Specific Items

A specific item is an OPC item not related to any PLC variable but is a way to view/modify some internal parameters (internal to the OPC server or internal to the PLC).

• A specific item has a path like any other item.

• The definition of a specific item always starts with a ‘#’ character.

• A specific item can be created in any group

• A specific item can NOT be in the active state even in an active group, thus noautomatic change detection can be made by the server

• Specific items can be read / written within any subset of the group (including bothordinary and specific items).

• To read or write a specific item either the synchronous or asynchronous functionscan be used

• Specific items available for a device can be browsed in the sub-folder "#Specific "attached to any device.

Note :

All specific items are disabled if the OPC Extensions is not checked in the Misc tab ofthe configuration tool (see 3.7).

"#PlcStatus"

This item type is VT_I2 (16 bit WORD).

This item is READ/WRITE or READ only, depending on the Change PLC Statusoption status in the Misc tab of the configuration tool (see 3.7).

Its value is the mode of the PLC ( 1 if PLC is running, 0 if PLC is stopped).

"#TimeOut"

This item type is VT_I2 (16 bits WORD).

This item is READ/WRITE.

Its value (expressed in ms) is related only to one device (defined by its path). Thisvalue represents the time the server will wait for an answer from the device after ithas sent a request. Any write will modify the server internal parameter for thisdevice.

"#NbrMaxPendingReq"

This item type is VT_I2 (WORD).

This item is READ/WRITE.

Read/Write of the MaxPendingReq parameter for a given device. This parameter isthe number of requests that can be queued up to this device before setting overflowstate. This item is useful only for MODBUS/TCP-IP devices.

Page 81: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Using the Server 6

___________________________________________________________________________

6/29

EN

GL

ISH"#NbrRequest"

This item type is VT_I2 (WORD).

This item is READ only.

Its value (a number of requests) is related only to one device (defined by its path).It indicates the number of requests sent to that device, by the server, to refresh itsinternal cache. It includes all the frequencies that may exist in the server.

This item can be created with no path within a synchro group (name starting with $or $$ see 6.3). In that case its value is the number of requests necessary to readthe whole group.

"#RefreshDevice"

This item type is VT_I2 (WORD).

This item is READ/WRITE.

This item is designed to manage the consistency between the symbol table file andthe application running in the PLC.

If the value 1 is written to this item, the server will read Application Name andApplication Version from the Device.

If this item is read, the server will perform a consistency check between the ApplicationName and Version already read from the device and the same information from thesymbol table file open for that device. The value returned can be :

• 0 : No check was performed (no symbol table information or device information),

• 1 : Everything is OK and consistent,

• 2 : Application names are not consistent,

• 3 : Application versions are not consistent.

"#AppliName"

This item type is VT_BSTR (String).

This item is READ/ONLY.

It gives you the application name (if any) read from the device.

“#AppliVersion”

This item type is VT_BSTR (String).

This item is READ/ONLY.

It gives you the application version (if any) read from the device.

Page 82: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

6/30

___________________________________________________________________________

EN

GL

ISH

Page 83: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

User's Guide 7

___________________________________________________________________________

7/1

EN

GLI

SH

Section 77 User's Guide

7.1 OPC custom

The OPC custom interface of the OFS product is compliant with the 1.01A revision.

The OPC specification document is included on the OFS CD-ROM (DOC\OPC1.01A).This documentation can be downloaded from the OPC Foundation web site :www.opcfoundation.org

It is beyond the scope of this documentation to teach you the direct use of this interface.

Please refer to any OPC tutorial you may find or buy. An very brief example of use isgiven on the CD-ROM and some explanations of this source code are given, pleasesee 9.2.

Page 84: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

7/2

___________________________________________________________________________

EN

GLI

SH

7.2 Description of the OLE Automation Interface Exposed

The OFS server is compliant with the OPC standard, version 1.1.

For these primitives, the OFS server complies with the OPC standard :

• Same hierarchy of objects.

• Same names, same call prototypes (types of parameters and type of result).

• Same mechanism for feeding back errors to the client application.

Object model of the OLE Automation interface of an OPC 1.1 server

Groups

OPC Server(OPCServer)

Items

Group(OPCGroup)

Object

Collection

Description

Item(OPCItem)

Page 85: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

User's Guide 7

___________________________________________________________________________

7/3

EN

GLI

SHObject model of the OPC 1.OA, OLE Automation interface used by the OFS server :

Object OLE Automation Primitives DescriptionInterface Exposed

OPCServer IOPCServerDisp MajorVersion Obtain information onMinorVersion theOFS server.BuildNumberStartTime

IOPCServerDisp AddGroup Manage the collection ofRemoveGroup the groups; add/remove

groups.GetErrorString Obtains an error

message.

OPCGroup IOPCItemMgtDisp AddItems Manages the collection ofthe items; adds items.

IOPCSyncIODisp OPCRead Synchronous read andOPCWrite write group of items.

IOPCGroupStateMgtDisp ActiveStatus Manages the notifiableattribute of a group ofitems.

PercentDeadBand Manages the dead-bandingassociated with a group.

IOPCAsyncIODisp AddcallBackReference Associate a "WakeUp"DropcallBackReference function with group

of items.OPCRead Asynchronous Read andOPCWrite write group of items.

OPCItem Obtain information on the ITEM.

Page 86: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

7/4

___________________________________________________________________________

EN

GLI

SH 7.2-1 Error Codes

Only the most important error codes are documented for each of the primitivesdescribed in the following sections. For an exhaustive list, see Section 7.7.

This appendix is a representation of the 4 error declaration files provided by the OFSproduct :

• OpcError.h and OfsErr.h for C++ language,

• OpcError.bas and OfsErr.bas for Visual Basic language.

7.2-2 CreateObject : Creating the OFS Server in Visual Basic

To instantiate the OFS server, a name object must be created :

"Schneider-Aut.OFSAut" .

The client application must be programmed in early binding mode, which means thatthe link with the OFS server is made at compilation .

To do this, the interfaces exposed by the OFS server must have been previouslyregistered in Visual Basic.

This operation is performed in the following way under Visual Basic 5.0 :

• Menu “Tools” | “References...”

• Check the OPCDisp checkbox which appears after having referenced OFSAuto.dll .The DLL OFSAuto.dll contains the OFS.TLB "Type Library" which describes all theinterfaces exposed by the OFS server.

Example :

Const progID$ = "Schneider-Aut.OFSAut"Public svr As IOPCServerDisp 'object "OPC Server"

Set svr = CreateObject (progID$) 'Create the OFS OPC Server

Exceptions fed back :

S_OK The primitive has been executed (S)uccessfully.

E_OUTOFMEMORY Insufficient memory

E_FAIL Failure of the primitive

Removal :

To disconnect at the end of the session, remove the 'OPC server' object using theinstruction :

Set svr = Nothing

Page 87: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

User's Guide 7

___________________________________________________________________________

7/5

EN

GLI

SH7.2-3 AddGroup : Creating a Group of Items

A new group of items is created using the AddGroup primitive. The AddGroup primitiveis exposed by the IOPCServerDisp interface of the OPCServer object.

AddGroup primitive type : function.

The parameters of the AddGroup primitive have the following meanings :

No. Direct. Parameter name VB type Description

1 in Name string Name of the group to be created.

2 in Active boolean Must systematically be at "FALSE" as the groupmust be created to be inactive with respect tothe notification mechanism (periodic reading).Note : It is not advisable to activate notificationon an empty group.

3 in RequestedUpdateRate long Scanning period requested for the group,expressed in ms.This parameter is used for periodic reading whenthe group is active.See pRevisedUpdateRate for the actualperiod applied.

4 in ClientGroupHandle long Handle assigned to the group by the clientapplication.This handle will be fed back by the serveron the activation of OnDataChange(notification).

5 in pPercentDeadBand single Dead-banding assigned to the group. Thisparameter is used for periodic reading, when thegroup is active.Dead-banding is only managed for "floatingpoint" variables.The expected value is a "floating point"value, which must be between 0.0 and 1.0.The use of dead-banding is described inSection 4.7.

6 in LCID long Parameter not used by the server.Assign the value 0 to this parameter.

7 out pServerGroupHandle long Handle assigned to the group by the server.This handle will subsequently be used todesignate the group when calling primitiveswhich operate on groups, for example theRemoveGroup primitive.

Page 88: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

7/6

___________________________________________________________________________

EN

GLI

SH No. Direct. Parameter name VB type Description

8 out pRevisedUpdateRate long Scanning period obtained for the group,expressed in ms.This parameter adjusts the periodicreading period for the group.If RequestedUpdateRate < 3 x Xwayreceive rate, the server forcespRevisedUpdateRate to3 x Xwayreceive rate

9 in pTimeBias Optional parameter, not used.

ret out ppDisp object Pointer on the IDispatch interface of theOPCGroup object created.

Note on the 1st parameter, "Name" :

The syntax of this parameter is as follows :

• For a user group :"[ <GroupName >][=<NeutralFileName >]"

The name of the group and the name of the Symbol Table (ST) associated withthe group are optional.

Examples :

"GRP_ENGINE" ‘Group with no addresses/‘symbols association

"GRP_ENGINE=e:\export\symb.scy" ‘Group with a Symbol Table file

"=e:\export\symb.scy" ‘Group with no name with a‘Symbol Table file

"GRP_ENGINE=symb.scy" ‘Symbol Table file in the default'directory (*)

"GRP_ENGINE=F:\remote\dcom.scy" ‘Localization in the authorized‘network.‘example F: points to_"\\client\path"

Counter example :

"GRP_ENGINE=\\client\path\remote\dcom.scy"‘UNC localization in NON authorized network.

Symbol Table files can be chosen using the Coifiguration Tool

The path can have an optional back-slash at the end.Symbols = "e:\export\pl7sec\"

• For a system group (dedicated to a medium and a PLC) :"_SYS=<DriverName >:<PLCAddress >"

The name of the group is compulsory and has a fixed syntax : the prefix "_SYS="is added.No neutral file can be associated with a system group.

Page 89: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

User's Guide 7

___________________________________________________________________________

7/7

EN

GLI

SHNote on the 2nd parameter, "Active" :

After creating at least one item, it is possible to modify the status of the "Active" attributeof a group using the ActiveStatus property.

The "Active" attribute of a group defines whether notification is operational :

If the group is active , periodic reading is triggered as soon as the group subscribes tothe notification service. The "read polling" and notification of changes of values are thenhandled by the OFS server.

Note on the value fed back :

The pointer on the IDispatch interface of the OPCGroup object should be used to call upthe interface which exposes the primitive to be applied to the group which has beencreated :

• IOPCItemMgtDisp interface / AddItems primitive to create items in the group• IOPCSyncIODisp interface / OPCRead primitive to read the items in the group

Example :

Dim group As Object ' OPC Group.Set group = svr.AddGroup (nameNewGroup$, False, rateRequested, _

grpHndCounter, 1, 0, ServerGroupHandle, _rateRevised)

group.AddItems (nbrItems, ItemsDef, ItemsActivity, _tabItemslocdlClient, itemsErrors, _ItemsObject, acesspath)

Exceptions fed back by the AddGroup primitive :

S_OK The primitive has been executed (S)uccessfully.

EOL_E_INVALID_ARG1 to ARG9 ARGument N is invalid.

E_OUTOFMEMORY Insufficient memory.

E_FAIL Failure of the primitive.

EOL_E_MISSING_NEUTRAL_FILE The Symbol Table file defining the symbols ismissing.

EOL_E_INVALID_SYMBOLS_FILE The content of the Symbol Table file isinvalid.

EOL_E_OPEN_SYMBOLS_FAILURE Failure opening the Symbol Table file :invalid name or path, file does not exist, etc.

EOL_E_ERRORS_IN_SYMBOLS_FILE TheSymbol Table file contains errors :syntax error on a line describing an address /symbol association, address or symbol clash.

Page 90: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

7/8

___________________________________________________________________________

EN

GLI

SH 7.2-4 RemoveGroup : Removing a Group of Items

A group of items is removed using the RemoveGroup primitive. The RemoveGroupprimitive is exposed via the IOPCServerDisp interface of the OPCServer object.

RemoveGroup primitive type : procedure.

The parameters of the RemoveGroup primitive have the following meanings :

No. Direct. Parameter name VB type Description

1 in ServerGroupHandle long Handle assigned to the group by theserver (sent back by AddGroup).

2 in Force boolean FALSE if logical deletion.

Note on the 2nd parameter, "Force" :

The FALSE value causes a logical deletion of the group, which means that :

• Primitives which are applied to this group subsequently will fail : OPCRead, ActiveStatus,etc.

• The group will be effectively removed when all the interfaces concerned with the groupare removed.

The TRUE value forces the removal of the group.

Exceptions fed back by the RemoveGroup primitive :

S_OK The primitive has been executed (S)uccessfully.

EOL_E_INVALID_ARG1 to ARG2 ARGument N is invalid.

E_OUTOFMEMORY Insufficient memory.

E_FAIL Failure of the primitive.

Page 91: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

User's Guide 7

___________________________________________________________________________

7/9

EN

GLI

SH7.2-5 AddItems : Adding Items to a Group

New items are created in a group using the AddItems primitive. The AddItems primitiveis exposed via the IOPCItemMgtDisp interface of the OPCGroup object.

Note :

This primitive is used to create one or more items in a group.

AddItems primitive type : procedure.

The parameters of the AddItems primitive have the following meanings :

No. Direct. Parameter name VB type Description

1 in NumItems long Number of items to be added in the group.

2 in ItemIDs() string Table of identifiers of the items to becreated.

3 in ActivateStates() boolean Table indicating for each new item whether itshould be added to the group in “active” or“inactive” state.

4 in ClientHandles() long Table of the handles assigned by the clientapplication to each item to be added in thegroup.These handles will be fed back via theserver on activation of OnDataChange(notification), so that the client applicationcan recognize those items whose value haschanged.

5 out pServerHandles variant Table of the handles assigned by the serverto each of the items added to the group.These identifiers will be used subsequentlyto designate the items created when theprimitives which operate on the items in agroup are called, for example the OPCReadprimitive.

6 out pErrors variant HResult table (1 per item) indicating theresult of the operation for each item to becreated : S_OK or code of the errordetected.Two functions which are used to test theresult for each item are defined in the VisualBasic tutorial (MAIN.FRM file) :• SUCCEEDED() sends back TRUE if theitem has been added to the group.• FAILED() sends back TRUE if it has notbeen possible to add it to the group.

Page 92: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

7/10

___________________________________________________________________________

EN

GLI

SH No. Direct. Parameter name VB type Description

7 out pItemObjects variant Table of OPCItem objects (one for eachitem added to the group).Reminder : the OPCItem object of the OPCstandard is neither documented, norsupported.

8 in AccessPaths() string Must contain a table of empty strings.

9 in RequestedDataTypes Optional parameter which is not supported.

10 in/out pBlobs Optional parameter which is not supported.

11 out pCanonicalDataTypes Optional parameter which is not supported.

12 out pAccessRights Optional parameter which is not supported.

Notes on the 2nd parameter, "ItemIDS" :

The syntax of a table element is as follows :

• For items corresponding to PLC variables ("user group") :

"<DriverName >:<PLCAddress >!<VariableIdentification >"

<DriverName >: name of the driver associated with acommunication medium

<PLCAddress >: address of the PLC on the communicationmedium.

Comment :

See Section 5 for a description of the addressing mode.

<VariableIdentification >: address or symbol of the item to be added tothe group.

Examples :

"FIP01:0.31.0!PUMP""UNTLW01:0.254.0!%MW2:10"

• For specific items in a user group or a system group :

"#<SpecificItemName> "

- in a user group : "#NbrRequest"- in a system group : "#PLCStatus", "#TimeOut"

Example of adding several items in a single call to the AddItems primitive :

Dim ItemsIDs (2) as string ' Table of names of itemsItemsIDs (0)="FIP01:0.31.0!%MW0"ItemsIDs (1)="FIP01:0.31.0!%MW1"AddItems (2,ItemsIDs,...)

Page 93: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

User's Guide 7

___________________________________________________________________________

7/11

EN

GLI

SHExceptions fed back by the AddItems primitive :

S_OK The primitive has been executed (S)uccessfully.

S_FALSE (S)uccess status, but with at least one error on an itemreported in pErrors (incorrect item index).

EOL_E_INVALID_ARG1 to ARG12 ARGument N is invalid.

E_OUTOFMEMORY Insufficient memory.

E_FAIL Failure of the primitive.

Most significant error values sent back in the pErrors parameter :

EOL_S_INVALID_APPLI_NAME The application in the PLC has a different name orEOL_S_INVALID_APPLI_VERSION version number from that which is described in

the Symbol Table file.This is a non-blocking (S)uccess report.

OPC_E_INVALIDITEMID The syntax of the item is not what was expected.

OPC_E_UNKNOWNPATH Unknown PLC network driver.

EOL_E_INVALID_TYPE Unknown item type.

EOL_E_INVALID_PLC_RANGE PLC range not supported.

EOL_E_OPEN_DRIVER_FAILURE Failure when opening the communication driver.

EOL_E_OPEN_SOCKET_FAILURE Failure when allocating a new communicationchannel to the given PLC.

EOL_E_TIMEOUT_ON_CONNECTION Cannot establish the connection with the givenPLC : error on time-out.

EOL_E_INVALID_PLC_ADDRESS Incorrect address given for the PLC.

EOL_E_INVALID_SYMBOL Unknown symbol for the item.

EOL_E_SYNTAX_ERROR Syntax error in the item identifier.

EOL_E_ONLY_ONE_REQUEST Addition of the item refused as the SINGLEREQUEST group could not be transcribed on asingle request.

Comment :

The HResults : S_OK, S_FALSE, EOL_S_INVALID_APPLI_NAME, etc, contain the letter(S)uccess. If the SUCCEEDED() function is applied to these results, it will send backTRUE. Conversely, HResults containing the letter (E)rror cause TRUE to be sent backto the FAILED() function.

These 2 functions are defined in the MAIN.FRM file in the Visual Basic tutorial.

Page 94: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

7/12

___________________________________________________________________________

EN

GLI

SH 7.2-6 OPCRead : Reading the Items in a Group

The items in a group are read synchronously using the OPCRead primitive. TheOPCRead primitive is exposed by the IOPCSyncIODisp interface of the OPCGroupobject.

OPCRead primitive type : procedure.

The parameters of the OPCRead primitive have the following meanings :

No. Direct. Parameter name VB type Description

1 in Source integer Source of the reading of these items (deviceor cache). OPC_DS_DEVICE orOPC_DS_CACHE

2 in NumItems long Number of items in the group which are tobe read.

3 in ServerHandles() long Table of the handles of the items in thegroup which are to be read.These handles are those assigned to theitems by the OFS server when they wereadded to the group (AddItems primitive).

4 out pValues variant Table of the values obtained for the items.

5 out pQualities variant Table of validity of the items read (1 per item).

6 out pTimeStamps variant Table of the dates of reading the items read(1 per item).Note : This is the time-stamping when theitem is read by the server and not a PLCtime-stamping.

7 out pErrors variant HResult table (1 per item) indicating the resultof the operation for each item to be read :S_OK or code of the detected error.

Reminder :

The synchronous and independent reading of the status ("active" or "inactive") of thegroup : it is possible to perform a synchronous read operation when a group is being readperiodically.

Page 95: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

User's Guide 7

___________________________________________________________________________

7/13

EN

GLI

SHNotes on the 1st parameter, "Source" :

The MAIN.FRM file in the Visual Basic tutorial gives an example of the declaration of theOPC_DS_DEVICE constant :

' OPC constants: ref. OPC Foundation Task ForcePublic Const OPC_DS_DEVICE = 2 ' Read physically the DEVICE

' (and not _the cache).

Notes on the 4th parameter, "pValues" :

Viewing the PLC operating mode (reading #PLCStatus item of a system group) sendsback one of the following three values :

STOP : 0 RUN : 1

Exceptions fed back by the OPCRead primitive :

S_OK The primitive has been executed (S)uccessfully.

S_FALSE (S)uccess status, but with at least one error on an itemreported in pErrors (incorrect item index).

EOL_E_INVALID_ARG1 to ARG7 ARGument N is invalid.

E_OUTOFMEMORY Insufficient memory.

E_FAIL Failure of the primitive.

Page 96: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

7/14

___________________________________________________________________________

EN

GLI

SH Most significant error values sent back in the pErrors parameter :

OPC_E_INVALIDHANDLE One or more of the handles sent is invalid.

EOL_E_INVALID_ITEMS_NBR The number of items is incorrect.

EOL_E_INVALID_PLC_RANGE PLC range not supported.

EOL_E_NO_APPLI_IN_PLC No application in the PLC.

EOL_E_INSTANCE_OUT_OF_CONF Item outside the software configuration of theEOL_E_ITEM_OUT_OF_CONF application.

EOL_E_OUT_OF_BITSARRAY_BOUNDARY The item exceeds the limit permitted for a bittable.

EOL_E_READ_FAILURE Failure to read the item : time-out, etc.

EOL_E_INVALID_READ_PARAMETER Invalid item : for instance, attempt to read agrafcet macro-step on a TSX 37 or aPCX/TSX 57 which version is inferior to 3.0.

EOL_E_READ_ARRAY_FORBIDDEN Impossible to read this kind of object with thearray syntax.

EOL_E_STRING_ADDRESS_NOT_EVEN The address (i) of a string %MBi:L must beeven.

EOL_E_STRING_LENGTH_NOT_EVEN The length (L) of a string %MBi:L must be even.

EOL_E_PLC_ALREADY_RESERVED Viewing the PLC operating mode (reading#PLCStatus item) is not possible becauseaccess to this PLC is already reserved byanother product.

Page 97: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

User's Guide 7

___________________________________________________________________________

7/15

EN

GLI

SH7.2-7 ActiveStatus : Activation/Deactivation of the Periodic Reading of a

Group

A group of items is read periodically by assigning the "active" status to this group :ActiveStatus property set to the value TRUE.

The ActiveStatus property is exposed by the IOPCGroupStateMgtDisp interface ofthe OPCGroup object.

Activation of the group has the effect of triggering the periodic scanning of the items inthe group : "read polling" handled by the OFS server.

This operation requires that the group already subscribes to the notification service,so that the OFS server can subsequently indicate the items whose value has changedto the client application : calling of the OnDataChange "WakeUp" function.

To stop the periodic reading of a group of items, simply change this group to "inactive"status : ActiveStatus property set to value FALSE .

Example :

Activation of the group to trigger periodic reading :

group.ActiveStatus=TRUE

The ActiveStatus property is also used to view the current status of a group.

Example :

currentStatus=group.ActiveStatus

Note :

The only correct values for activating/deactivating a group are :FALSE : 0 and TRUE : -1.

Exceptions fed back by the ActiveStatus property :

S_OK The operation has been performed (S)uccessfully.

EOL_E_INVALID_ARG1 The ARGument is invalid : incorrect value given.

E_OUTOFMEMORY Insufficient memory.

E_FAIL Failure of the primitive for the operation.

Page 98: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

7/16

___________________________________________________________________________

EN

GLI

SH 7.2-8 OnDataChange : Periodic Reception of Notifications

This primitive corresponds to the "WakeUp" function by which the OFS server notifiesthe client application of the changes in value which have occurred on items in thegroups it is scanning. This primitive is to be programmed in the client application andmust be exposed by the IDispatch interface. It has a set name and call interface :

OnDataChange ( GroupHandle, Count, ClientHandles (), Values (), Qualities (),_GroupTime, TimeStamps() )

OnDataChange primitive type : procedure.

The OnDataChange primitive receives the notifications for all the groups for which theserver performs "read polling". The notification is performed by group and notindividually for each item in a group. The OnDataChange primitive therefore receivesthe list of items in the group whose value has changed from one iteration to the nextof the "read polling".

The parameters of the OnDataChange primitive have the following meanings :

No. Direct. Parameter name VB type Description

1 in GroupHandle long Identification of the group to which thenotification applies.This is the handle assigned by the clientapplication when this group was created(AddGroup primitive).

2 in Count long Number of items in the group whose valuehas changed.

3 in ClientHandles() long Table of the handles of the items in thegroup whose value has changed.These are the handles assigned to theseitems by the client application when theywere created (handles transmitted to theAddItems primitive).

4 in Values variant Table of the new values of the notifieditems. In the case of a table item, thisparameter repeats all the elements of thetable, whether they have changed or not :'Values' is a variant of variants in this case.

5 in Qualities variant Description table of the validity of thenotified items (1 per item).

6 in GroupTime variant Time-stamping of the group by the server.

7 in TimeStamps variant Time-stamping table of the notified items (1 peritem).The time-stamping is performed by theserver : this is not the PLC date / time.

Page 99: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

User's Guide 7

___________________________________________________________________________

7/17

EN

GLI

SHNotes on the 5th parameter, "Qualities" :

The OFS server also notifies the client application of a change of the Qualityattribute of an item even if the value of that item does not change . This enablesthe client application to be warned of incidents which occur during the periodicreading of a group.

Example :

The client application can monitor the status of communication with a PLC, bytesting the various fields of the Quality attribute of the notified items (see Section4.13-1) :

• If Quality is Bad and if SubStatus is CommFailure, this indicates that there is a connection fault with that PLC.

• IfQuality is Good, this indicates that the connection with that PLC has been reestablished.

Comment :

The following constants can be defined to test the Quality attribute of an item(illustration in C++) :

#define QUAL_BAD 0X0000#define QUAL_GOOD 0X00C0#define QUAL_COMM_FAILURE 0X0018

Page 100: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

7/18

___________________________________________________________________________

EN

GLI

SH 7.2-9 AddCallbackReference : Subscribing to the Notification Service

The group subscribes to the notification service using the AddCallbackReferenceprimitive. The AddCallbackReference primitive is exposed by the IOPCAsyncIODispinterface of the OPCGroup object.

This operation consists of linking the group to the OnDataChange "WakeUp" functionprogrammed in the client application. For a group which is to be the subject of periodicreading, it is advisable to attach this operation to the creation phase.

AddCallbackReference primitive type : function.

The parameters of the AddCallbackReference primitive have the following meanings :

No. Direct. Parameter name VB type Description

1 in Context long Parameter not used by the server.

2 in pCallBack long Address of the "WakeUp" functionprogrammed in the client application.

ret out pConnection long Handle assigned to the connection by theserver.This identifier will be useful for interruptingthe link between the "WakeUp" function and thegroup of items(DropCallbackReference primitive).

Exceptions fed back by the AddCallbackReference primitive :

S_OK The primitive has been executed (S)uccessfully.

EOL_E_INVALID_ARG1 to ARG2 ARGument N is invalid.

E_OUTOFMEMORY Insufficient memory.

E_FAIL Failure of the primitive.

Page 101: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

User's Guide 7

___________________________________________________________________________

7/19

EN

GLI

SH7.2-10 DropCallbackReference : Unsubscribing to the Notification Service

The DropCallbackReference primitive is exposed by the IOPCAsyncIODisp inter-face of the OPCGroup object.

It is advisable to attach this operation to the phase of removing a group.

DropCallBackReference primitive type : procedure.

The parameters of the DropCallbackReference primitive have the following meanings :

No.Direct. Parameter name VB type Description

1 in Connection long Handle of the connection fed back bythe AddCallbackReference primitive.

Exceptions fed back by the DropCallbackReference primitive :

S_OK The primitive has been executed (S)uccessfully.

EOL_E_INVALID_ARG1 The ARGument is invalid.

E_OUTOFMEMORY Insufficient memory.

E_FAIL Failure of the primitive.

Page 102: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

7/20

___________________________________________________________________________

EN

GLI

SH 7.2-11 PercentDeadBand : Managing the Dead-Banding of a Group

The dead-banding value associated with a group is viewed and modified using thePercentDeadBand property. The PercentDeadBand property is exposed by theIOPCGroupStateMgtDisp interface of the OPCGroup object.

Notes :

- The dead-banding value mentioned indicates a percentage, and must therefore be a"floating point" value between 0.0 and 1.0.

- Assigning a new dead-banding value only affects the items in the group concernedby the definition of dead-banding (see Section 6.9).

- Dead-banding can be adjusted whatever the status ("active" or "inactive") of a group.This means that it is possible to modify the dead-banding value without interrupting thecurrent periodic reading session.

Example :

- Modification of the dead-banding of a group :group.PercentDeadBand = 0.5

- Viewing the dead-banding of a group :Deadband = group.PercentDeadBand

Exceptions fed back by the PercentDeadBand property :

S_OK The operation has been executed (S)uccessfully.

EOL_E_INVALID_ARG1 The ARGument is invalid : incorrect value given.

E_OUTOFMEMORY Insufficient memory.

E_FAIL Failure of the primitive for the operation.

Page 103: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

User's Guide 7

___________________________________________________________________________

7/21

EN

GLI

SH7.2-12 OPCWrite : Writing Items in a Group

Items in a group are written using the OPCWrite primitive. The OPCWrite primitive isexposed by the IOPCSyncIODisp interface of the OPCGroup object.

OPCWrite primitive type : procedure.

Note :

- This primitive is used to write all or only part of the items which make up a group.Partial writing reduces the flow of requests to the PLC : only those requests correspondingto the items mentioned are transmitted.

- This primitive does not check types : it is the responsibility of the client application to checkthat the type of value to be written is consistent with that of the target variable.

The parameters of the OPCWrite primitive have the following meanings :

No. Direct. Parameter name VB type Description

1 in NumItems long Number of items to be written.

2 in ServerHandles() long Table of the handles of the items to bewritten.These are the handles assigned to theseitems by the server, when they werecreated (handles sent back by theAddItems primitive).

3 in Values() variant Table of the values to be written for theseitems.

4 out pErrors variant HResult table (1 per item) indicating theresult of the operation for each item to bewritten : S_OK or code of the detected error.

Notes on the 3rd parameter, "pValues" :

To modify the PLC operating mode (write the #PLCStatus item of a system group) oneof the following three values must be specified :

STOP : 0 RUN : 1 (*)INIT : 2

* Not for Quantum.

Page 104: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

7/22

___________________________________________________________________________

EN

GLI

SH Exceptions fed back by the OPCWrite primitive :

S_OK The primitive has been executed (S)uccessfully.

S_FALSE (S)uccess status, but with at least one error on an itemreported in pErrors (incorrect item index).

EOL_E_INVALID_ARG1 to ARG4 ARGument N is invalid.

E_OUTOFMEMORY Insufficient memory.

E_FAIL Failure of the primitive.

Note :

The write operation is independent of the status ("active" or "inactive") of the group : itis possible to modify the value of the items in a group which is being read periodically.

Most significant error values sent back in the pErrors parameter :

OPC_E_INVALIDHANDLE The handle transmitted is invalid.

OPC_E_BADRIGHTS Attempt to write an object which can be accessed inread-only.

EOL_E_INVALID_TYPE The type of variable is invalid.

EOL_E_INVALID_ITEMS_NBR The number of items is incorrect : valuenegative or greater than the number of itemsin the group.

EOL_E_EXPECTED_ARRAY_VALUES A TABLE of values is expected.

EOL_E_EXPECTED_SINGLE_VALUE A SINGLE value is expected and not a table.

EOL_E_EXPECTED_DIM1 A table with a SINGLE dimension is expected.

EOL_E_UNEXPECTED_BOUNDS The limits of the table are invalid.

EOL_E_INVALID_PLC_RANGE PLC range not supported.

EOL_E_NO_APPLI_IN_PLC No application in the PLC.

EOL_E_ITEM_OUT_OF_CONF Item outside the software configuration of theapplication in the PLC.

EOL_E_WRITE_FAILURE Failure to write the item : time-out communication,attempt to write a standard function block whichdoes not have the "adjustable" property, etc.

EOL_E_WRITE_ARRAY_FORBIDDEN Writing this kind of table is not allowed.

EOL_E_STRING_ADDRESS_NOT_EVEN The address (i) of a string %MBi:L must be even.

EOL_E_STRING_LENGTH_NOT_EVEN The length (L) of a string %MBi:L must be even.

EOL_E_NO_MBi_SINGLE_ACCESS The %MBi objects cannot be accessed individually.

EOL_E_PLC_ALREADY_RESERVED Modifying the PLC operating mode (writing#PLCStatus item) is not possible because access tothis PLC is already reserved by another product.

Page 105: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

User's Guide 7

___________________________________________________________________________

7/23

EN

GLI

SH7.2-13 GetErrorString : Obtaining an Error Message

The GetErrorString primitive sends back the error message corresponding to the codefor that error.

Note :

The text of this message can be obtained in the languages supported by the OFSserver : English and French.

The GetErrorString primitive is exposed by the IOPCServerDisp interface of theOPCServer object.

GetErrorString primitive type : function.

The parameters of the GetErrorString primitive have the following meanings :

No. Direct. Parameter name VB type Description

1 in Error long Code of the error (HResult) for which the textof the message is to be obtained.

2 in Locale long Code of the language in which the text ofthe message is to be obtained.Give one of the 2 following values(hexadecimal) : French : &H409 orEnglish : &H40C

3 ret ErrorString string Text, in the required language, of the errormessage corresponding to the given error.

Exceptions fed back by the GetErrorString primitive :

S_OK The primitive has been executed (S)uccessfully.

EOL_E_INVALID_ARG1 to ARG2 ARGument N is invalid.

E_OUTOFMEMORY Insufficient memory.

E_FAIL Failure of the primitive.

OPC_E_UNKNOWNLCID The server does not support the local language code(LCID) indicated.

EOL_E_MISSING_OPCerror_DLL The OPCerror.dll resources file cannot be loaded.

EOL_E_MISSING_EOLESerr_DLL The OFSerr.dll resources file cannot be loaded.

EOL_E_RESOURCE_NOT_FOUND The resources DLL has not been found.

EOL_E_MSG_NOT_FOUND The message has not been found.

Page 106: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

7/24

___________________________________________________________________________

EN

GLI

SH Notes on the 2nd parameter, "Locale" :

The MAIN.FRM file of the Visual Basic tutorial gives an example of the declaration of theconstant indicating that the text of the messages should be in English :

const dwLangId_ENGLISH = &H409

Page 107: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

User's Guide 7

___________________________________________________________________________

7/25

EN

GLI

SH7.2-14 MajorVersion : Information on the OFS Server

The following properties exposed by the IOPCServerDisp interface of the OPCServerobject provide information on the OFS server :

• MajorVersion property :This property sends back an INTEGER indicating the value of the version index ofthe OFS server.

• MinorVersion property :This property sends back an INTEGER indicating the value of the release index ofthe OFS server.

• BuildNumber property :This property sends back an INTEGER indicating the value of the generation numberof the OFS server.

• StartTime property :This property sends back a DATE indicating the date the OFS server was launched.

• CurrentTime property :This property sends back a DATE indicating the current time for the OFS server.

Note :

Regarding information about date and time, the OFS server uses the system hour (UTC.

Exceptions fed back by these properties :

S_OK The primitive has been executed (S)uccessfully.

E_OUTOFMEMORY Insufficient memory.

E_FAIL Failure of the primitive.

Page 108: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

7/26

___________________________________________________________________________

EN

GLI

SH

Page 109: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Performance 8

___________________________________________________________________________

8/1

EN

GLI

SH

Section 88 Performance

8.1 Target Performance

• Test software configuration :

Pentium Pro 200 , 64 Mb of RAM with NT 4.0 SP3 operating system.

• Test scenario :

· Reading of 100 WORDS as single items. The 100 WORDS are read with one networkrequest.

· Variations in the PLC scan time : 40, 80, 160 ms.

· 100 calls to the SyncIO Read function : synchronous reading means the clientapplication waits for the completion of the request each time.

· Measurement of the maximum read time (ms), minimum read time (ms) and the averageread time (ms) for each medium :

• Results of the tests :

- PLC scan time = 40 ms

Max time (ms) Min time (ms) Average time (ms)

TSX 302 FIPWAY 270 150 210

TSX 302 UNITELWAY 610 260 430

TSX 302 UNITE TCP/IP 170 60 100

QUANTUM 113/03 MB+ 100 40 60

QUANTUM 113/03 TCP/IP 100 40 60

QUANTUM 424 TCP/IP 100 30 50

- PLC scan time = 80 ms

Max time (ms) Min time (ms) Average time (ms)

TSX 302 FIPWAY 330 150 200

TSX 302 UNITELWAY 660 310 480

TSX 302 UNITE TCP/IP 160 50 120

QUANTUM 113/03 MB+ 150 40 80

QUANTUM 113/03 TCP/IP 150 40 80

QUANTUM 424 TCP/IP 130 30 80

Page 110: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

8/2

___________________________________________________________________________

EN

GLI

SH - PLC scan time = 160 ms

Max time (ms) Min time (ms) Average time (ms)

TSX 302 FIPWAY 360 210 310

TSX 302 UNITELWAY 670 380 590

TSX 302 UNITE TCP/IP 260 60 160

QUANTUM 113/03 MB+ 240 80 160

QUANTUM 113/03 TCP/IP 240 80 160

QUANTUM 424 TCP/IP 230 60 160

Comments :

• The PLC scan time is very important• The number of network requests handled at each scan by the PLC is also important

Tuning hints :

The min update rate parameter (cf OFS Configuration tool, Misc tab) should be accurateand not set deliberately to the minimum possible value.

Page 111: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/1

EN

GLI

SH

Section 99 Appendix

9.1 Tutorial on Creating a Client Application in Visual Basic

The example of a client application described in this section illustrates the use ofthe main functions defined by the OFS server. The example shown is forUNI-TELWAY but other protocols may be substituted. This tutorial is programmedin Visual Basic 5.0 using OLE Automation.

Notes :

This tutorial provides a programming example for a client application in its simplest form forease of comprehension : in particular, it does not include any error handling.For this reason, it is not recommended for use in industrial contexts :

- no reporting of status code for setting up an industrial application,- no simultaneous execution with an industrial application.

• Description of the tutorial

The tutorial has been designed to communicate on-line with a single PLC and tooperate with all the communication media handled by the OFS server.By default it operates on UNI-TELWAY : PLC connected on the serial port(COM1 or COM2) of the station.In this case, the PLC address is as follows : 0.254.0 (default address).The tutorial launches the OFS server automatically if it has not already beenloaded in the memory.

• Launching the tutorial

In the default configuration handled by the tutorial (PLC connected to the serialport of the station) the tutorial can be launched with its parameters as they havebeen set by the installation procedure :

"Start" | "Programs" | "Modicon Telemecanique" | "Tutorial"

To change the communication medium or the PLC address, the tutorial shortcutcommand line must be modified : "Target" field, "Shortcut" tab in "Properties"window.

The syntax of the command line is as follows :

<AccessPath> tutorial.exe [<DriverName>:<PLCAddress>]

If no parameter is indicated, the connection will be made on UNI-TELWAY ataddress 0.254.0 (default configuration).

Examples of the tutorial shortcut command line :- tutorial.exe ' Connection on UNI-TELWAY at 0.254.0- tutorial.exe ISAWAY01:1.25.0 ' Connection on ISAWAY at 1.25.0- tutorial.exe FIP01:1.2.0 ' Connection on FIPWAY at 1.2.0- tutorial.exe XIP01:127.36.5.3.8 ' Connection on XWAY TCP/IP at 127.36.5.3.8

Page 112: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/2

___________________________________________________________________________

EN

GLI

SH • The functions of the tutorial

- When the tutorial is launched :

· Connection to the PLC via the selected communication medium :default configuration or configuration entered in the shortcut command line.

· Creation and reading of a USER group containing the "#NbrRequest "specific item and system word "%SW50" which is updated every second.

· Creation and reading of a SYSTEM group containing the two specific items"#PLCStatus " and "#TimeOut ".

WARNING :

Initialization of the UNI-TELWAY driver may take up to 15 seconds on somestations. You must wait for the text “Group OPC” to appear in the"UNTLW01:0.254.0!%SW50" item box before performing any operation onthe user interface. During this initialization phase, the mouse pointer is in theform of an hourglass.

- In nominal mode :

· Pointing with the mouse at the various texts in the tutorial window eithershows a tool tip for the buttons, or displays information on the operation ofthe OFS server.

Example :

Pointing to "UNTLW01" gives the value ofthe communication driver time-out :reading of the "#TimeOut" specific item.

Pointing here means simply moving themouse pointer to the text "UNTLW01".

Do not click or move the mouse for 3seconds, until the tool tip appears.

Page 113: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/3

EN

GLI

SH· Activating the "About" button displays a dialog box giving :

- the version index, the release index and the generation number ofthe OFS server,

- the launch date and the execution time of the OFS server.

· Selecting either of the buttons Stop / RUN in the “PLC status” box changesthe operating mode of the PLC : writing of the "#PLCStatus" specific item.

· Activating the "by Notification" button activates the periodic reading of theuser group. The scanning period is one second.

· Activating the "Continually" button activates an infinite loop of "synchronous"readings of the user group. These are an illustration of the handling of readpolling by a client application.

· Activating the "Stop Read" button stops the read operations.

- Closing the tutorial

· Activate the "Stop Read" button in order to stop all read operations,

· Click on the [X] in the top right-hand corner of the tutorial window,

· Close the OFS server by clicking the right mouse button on the icon in thetaskbar then selecting "Close".

Page 114: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/4

___________________________________________________________________________

EN

GLI

SH 9.1-1 CreateObject : Creating an OPC Server Object

Instantiating the OFS server : creation of an object with the progID"Schneider-Aut.OFSAut" for on-line communication, or"Schneider-Aut.OFSSimuAut" for off-line simulation

The instantiation is performed when the tutorial is launched, when the main form isloaded.

Const progID$ = "Schneider-Aut.OPCAut" ' Identification of the OPC serverPublic svr As IOPCServerDisp ' object "OPC server"

Private Sub mnuOPCconnect_Click() ‘ to be connected to the OPC server...set svr = createObject (progID$) ‘ early binding mode...

The object pointer svr sent back by CreateObject is tested to check that it is notzero using the instruction “Is Nothing ”.

OFS

SERVERCLIENT

IDispatch

TUTORIAL

Page 115: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/5

EN

GLI

SH9.1-2 AddGroup : Adding a Group

Function : to create a user group or a system group.Interface : IOPCServerDisp.

Definition of the network driver and the PLC address used to reference item%SW50 in the user group and in the name of the system group :

#If FIP Then ' Conditional Compilation Arg:Const defaultDriverPLC = "FIP01:0.31.0" ' "FIP = 1"#ElseConst defaultDriverPLC = "UNTLW01:0.254.0" ' Here, we've got "FIP = 0"#End IfDim driverPLC$ 'Contents defaultDriverPLC if command() line is empty

Private Sub Form_Load() 'Main entry point: loading of the MAIN form.If Command() = "" Then ' Is a command line prm in the shortcut?

driverPLC$ = defaultDriverPLC ' Use default <driver>:<PLC address>Else ' The command line parameter contents "<driver>:<PLC address>"

driverPLC$ = UCase$(Command()) ' i.e: "ISAWAY01:0.25.12"End If

When it is launched, the tutorial creates two groups :Private Sub Form_Activate() ' Create OPC groups at the first activation.

...If Not createMainGrp() Then End ' Create the normal OPC group.If Not createSystemGrp() Then End' Create the System group....

End Sub 'Form_Activate

• A USER groupDim grpOpc As Object ' The main OPC Group.Const hndCliGrpOpc = 1: Dim hndSrvGrpOpc As Long ' HaNDle side CLIent/SeRVerConst dwLangId_ENGLISH = &H409

'MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US)

Function createMainGrp() As Boolean ' Creation of the main OPC group.Dim rateRevised As Long ' Understood Rate for periodic readings...Set grpOpc = svr.AddGroup ("MAIN", False, 1000, hndCliGrpOpc, 1, _

dwLangId_ENGLISH, hndSrvGrpOpc, rateRevised)

• A SYSTEM groupDim grpSys As Object ' The SYSTEM group.Const hndCliGrpSys = 2: Dim hndSrvGrpSys As Long ' HaNDle side CLIent/SeRVer

Function createSystemGrp() As Boolean ' Create a SYSTEM group.Dim rateDummy As Long, ItemsDef(nbrItems) As String ' Name of each item.

createSystemGrp = False: On Error Resume NextSet grpSys = svr.AddGroup ("_SYS=" + driverPLC$, False, 1000, _

hndCliGrpSys, 1, dwLangId_ENGLISH, _hndSrvGrpSys, rateDummy)

Page 116: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/6

___________________________________________________________________________

EN

GLI

SH 9.1-3 AddItems : Adding Items in a Group

Function : to add items in a group.Interface : IOPCItemMgtDisp.

Items must be added after the two groups (user and system) have been created.

• Adding the "#NbrRequest" and "%SW50" items in the user group :Dim tabItmsOpcHndCli(nbrItems) As Long ' HaNDles of ITeMSDim tabItmsOpcHndSrv(nbrItems) As Long ' Handles returned by the server

Function createMainGrp() As Boolean ' Creation of the main OPC group.Dim ItemsDef(nbrItems) As String ' Name of each item.

...LabelDriverPLC.Caption = driverPLC$ ' "<driver>:<PLC address>".LabelItem.Caption = "!%SW50" ' Name of item prefixed with "!".ItemsDef(0) = LabelDriverPLC.Caption + LabelItem.CaptionItemsDef(1) = "#NbrRequest" ' Specific item NAME in this group.createItems grpOpc, ItemsDef(), tabItmsOpcHndCli(), tabItmsOpcHndSrv()

• Adding the "#PLCStatus" and "#TimeOut" items in the system group :Dim tabItmsSysHndCli(nbrItems) As Long ' Handles of items client side.Dim tabItmsSysHndSrv(nbrItems) As Long ' Handles of specific items

Function createSystemGrp() As Boolean ' Create a SYSTEM group....ItemsDef(0) = "#PLCStatus" ' Name of specific items in the system group.ItemsDef(1) = "#TimeOut"createItems grpSys, ItemsDef(), _

tabItmsSysHndCli(), tabItmsSysHndSrv()

' Creation items of group: IN:ItemsDef() name of items, OUT:tabItemsHdlSrv()Sub createItems(interfaceOfGroup As Object, ItemsDef() As String, _

tabItemsLocHdlClient() As Long, tabItemsHdlSrv() As Long)Dim indItem%, ptrItemMgt As IOPCItemMgtDisp ' Management of item .

' Passing parameters to "AddItems"Dim ItemsActivity(nbrItems) As Boolean ' TRUE by default, items're activatedDim tabItemsLocHdlSrv As Variant ' OUT: handle of itemsDim itemsErrors As Variant ' table of error per itemDim ItemsObject As Variant ' table of created itemsDim accessPath(nbrItems) As String ' IN: empty accessPath for each item

For indItem% = 0 To nbrItems - 1 ' Preparing the prms for "AddItems"ItemsActivity(indItem%) = True ' Item is activated by defaulthndClientItemCounter = hndClientItemCounter + 1tabItemsLocHdlClient(indItem%) = hndClientItemCounter ' Client Handle

NextOn Error Resume NextSet ptrItemMgt = interfaceOfGroup' Create all the OPC items for this groupCall ptrItemMgt.AddItems (nbrItems, ItemsDef, ItemsActivity, _

tabItemsLocHdlClient, _tabItemsLocHdlSrv, itemsErrors, _ItemsObject, accessPath) ...

For indItem% = 0 To nbrItems - 1 ' Successfully new added items. ...tabItemsHdlSrv(indItem%) = tabItemsLocHdlSrv(indItem%)

NextSet ptrItemMgt = Nothing

End Sub 'createItems

Page 117: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/7

EN

GLI

SH9.1-4 OPCRead : Synchronous Reading of a Group

Read primitive used for synchronous reading of all the items in a group.Interface : IOPCSyncIODisp.

The readGroup function in the tutorial performs the synchronous reading of theitems. It is called in the following two cases :

• When the tutorial is launched, to perform the first read of the user group and thesystem group.

- User group :Function createMainGrp() As Boolean ' Creation of the main OPC group....createMainGrp = readGroup(grpOpc, _

tabItmsOpcHndCli(), tabItmsOpcHndSrv())End Function ' createMainGrp

- System group :Function createSystemGrp() As Boolean ' Create a SYSTEM group. ...createSystemGrp = readGroup(grpSys, _

tabItmsSysHndCli(), tabItmsSysHndSrv())End Function ' createSystemGrp

Function readGroup(interfaceOfGroup As Object, _tabItemsLocHdlClient() As Long, tabItemsHdlSrv() As Long)

Dim numItem As Long, ptrSyncIO As IOPCSyncIODisp ' SYNCHRonous I/O .' Passing parameters for OPCRead

Dim pValues As Variant ' OUT: table of values of itemsDim pQualities As Variant, pTimeStamps As Variant, pErrors As Variant

...

Set ptrSyncIO = interfaceOfGroup ' Interface of SYNCHRONOUS I/OCall ptrSyncIO.OPCRead(OPC_DS_DEVICE, nbrItems, tabItemsHdlSrv, _

pValues, pQualities, pTimeStamps, pErrors)...For numItem = LBound(pValues) To UBound(pValues)

...GUIitemDisplay pValues(numItem), (tabItemsLocHdlClient(numItem))

NextSet ptrSyncIO = NothingScreen.MousePointer = vbDefault: readGroup = True

End Function 'readGroup

• When the "Continually" button is activated for continuous reading of the usergroup.

Private Sub OptionReading_Click(Index As Integer) ' Type of readings.Select Case Index ...

Case chkCont: LabelCounter.Caption = 0While OptionReading(chkCont).ValueLabelCounter.Caption = LabelCounter.Caption + 1: DoEventsreadGroup grpOpc, tabItmsOpcHndCli(), tabItmsOpcHndSrv()Wend

...End Sub 'OptionReading_Click

Page 118: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/8

___________________________________________________________________________

EN

GLI

SH 9.1-5 Periodic Reading of the User Group

• AddCallbackReference : subscription to the notification service

Registration of the user group with the OFS server in order to subscribe to thenotification service for the changes of value of these items.Interface : IOPCAsyncIODisp.

In the tutorial, the user group subscribes to the notification service when thegroup is created.

Dim ptrAsyncIO As IOPCAsyncIODisp ' Asynchronous I/O.

Function createMainGrp() As Boolean ' Creation of the main OPC group....Set grpOpc = svr.AddGroup("MAIN", False, 1000, hndCliGrpOpc, 1, _

dwLangId_ENGLISH, hndSrvGrpOpc, rateRevised)...Set ptrGrpStateMgt = grpOpc ' Used in "OptionReading_Click"

Set VbCallBack = New callBackType ' Create a VB callback handlerIf Err.Number <> S_OK Then warning "1020: can’t create VB callback" + _

" for the main OPC group", (Err.Number)

“ Give it to the OPC group interfaceSet ptrAsyncIO = grpOpc ' Get Async interface ptrasynchrHnd = ptrAsyncIO.AddCallbackReference (1000, VbCallBack )If FAILED(Err.Number) Then warning "1030: can’t subscribe callback" + _

'' for the main OPC group", (Err.Number)End Function ' createMainGrp

CallBackType corresponds to a Visual Basic ClassModule , and indicates theimplementation of the "WakeUp" function which is called by the notification service.This CIassModule is implemented in the callBack.CLS file in the tutorial.

The instruction "new CallBackType" creates a new handle on the "WakeUp"function : VbCallBack.

The AddCallBackReference primitive then associates this new handle with theuser group, which establishes the subscription of this group to the notificationservice used by the OFS server.

asynchrHnd, the handle sent back by the AddCallbackReference primitive shouldbe used with the DropCallbackReference primitive to end the notificationmechanism on this group.

OFS

SERVERCLIENT

IDispatch::Invoke

TUTORIAL

InstanciateCallBack.CLS

1

NEWCallBackType

CallBack.CLS

("AddCallbackReference")

2

Registerthe WakeUp

methodof VB Client

Page 119: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/9

EN

GLI

SH• OnDataChange : receiving notifications of changes of value

This method corresponds to the "WakeUp" function to be programmed to receivenotifications transmitted by the OFS server when items in the groups beingperiodically scanned change value.

To use the "WakeUp" function in Visual Basic, the designer must create aClassModule in the client application which he is programming.This ClassModule must expose, in a class with suffix .CLS , an OnDataChangemethod with the syntax below.

Reminder :

In the tutorial, this class is implemented in the callBack.cls file.

Public Sub OnDataChange (GroupHandle As Long, _countOfChangedItems As Long, _ClientHandles() As Long, _valuesItem As Variant, Qualities As Variant, _GroupTime As Variant, TimeStamps As Variant)

Dim indItem As Long

MAIN.LabelCounter.Caption = MAIN.LabelCounter.Caption + 1For indItem = 0 To countOfChangedItems - 1 ' Display each new valueMAIN.GUIitemDisplay valuesItem(indItem), (ClientHandles(indItem))Next

End Sub 'OnDataChange

The notification mechanism reverses the Client / Server relationship : the clientapplication becomes the OLE Automation server to display the OnDataChangemethod to the OFS server, which itself becomes the OLE Automation Client inthis case.

OLE AutomationOFSTUTORIAL

SERVERCLIENT

SERVER CLIENT

IDispatch::Invoke("AddCallbackReference")

IDispatch::Invoke

("OnDataChange")

Page 120: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/10

___________________________________________________________________________

EN

GLI

SH • ActiveStatus : activating the group to authorize the notifications

Activation of the periodic reading of a user group.Interface IOPCGroupStateMgtDisp.

In the tutorial, the periodic reading is controlled by the "by Notification" radiobutton.

Private Sub OptionReading_Click(Index As Integer) ' Type of readings.Select Case IndexCase chkNotify: LabelCounter.Caption = 0 ' The main OPC Group

ptrGrpStateMgt.ActiveStatus = True ' ... is activated....End Select

End Sub 'OptionReading_Click

The periodic reading is triggered as soon as the ActiveStatus property of theuser group is set to the value TRUE.The OFS server then uses the scanning period given when the group wascreated : 3rd parameter of the AddGroup primitive.In the tutorial, this value has been set at 1000 ms.

Reminder :

A group should never activate notification when it is created : the 2nd parameter of theAddGroup primitive must always be set to the value FALSE.It is only after an item has been created that the ActiveStatus property of the group canbe changed to TRUE to trigger the periodic reading.

Page 121: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/11

EN

GLI

SH9.1-6 OPCWrite : Writing the Value of the Items in a Group

Writing items from a group in the PLC.Interface : IOPCSyncIODisp.

The tutorial illustrates this function by using the writing of the "#PLCStatus" specificitem of the system group.The write operation is triggered by activating one of the radio buttons in the "PLCstatus" box : "Stop" or "RUN".

Note :

The tutorial program requests confirmation to the user before calling the write primitiveresponsible for modifying the operating mode of the PLC.

Note :

Writing items in a user group is identical to that described in this section.

Private Sub OptionPLCStatus_Click(Index As Integer) ' WRITING "#PLCStatus"Const nbrWriteItems = 1: Dim ptrSyncIO As IOPCSyncIODisp ' SYNCHRonous I/O.Dim itemsValues(nbrWriteItems) As Variant, itemsErrors As Variant

If framePLCStatus.ToolTipText = ' #PLCStatus=" + Str$(Index) Then Exit SubIf MsgBox ("Do you want to set the PLC status to " + _

Mid$(OptionPLCStatus(Index).Caption, 2), _vbQuestion Or vbOKCancel, _"Confirmation of PLC Status change") = vbCancel Then

If Index = PLCrun Then Index = PLCstop Else Index = PLCrun ' RestoreframePLCStatus.ToolTipText = "#PLCStatus=" + Str$(Index) ' previousOptionPLCStatus(Index).Value = True: Exit Sub ' PLC status.

End If

On Error Resume NextSet ptrSyncIO = grpSys ' SYNCHR. I/O Interface for the SYSTEM group.itemsValues(0) = Index ' 0: stop, 1: run, (2: init)ptrSyncIO.OPCWrite nbrWriteItems, tabItmsSysHndSrv, itemsValues, _

itemsErrorsIf FAILED(Err.Number) Then warning ' 1090: OPCWrite fails " + _

' on item #PLCStatus", (Err.Number)If FAILED(itemsErrors(0)) Then warning "1100: OPCWrite fails " + _

' on specific item #PLCStatus", itemsErrors(0)framePLCStatus.ToolTipText = "#PLCStatus=" + Str$(Index)

End Sub 'OptionPLCStatus_Click

Page 122: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/12

___________________________________________________________________________

EN

GLI

SH 9.1-7 DropCallbackReference and RemoveGroup : Closing the Tutorial

When it is closed, the tutorial program must in particular :

• Indicate to the OFS server that it no longer wishes to receive notifications on theuser group : calling of the "DropCallReference " primitive.It is essential to remove the link between the "WakeUp" function and the group :

Set VbCallBack = Nothing

• Remove the groups of items using the "RemoveGroup " primitive.

• Remove the interfaces to the server.

Private Sub Form_Unload(Cancel As Integer) ' Shutting down of the form.On Error Resume Next ' Don't worry if it never fails.OptionReading_Click chkStop ' Disable notificationSet VbCallBack = Nothing: ptrAsyncIO.DropCallbackReference asynchrHnd

Set ptrAsyncIO = Nothing: Set ptrGrpStateMgt = Nothing

Set grpOpc = Nothing: svr.RemoveGroup hndSrvGrpOpc, FalseSet grpSys = Nothing: svr.RemoveGroup hndSrvGrpSys, False

Set svr = NothingEnd Sub 'Form_Unload

Note :

It is preferable to stop all read operations (continuous or periodic) before closing theclient application. To do this, select the "Stop Read" radio button.

Page 123: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/13

EN

GLI

SH9.1-8 GetErrorString : Managing OPC, OFS and Win32 Errors

In the tutorial, error handling is centralized in the "warning" function for all the OFSserver primitives which are used.

The "warning" function performs a first pass to check the type of error and forformatting, then calls the "OPCerrorString" function :

Sub warning(msg$, ByVal HResultErrorCode As Long) ' Error manager handler.Dim txtError$

If HResultErrorCode <> S_OK ThentxtError$ = vbCrLf + "Error" + " 0x" + Hex(HResultErrorCode)Clipboard.SetText " 0x" + Hex(HResultErrorCode) ' Ctrl+C HRESULT' Get the message from VB Error ManagerIf Err.Description <> "" Then txtError$ = txtError$ + ": " + _

Err.DescriptiontxtError$ = txtError$ + vbCrLfIf Err.Source <> "" Then txtError$ = txtError$ + "Object: " + _

Err.Source + vbCrLftxtError$ = txtError$ + OPCerrorString(HResultErrorCode) ' OPC/EOLES

End IfScreen.MousePointer = vbDefaultMsgBox Mid$(msg$, 7) + txtError$, vbExclamation, _

App.EXEName + " warning " + Left$(msg$, 4)Unload MAIN: End

End Sub ' warning

The "OPCerrorString" function calls "GetErrorString " to obtain the description ofthe error :

Function OPCerrorString(HResultErrorCode As Long) As StringConst maxErrorMsgPerLine = 50: Dim msgError$, indBlank%

msgError$ = ""If Not isErrorStringFAILED Then

On Error Resume NextmsgError$ = svr.GetErrorString(HResultErrorCode, dwLangId_ENGLISH)If FAILED(Err.Number) Then

isErrorStringFAILED = True “ Avoid infinite recursive calls.warning "1110: GetErrorString fails for HRESULT = 0x" + _

Hex$(HResultErrorCode), (Err.Number)End IfIf Len(msgError$) > maxErrorMsgPerLine Then

indBlank% = InStr(maxErrorMsgPerLine, msgError$, " ")If indBlank% > 0 Then

msgError$ = Left$(msgError$, indBlank% - 1) + vbCrLf + _Space$(9) + Mid$(msgError$, indBlank% + 1)

End IfEnd If

End IfOPCerrorString = msgError$

End Function ' OPCerrorString

Page 124: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/14

___________________________________________________________________________

EN

GLI

SH 9.1-9 MajorVersion : Information on the OFS Server

All the information is displayed by activating the "About" button :

Private Sub CmdAbout_Click() ' About TUTORIAL!MsgBox "You’re connected to the OPC server" + vbCrLf + _

progID$ + " V" + Str$(svr.MajorVersion ) + "." + _Format$(svr.MinorVersion ) + "." + Format$(svr.BuildNumber ) + _vbCrLf + vbCrLf + "at " + _Format$(svr.StartTime, "dddd, mmmm d, yyyy hh:mm:ss AMPM") + _Format$(svr.CurrentTime - svr.StartTime , "hh:mm:ss") + vbCrLf + _"Copyright © 1998 Schneider Automation", _vbInformation Or vbOKOnly, "About VB OPC " + UCase$(App.EXEName) + _" V" + Str$(App.Major) + "." + Format$(App.Minor) + "." + _Format$(App.Revision)

End Sub ' CmdAbout_Click

Page 125: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/15

EN

GLI

SH

9.2 Tutorial on Creating a Client Application in C ++

The full source code of the example described below can be installed on yourmachine if you check the Tutorial option when installing the server. It is put into theTutorial\Mfc sub-directory. The example client application described in this sectionillustrates the use of the OPC Custom Interfaces defined by the OFS server. It hasbeen developed using Visual C++ 5.0 SP3.

Note :

The restrictions of the previous VB Tutorial apply also for the C++ Tutorial.

• Description of the tutorial

The tutorial has been designed to communicate on-line with a single PLC viaany protocol supported by the OFS server.

• Launching the tutorial

1. "Start">"Programs">"Modicon Telemecanique">"OFS Testing Clients">"C++ Tutorial OFS" ,

2. Select "OPC Factory Server" (on-line) or "OPC Factory "Simulator"(off-line) in the list box,

3. Enter the the address and the definition of the Item you want to access(separated by a ‘!’),

For instance : UNTLW01 :0.254.0 !%SW50 to access a PLC with the UNI-TELWAY protocol MBP00 :DM.12 !400001 to access a PLC with the Modbus+ protocol

4. Click on the "CONNECT" button.

WARNING :

Initialization of the UNI-TELWAY driver may take up to 15 secondson some stations. During this initialization phase, the mouse pointeris in the form of an hourglass.

Page 126: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/16

___________________________________________________________________________

EN

GLI

SH The "Active" checkbox is initially checked. This means that the value of the item is

displayed at each change.

If you uncheck the checkbox, you can click manually on the “Synchronous. Read”button to read the value of the item.

On the left side, the “PLC Status” frame indicates if the PLC is running. Selectingeither of the "Stop" / "Run" option buttons changes the operating mode of thePLC, and writes to the “#PLCStatus ” specific item.

Closing the tutorial, then the server

1. Click on the [X] in the top right-hand corner of the tutorial window,

2. Close the OFS server by clicking the right mouse button on the icon in the taskbarthen selecting "Close" .

9.2-1 Creating an OPC Server Object

The Tutorial function that performs this operation is called ConnectServer .

This function uses the Microsoft CLSIDFromProgID API to convert the servername into an internal key (CLSID), then creates the connection by callingCoCreateInstance .

Comment :

This will start the server if it is not already running.

9.2-2 Adding a Group

The creation of the group is implemented in the CreateGroup method. It is basedon a call to the AddGroup method of the IOPCServer interface.

Page 127: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/17

EN

GLI

SH9.2-3 Adding Items to a Group

The two PLC variables used in in the tutorial are added to the group in the CreateItemsmethod. They are both created in a single call to the AddItems method of theIOPCItemMgt interface.

9.2-4 Synchronous Reading of a Group

The synchronous read is performed with the IOPCSyncIO interface. Two methodsimplement this solution to retrieve values from the server. The ReadPLCStatus methodreads the state of the PLC, and ReadItem reads tha value of the item.

9.2-5 Periodic Reading of the User Group

When the group is active, it receives values of items that have changed. The mecanismused to subscribe to this service is the OLE Uniform Data Transfer . The CreateGroupmethod calls the method DAdvise of the IDataObject interface. Then notifications aresent to the OnDataChange method of the callback interface implemented with theCAdviseSink class in the tutorial.

The active property of the group can be changed with the GetState and SetStatemethods. The SetActiveStatus method uses this functionality to set or reset theproperty when the check box is changed.

9.2-6 Writing the Value of the Items to a Group

The tutorial uses the OPC synchronous write of the IOPCSyncIO interface tochange the state of the PLC when one of the option buttons is checked. This isimplemented in the WritePLCStatus method.

Page 128: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/18

___________________________________________________________________________

EN

GLI

SH 9.2-7 Closing the Tutorial

When it is closed, the tutorial program must in particular :

• Indicate to the OFS server that it no longer wishes to receive notifications on theuser group : calling of the "DUadvise " primitive of the IDataObject interface.

• Remove the group using the "RemoveGroup " primitive.

• Release all server interfaces.

9.2-8 Managing OPC, OFS and Win32 Errors

In the tutorial, error handling is centralized in the "HandleError" function for all theOFS server primitives which are used.

The "HandleError" function performs a first pass to check the type of error and forformatting, then calls the "GetErrorString" OPC method of the IOPCServer interface.

Page 129: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/19

EN

GLI

SH

9.3 OFS server compatibility

OFS is compatible with OPC 1.01A

OFS is compatible with any client application developped for Exchange OLE Server:eOLEs V 1.0.600 IE13 supplied with the PCX PLC.

In particular, OFS supports the notion of SYNCHRONOUS group mono-request,mono-PLC. Syntactically, the name of a synchronous group begins by “$” (seesection 6.3).

OFS supports also for compatibility the notion of SYSTEM group dedicated to onlyone couple of driver and PLC address:

System groups are related to a given device and are used to manage the specificitems related to that device. System groups are distinguished from user groups bytheir name, which must contain the prefix “_SYS=”.

A system group only contains the following specific items beginning by “#” :

• “#PLCStatus” for managing the operating mode of a PLC

• “#TimeOut” for managing the time-out of a communication medium

• “#NbrRequest” to know the number of requests sent to that device

OFS shares some common error names with eOLEs. Those code-names beginwith the “EOL_” prefix standing for eOLEs.

Specific items and system groups can NOT be activated. No notification orasynchronous read/write is possible.

Page 130: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/20

___________________________________________________________________________

EN

GLI

SH

9.4 Glossary

Address "Manufacturer" name of a control system variable. For example "%MW1".

Client application Software using the primitives provided by a server application, viamechanisms (interfaces) set up by OLE.

Multi -client Several client applications simultaneously accessing the same serverapplication.

OPC group Controls a collection of OPC items, ie. a list of PLC variables.

OPC item PLC variable on a PLC and a given communication medium.

OPC server Controls a collection of OPC groups. Hierarchical root of the OPC model.

Remote server The client application and the server application are located on 2separate stations connected via the Microsoft TCP/IP network.

Server application Software displaying the primitives to the client applications, viamechanisms (interfaces) set up by OLE.

Socket Communication channel established between the OFS server and one ormore PLCs, on a given communication medium.The number of sockets available depends on the communicationmedium.

Symbol Identifier assigned to a control system variable by a designer. Forexample "PUMP".A symbol cannot start with the prefix ‘%’.

Page 131: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/21

EN

GLI

SH

9.5 Abbreviations

COM Component Object Model : foundations of the OLE 2.0 standard.

DCOM Distributed COM : COM model distributed on a network under TCP/IP.

OFS OPC Factory Server : OLE server for exchanging data with the PLC.

FIP Factory Instrumentation Protocol.

LCID Language Code IDentifier.

OLE Object L inking and Embedding. In particular provides the OLEAutomation interface, a technique which enables a server to exposeprimitives and properties to a Client.

OPC OLE for Process Control.

PLC Programmable Logical Controller

SP Service Pack : corrections and upgrades to an operating system.

UNC Universal Naming Convention.

VB Visual Basic : widely used language supporting OLE Automation.

VBA V isual Basic for Application : script language with Basic syntax includedin the MS-Office suite.

Wintel Win dows/Intel : describes a PC with a 32-bit Windows operating systemand an Intel x86 processor.

Page 132: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/22

___________________________________________________________________________

EN

GLI

SH

9.6 Recommendations in the Event of a Problem

• Using screen savers

It is not advisable to use a screen saver in parallel with the OFS server, and inparticular screen savers with a password ("lock NT WorkStation" option).

• User rights under NT 4.0

The OFS server will not run and can only be installed if the session is executedunder an ADMINISTRATOR account.

• Remote access problem with NT 4.0

Check that the user rights are correctly managed : adjust using theDCOMCNFG.exe tool.

• ATL error message when the OFS server is instantiated by the clientapplication

Text of the message :Debug Assertion Failed!Program:D:\dev\client\clientVB\clientVB.exeFile: d:\DevStudio\VC\ATL\include\atlimpl.cppLine: 1182Expression: hKeyParent != NULL

You do not have the ADMINISTRATOR rights under NT 4.0.You must open a session on the account which has the administrator rights torun the OFS server.

• "User-defined type not defined" error during compilation of the declarationof the "OPC Server" object in Visual Basic

Instruction to which the error applies :Dim SVR as IOPCServerDisp

The interfaces presented by the OFS server are not recognised by Visual Basic.You must register these interfaces using the “Tools” > “References” menu ofVB5 SP3 and then, select the OFSauto.dll for OFS.exe or OFSSimuAuto.dll forOFS_SIMU.exe since those OPC Automation in-proc handlers contain the TypeLibrary of the server.

• EOL_E_OPEN_SYMBOLS_FAILURE error obtained when creating a usergroup with symbols file

If you have not given the absolute path for the file, check that the "Symbols"option is correct in the registry.

If you have not defined this option, check that the C:\OPC_SYMB directory existsand contains the .SCY or .FEF neutral file.

If you have inserted a space after "=" in the name of the group, it must beremoved.Example :

"grpName= symb.scy" becomes "grpName=symb.scy".

Page 133: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/23

EN

GLI

SH

9.7 Exhaustive List of Error Codes

9.7-1 Main errors defined by OLE

HRESULT NAME COMMENT

00000000 S_OK The primitive has been executed(S)uccessfully

00000001 S_FALSE (S)uccess status for the primitive,but with at least one error on an item

80004005 E_FAIL The primitive has failed

80010105 RPC_E_SERVERFAULT The server has thrown an exception

8007000E E_OUTOFMEMORY Insufficient memory

Page 134: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/24

___________________________________________________________________________

EN

GLI

SH 9.7-2 Errors Defined by the OPC Standard

HRESULT NAME COMMENT

C0040001 OPC_E_INVALIDHANDLE An invalid handle was passed

C0040002 OPC_E_DUPLICATE A duplicate parameter was passedwhere one is not allowed

C0040003 OPC_E_UNKNOWNLCID The server does not support thespecified local id

C0040004 OPC_E_BADTYPE The server cannot convert betweenthe passed or requested data typeand the canonical type

C0040005 OPC_E_PUBLIC The requested operation cannot bedone on a public group

C0040006 OPC_E_BADRIGHTS The item’s AccessRights do not allowthe operation

C0040007 OPC_E_UNKNOWNITMEID The item definition does not existwithin the servers address space

C0040008 OPC_E_INVALIDITEMID The item definition does not conformto the server’s syntax

C0040009 OPC_E_INVALIDFILTER The filter string is not valid

C004000A OPC_E_UNKNOWNPATH The item’s access path is not knownto the server

C004000B OPC_E_RANGE The value passed to WRITE was outof range

C004000C OPC_E_DUPLICATE_NAME A group with a duplicate name alreadyexists in the server

0004000D OPC_S_UNSUPPORTEDRATE The server does not support therequested rate, but will use the closestavailable

0004000E OPC_S_CLAMP A value passed to WRITE wasaccepted, but was clamped

Page 135: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/25

EN

GLI

SH9.7-3 Errors Defined by the OFS Server

# HRESULT NAME COMMENT

1 EFEF61A8 OFS_E_NO_DEFAULT_DIRECTORY No default directory forsymbol table

2 EFEF61A9 OFS_E_UNABLE_TO_RELOAD_ST Unable to reloadsymbol table

3 EFEF61AA OFS_E_UNSUPPORTED_ST_TYPE Unsupported symboltable type

4 2FEF61AB OFS_S_ST_NOT_CURRENTLY_USED Symbol table notcurrently used

5 EFEF61AC OFS_E_ALIAS_ALREADY_DEFINED Alias already defined

6 EFEF61AD OFS_E_ALIAS_OVERFLOW Alias’ number overflow

7 EFEF61AE OFS_E_ALIAS_NOT_FOUND Alias not found

8 EFEF61AF OFS_E_UNABLE_TO_LOAD_ST Unable to load symboltable

9 EFEF61B0 OFS_E_CF_FORMAT_NOT_SUPPORTED Unsupported clipboardformat

10 EFEF61B1 OFS_E_CANNOT_SET_SYSTEM_GROUP_STATE Set state is notsupported for systemgroups

11 EFEF61B2 OFS_E_DUPLICATE_CLIENT_HANDLE Duplicate client handle

12 EFEF61B3 OFS_E_BAD_TYPE_REQUESTED Bad type requested

13 EFEF61B4 OFS_E_READ_FAILURE Read failure

14 EFEF61B5 OFS_E_SET_ITEM_STATE_SYNCHRO Changes of item statein synchro groupforbidden

15 EFEF61B6 OFS_E_SAFEARRAY_CREATION_FAILURE The creation of aSAFEARRAY hasfailed

16 EFEF61B7 OFS_E_SAFEARRAY_EMPTY An emptySAFEARRAY wasfound

17 EFEF61B8 OFS_E_ASYNC_READ_REJECTED RejectedAsynchronous READ

18 EFEF61B9 OFS_E_THREAD_CREATION_FAILURE The creation of athread failed

19 EFEF61BA OFS_E_NO_ACTIVE_ITEM There is no active item

20 EFEF61BB OFS_E_GROUP_NOT_ACTIVE The group is not active

21 EFEF61BC OFS_E_TRANSACTION_NOT_FOUND The transaction ID wasnot found

Page 136: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/26

___________________________________________________________________________

EN

GLI

SH # HRESULT NAME COMMENT

22 EFEF61BD OFS_E_BAD_GROUP_TYPE_FOR_ITEM Cannot create thespecified item in thegroup

23 EFEF61BE OFS_E_ST_NOT_DEFINED Symbol table notdefined

24 EFEF61BF OFS_E_ASYNC_WRITE_REJECTED RejectedAsynchronous WRITE

25 EFEF61C0 OFS_E_MODBUS_MBT_RCV_TO Time-out on ModbusTCP/IP network

26 EFEF61C1 OFS_E_MODBUS_MBT_RCV_ERROR Receive Error onModbus TCP/IPnetwork

27 EFEF61C2 OFS_E_MODBUS_MBT_SEND_ERROR Send Error on ModbusTCP/IP network

28 EFEF61C3 OFS_E_MODBUS_NCB_WAIT_ERROR Receive Error onModbus+ network

29 EFEF61C4 OFS_E_MODBUS_NCB_SEND_ERROR Send Error onModbus+ network

30 EFEF61C5 OFS_E_MODBUS_NCB_BAD_ANSWER Bad Answer Receivedon Modbus (object outof configuration ??)

31 EFEF61C6 OFS_E_CONCEPT_IEC_NOT_SUPPORTED IEC Runtime Conceptnot supported by thisdevice

32 EFEF61C7 OFS_E_MODBUS_DEVICE_NOT_CONSISTENT Consistency errorbetween ModbusDevice and Symboltable

33 EFEF61C8 OFS_E_MODBUS_DETECTION_DEVICE_ERROR Modbus Device notfound

34 EFEF61C9 OFS_E_MODBUS_TO_CHECK_CNX Time-out error whensearching Modbusdevice

35 EFEF61CA OFS_E_MODBUS_DRIVER_ID_ERROR Driver identificationerror

36 EFEF61CB OFS_E_NETLIB_OPEN_ERROR Netlib library openerror

37 EFEF61CC OFS_E_NETLIB_LOAD_ERROR Netlib DLL load error

38 EFEF61CD OFS_E_MODBUS_PLUS_DRIVER_NOT_FOUND Modbus+ driver notfound (not installed ??)

Page 137: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/27

EN

GLI

SH# HRESULT NAME COMMENT

39 EFEF61CE OFS_E_NCB_OPEN_ERROR MODBUS + : DM orPM path open error (allpaths used ?)

40 EFEF61CF OFS_E_NCB_REOPEN_ERROR MODBUS + : DM orPM path re-open error(all paths used ?)

41 EFEF61D0 OFS_E_MODBUS_MBT_CONNECT1 Server Internal Error

42 EFEF61D1 OFS_E_MODBUS_MBT_BAD_SOCKET Server Internal Error

43 EFEF61D2 OFS_E_MODBUS_MBT_SETSOCKOPT1 Server Internal Error

44 EFEF61D3 OFS_E_MODBUS_MBT_SETSOCKOPT2 Server Internal Error

45 EFEF61D4 OFS_E_MODBUS_MBT_SETSOCKOPT3 Server Internal Error

46 EFEF61D5 OFS_E_MODBUS_MBT_DNS_FAILED DNS / IP addressimpossible (Name notfound ?)

47 EFEF61D6 OFS_E_MODBUS_MBT_BAD_HOST Server Internal Error

48 EFEF61D7 OFS_E_MODBUS_MBT_BAD_INET Incorrect IP address

49 EFEF61D8 OFS_E_MODBUS_MBT_BAD_SOCKSTATE1 Server Internal Error

50 EFEF61D9 OFS_E_MODBUS_MBT_BAD_SEND Server Internal Error

51 EFEF61DA OFS_E_MODBUS_MBT_BAD_STATE Server Internal Error

52 EFEF61DB OFS_E_MODBUS_MBT_OVERFLOW Modbus requestWaiting emissionQueue full

53 EFEF61DC OFS_E_MODBUS_IOCTL1 Server Internal Error

54 EFEF61DD OFS_E_MODBUS_IOCTL2 Server Internal Error

55 EFEF61DE OFS_E_MODBUS_IOCTL3 Server Internal Error

56 EFEF61DF OFS_E_MODBUS_IOCTL4 Server Internal Error

57 EFEF61E0 OFS_E_MODBUS_IOCTL5 Server Internal Error

58 EFEF61E1 OFS_E_MODBUS_IOCTL6 Server Internal Error

59 EFEF61E2 OFS_E_MODBUS_IOCTL7 Server Internal Error

60 EFEF61E3 OFS_E_XWAY_IOCTL1 Server Internal Error

61 EFEF61E4 OFS_E_XWAY_IOCTL2 Server Internal Error

62 EFEF61E5 OFS_E_XWAY_IOCTL3 Server Internal Error

63 EFEF61E6 OFS_E_XWAY_IOCTL4 Server Internal Error

64 EFEF61E7 OFS_E_XWAY_IOCTL5 Server Internal Error

65 EFEF61E8 OFS_E_XWAY_IOCTL6 Server Internal Error

66 EFEF61E9 OFS_E_XWAY_IOCTL7 Server Internal Error

Page 138: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/28

___________________________________________________________________________

EN

GLI

SH # HRESULT NAME COMMENT

67 EFEF61EA OFS_E_XWAY_IOCTL8 Server Internal Error

68 EFEF61EB OFS_E_XWAY_IOCTL9 Server Internal Error

69 EFEF61EC OFS_E_XWAY_IOCTL10 Server Internal Error

70 EFEF61ED OFS_E_XWAY_IOCTL11 Server Internal Error

71 EFEF61EE OFS_E_XWAY_IOCTL12 Server Internal Error

72 EFEF61EF OFS_E_XWAY_IOCTL13 Server Internal Error

73 EFEF61F0 OFS_E_XWAY_IOCTL14 Server Internal Error

74 EFEF61F1 OFS_E_XWAY_IOCTL15 Server Internal Error

75 EFEF61F2 OFS_E_MODBUS_LIST1 Server Internal Error

76 EFEF61F3 OFS_E_MODBUS_LIST2 Server Internal Error

77 EFEF61F4 OFS_E_MODBUS_LIST3 Server Internal Error

78 EFEF61F5 OFS_E_MODBUS_LIST4 Server Internal Error

79 EFEF61F6 OFS_E_MODBUS_LIST5 Server Internal Error

80 EFEF61F7 OFS_E_MODBUS_LIST6 Server Internal Error

81 EFEF61F8 OFS_E_MODBUS_LIST7 Server Internal Error

82 EFEF61F9 OFS_E_MODBUS_LIST8 Server Internal Error

83 EFEF61FA OFS_E_MODBUS_LIST9 Server Internal Error

84 EFEF61FB OFS_E_MODBUS_LIST10 Server Internal Error

85 EFEF61FC OFS_E_XWAY_LIST1 Server Internal Error

86 EFEF61FD OFS_E_XWAY_LIST2 Server Internal Error

87 EFEF61FE OFS_E_XWAY_LIST3 Server Internal Error

88 EFEF61FF OFS_E_XWAY_LIST4 Server Internal Error

89 EFEF6200 OFS_E_XWAY_LIST5 Server Internal Error

90 EFEF6201 OFS_E_XWAY_LIST6 Server Internal Error

91 EFEF6202 OFS_E_XWAY_LIST7 Server Internal Error

92 EFEF6203 OFS_E_XWAY_LIST8 Server Internal Error

93 EFEF6204 OFS_E_XWAY_LIST9 Server Internal Error

94 EFEF6205 OFS_E_MODBUS_BAD_READCPU Server Internal Error

95 EFEF6206 OFS_E_MODBUS_CMD_FAILURE Server Internal Error

96 EFEF6207 OFS_E_MODBUS_LOGIN_FAILURE This device is alreadyreserved by other tool(Concept ?)

97 EFEF6208 OFS_E_MODBUS_LOGOUT_FAILURE Server Internal Error

98 EFEF6209 OFS_E_XWAY_NET_OPEN Server Internal Error

Page 139: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/29

EN

GLI

SH# HRESULT NAME COMMENT

99 EFEF620A OFS_E_XWAY_NET_ATTACH Server Internal Error

100 EFEF620B OFS_E_XWAY_NET_LOCALINFO Server Internal Error

101 EFEF620C OFS_E_XWAY_TEST_PDU_SIZE Server Internal Error

102 EFEF620D OFS_E_XWAY_DRIVER_ID_ERROR Server Internal Error

103 EFEF620E OFS_E_XWAY_CHECK_DEVICE Server Internal Error

104 EFEF620F OFS_E_XWAY_BAD_READCPU Server Internal Error

105 EFEF6210 OFS_E_XWAY_READCPU_FAILURE Server Internal Error

106 EFEF6211 OFS_E_XWAY_WRITECPU_FAILURE Server Internal Error

107 EFEF6212 OFS_E_XWAY_BAD_CMD Server Internal Error

108 EFEF6213 OFS_E_BAD_PATH_SPECIFIC_ITEM Server Internal Error

109 EFEF6214 OFS_E_DIAG_CNX_OPEN Server Internal Error

110 EFEF6215 OFS_E_NO_DIAG_CNX Server Internal Error

111 EFEF6216 OFS_E_SPECIFIC1 Server Internal Error

112 EFEF6217 OFS_E_SPECIFIC2 Server Internal Error

113 EFEF6218 OFS_E_DRVMDB1 Server Internal Error

114 EFEF6219 OFS_E_REQMDB1 Server Internal Error

115 EFEF621A OFS_E_REQMDB2 Server Internal Error

116 EFEF621B OFS_E_MISCXWAY1 Server Internal Error

117 EFEF621C OFS_E_TMDB1 Server Internal Error

118 EFEF621D OFS_E_TMDB2 Server Internal Error

119 EFEF621E OFS_E_TMDB3 Server Internal Error

120 EFEF621F OFS_E_TMDB4 Server Internal Error

121 EFEF6220 OFS_E_TMDB5 Server Internal Error

122 EFEF6221 OFS_E_TMDB6 Server Internal Error

123 EFEF6222 OFS_E_TMDB7 Server Internal Error

124 EFEF6223 OFS_E_TMDB8 Server Internal Error

125 EFEF6224 OFS_E_TMDB9 Server Internal Error

126 EFEF6225 OFS_E_TMDB10 Server Internal Error

127 EFEF6226 OFS_E_TMDB11 Server Internal Error

128 EFEF6227 OFS_E_MISCXWAY2 Server Internal Error

129 EFEF6228 OFS_E_NETLOCAL1 Server Internal Error

130 EFEF6229 OFS_E_T_VM1 Server Internal Error

131 EFEF622A OFS_E_T_VM2 Server Internal Error

Page 140: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/30

___________________________________________________________________________

EN

GLI

SH # HRESULT NAME COMMENT

132 EFEF622B OFS_E_T_VM3 Server Internal Error

133 EFEF622C OFS_E_T_VM4 Server Internal Error

134 EFEF622D OFS_E_T_VM5 Server Internal Error

135 EFEF622E OFS_E_T_VM6 Server Internal Error

136 EFEF622F OFS_E_T_VM7 Server Internal Error

137 EFEF6230 OFS_E_T_VM8 Server Internal Error

138 EFEF6231 OFS_E_T_VM9 Server Internal Error

139 EFEF6232 OFS_E_T_VM10 Server Internal Error

140 EFEF6233 OFS_E_T_VM11 Server Internal Error

141 EFEF6234 OFS_E_READ_SYNC_FAILURE Server Internal Error

142 EFEF6235 OFS_E_SRVM1 Server Internal Error

143 EFEF6236 OFS_E_SRVM2 Server Internal Error

144 EFEF6237 OFS_E_SRVM3 Server Internal Error

145 EFEF6238 OFS_E_RW1 Server Internal Error

146 EFEF6239 OFS_E_BAD_SYS_GROUP Bad System Groupdefinition

147 EFEF623A OFS_E_BAD_ITEM_NUMBER Server Internal Error

148 EFEF623B OFS_E_BAD_POSTFIX Bad postfix for this item

149 EFEF623C OFS_E_DUPL_POSTFIX Postfix RedefinitionError for this item

150 EFEF623D OFS_E_DUPL_ARRAY_LEN Array Len RedefinitionError for this item

151 EFEF623E OFS_E_BAD_RANGE_ID Bad range_id forModbus Address

152 EFEF623F OFS_E_WRONG_DIGIT_NUMBER Wrong digit number forModbus address (6digits in any case)

153 EFEF6240 OFS_E_WRONG_ARRAY_LEN Array Length DefinitionError

154 EFEF6241 OFS_E_NO_ARRAY_OF_ARRAY Array of Array notsupported (RedefinitionError ?)

155 EFEF6242 OFS_E_MODBUS_UNSUPPORTED_DATA_TYPE MODBUS unsupporteddata type

156 EFEF6243 OFS_E_NO_MODBUS_REQ_GEN_ERROR Server Internal Error

157 EFEF6244 OFS_E_NO_MODBUS_REQ_GENERATED Server Internal Error

Page 141: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/31

EN

GLI

SH# HRESULT NAME COMMENT

158 EFEF6245 OFS_E_BAD_MODBUS_ITEM_DEF MODBUS Itemdefinition Error

159 EFEF6246 OFS_E_WRITESYNC_FAILURE Write Failure

160 EFEF6247 OFS_E_BAD_IEC_WRITE_ANSWER Write request reject bythe Quantum IECRuntime

161 EFEF6248 OFS_E_NO_REQ_TO_SEND Server Internal Error

162 EFEF6249 OFS_E_MODBUS_SEND_FAILURE Server Internal Error

163 EFEF624A OFS_E_REMOVE_ERR1 Server Internal Error

164 EFEF624B OFS_E_REMOVE_ERR2 Server Internal Error

165 EFEF624C OFS_E_DEACTIVE_ERR Server Internal Error

166 EFEF624D OFS_E_MOD_RATE_ERR Server Internal Error

167 EFEF624E OFS_E_MODBUS_THREAD_FAILURE Server Internal Error

168 EFEF624F OFS_E_MODBUS_READ_FAILURE Modbus Read Failure

169 EFEF6250 OFS_E_XWAY_BAD_ITEM_DEF XWAY Item definitionError

170 EFEF6251 OFS_E_XWAY_UNSUPPORTED_DATA_TYPE XWAY unsupporteddata type

171 EFEF6252 OFS_E_NO_XWAY_REQ_GEN_ERROR Server Internal Error

172 EFEF6253 OFS_E_NO_XWAY_REQ_GENERATED Server Internal Error

173 EFEF6254 OFS_E_XWAY_READ_FAILURE XWAY read failure

174 EFEF6255 OFS_E_XWAY_BAD_WRITE_ANSWER1 Server Internal Error

175 EFEF6256 OFS_E_XWAY_BAD_WRITE_ANSWER2 Server Internal Error

176 EFEF6257 OFS_E_XWAY_EXEC_READ_FAILURE Server Internal Error

177 EFEE4971 EOL_E_INVALID_GROUP_NAME Invalid group name

178 6FEE4972 EOL_S_INVALID_APPLI_NAME Name of application inPLC differs from nameregistered in symbolsfile

179 6FEE4973 EOL_S_INVALID_APPLI_VERSION Evolution number ofapplication in PLCdiffers from numberregistered in symbolsfile

180 EFEE4974 EOL_E_INVALID_ARG1 Argument 1 is not valid

181 EFEE4975 EOL_E_INVALID_ARG2 Argument 2 is not valid

182 EFEE4976 EOL_E_INVALID_ARG3 Argument 3 is not valid

Page 142: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/32

___________________________________________________________________________

EN

GLI

SH # HRESULT NAME COMMENT

183 EFEE4977 EOL_E_INVALID_ARG4 Argument 4 is not valid

184 EFEE4978 EOL_E_INVALID_ARG5 Argument 5 is not valid

185 EFEE4979 EOL_E_INVALID_ARG6 Argument 6 is not valid

186 EFEE497A EOL_E_INVALID_ARG7 Argument 7 is not valid

187 EFEE497B EOL_E_INVALID_ARG8 Argument 8 is not valid

188 EFEE497C EOL_E_INVALID_ARG9 Argument 9 is not valid

189 EFEE497D EOL_E_INVALID_ARG10 Argument 10 is notvalid

190 EFEE497E EOL_E_INVALID_ARG11 Argument 11 is notvalid

191 EFEE497F EOL_E_INVALID_ARG12 Argument 12 is notvalid

192 EFEE4980 EOL_E_INVALID_TYPE The type of thevariable is invalid

193 EFEE4981 EOL_E_MISSING_NEUTRAL_FILE The neutral file ofdefinition of symbols ismissing

194 EFEE4982 EOL_E_MISSING_OPCerror_DLL The resource fileOPCerror.dll can’t beloaded

195 EFEE4983 EOL_E_MISSING_EOLESerr_DLL The resource fileEOLESerr.dll can’t beloaded

196 EFEE4984 EOL_E_RESOURCE_NOT_FOUND The resource DLL isn’tfound

197 EFEE4985 EOL_E_MSG_NOT_FOUND The message isn’tfound

198 EFEE4986 EOL_E_EXPECTED_ARRAY_VALUES An ARRAY of values isexpected

199 EFEE4987 EOL_E_EXPECTED_SINGLE_VALUE A SINGLE value isexpected and not anarray

200 EFEE4988 EOL_E_EXPECTED_DIM1 An array of values isexpected with onlyONE dimension

201 EFEE4989 EOL_E_UNEXPECTED_BOUNDS The limits of the tableare invalid

202 EFEE498A EOL_E_INVALID_ITEMS_NBR The number of itemsare incorrect

Page 143: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/33

EN

GLI

SH# HRESULT NAME COMMENT

203 EFEE498B EOL_E_INVALID_PATH The item’s driver orPLC address differswith regard to previousitems

204 EFEE498C EOL_E_ERR16bit_OUTofRANGE The 16-bit error code isout of range

205 EFEE498D EOL_E_ONLY_ONE_REQUEST Too much items : thisgroup must betranslated on ONLYONE PLC request

206 EFEE498E EOL_E_FEATURE_DISABLED This feature has beendisabled by theadministrator

207 EFEE498F EOL_E_GROUP_DELETED This group has beenLOGICALLY deleted

208 EFEE4990 EOL_E_INVALID_COMMAND Use 1 for UpLoad fromthe PLC or 2 forDownLoad to the PLC

209 EFE913EE EOL_E_ILLEGAL_CHARACTER Syntax error: illegalcharacter

210 EFE913EF EOL_E_INDEX_NUMBER_ERROR Syntax error: indexnumber error

211 EFE913F0 EOL_E_INVALID_SYNTAX Syntax error: incorrectsyntax

212 EFE913F1 EOL_E_LEXEM_TOO_LARGE Syntax error: name ofobject is too long

213 EFE913F2 EOL_E_INVALID_OBJECT Syntax error: incorrectobject

214 EFE913F3 EOL_E_KEYWORD_ERROR Syntax error: keyword

215 EFE913F4 EOL_E_SYNTAX_ERROR_2 Syntax error

216 EFE913F5 EOL_E_INVALID_END_OF_PHRASE Syntax error: incorrectend of phrase

217 EFE913F6 EOL_E_SYNTAX_ERROR Syntax error

218 EFE913F7 EOL_E_INCORRECT_SYMBOL Syntax error: incorrectsymbol

219 EFE913F8 EOL_E_INCORRECT_INDEX_SYMBOL Syntax error: incorrectindex symbol

220 EFE913F9 EOL_E_INCORRECT_BIT_INDEX_SYMBOL Syntax error: the indexsymbol of the extractedbit is incorrect

Page 144: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/34

___________________________________________________________________________

EN

GLI

SH # HRESULT NAME COMMENT

221 EFE913FA EOL_E_UNDEFINED_INDEX_SYMBOL Syntax error: the indexsymbol is not defined

222 EFE913FB EOL_E_INVALID_SYMBOL Syntax error: thesymbol is not defined

223 EFE913FC EOL_E_OBJECT_NOT_SYNTHESIZED Synthesis error: theobject cannot besynthesized

224 EFE913FD EOL_E_INVALID_ARRAY_SIZE Syntax error: incorrecttable length

225 EFE913FE EOL_E_INCORRECT_PATH_SIZE Syntax error: incorrectpath size.

226 EFE913FF EOL_E_OBJECT_FORMAT_TOO_LARGE Syntax error: objectformat too large

227 EFE91400 EOL_E_INCORRECT_OBJECT_FORMAT Syntax error: incorrectobject format

228 EFE91401 EOL_E_UNSIGNED_OBJECT_ERROR Syntax error: objecthas no sign

229 EFE91402 EOL_E_EMPTY_EXPRESSION Syntax error: blankexpression

230 EFE91403 EOL_E_ILLEGAL_INDEXES Syntax error: indexesare illegal

231 EFE91404 EOL_E_ILLEGAL_ARRAYS Syntax error: Tablesare illegal.

232 EFE91405 EOL_E_NO_SEPARATOR Syntax error: noseparator in front of theobject

233 EFED4845 EOL_E_CODE4INIT_ERROR CodeBase failureduring CODE4INITfunction

234 EFED4846 EOL_E_D4APPENDSTART_ERROR CodeBase failureduringD4APPENDSTARTfunction

235 EFED4847 EOL_E_D4CREATE_ERROR CodeBase failureduring D4CREATEfunction

236 EFED4848 EOL_E_I4CREATE_ERROR CodeBase failureduring I4CREATEfunction

237 EFED4849 EOL_E_D4FIELD_ERROR CodeBase failureduring D4FIELDfunction

Page 145: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/35

EN

GLI

SH# HRESULT NAME COMMENT

238 EFED484A EOL_E_D4TAG_ERROR CodeBase failureduring D4TAG function

239 EFED484C EOL_E_D4APPEND_ERROR CodeBase failureduring D4APPENDfunction

240 EFED484D EOL_E_RELATE4INIT_ERROR CodeBase failureduring RELATE4INITfunction

241 EFED484E EOL_E_RELATE4QUERYSET_ERROR CodeBase failureduring

RELATE4QUERY_SET function

242 EFED484F EOL_E_RELATE4TOP_ERROR CodeBase failureduring RELATE4_TOPfunction

243 EFED4850 EOL_E_RELATE4SKIP_ERROR CodeBase failureduring RELATE4_SKIPfunction

244 EFED4851 EOL_E_INVALID_SYMBOLS_FILE Content of symbols fileis not valid

245 EFED4852 EOL_E_OPEN_SYMBOLS_FAILURE Failure during openingof symbols file : invalidname or path, file notfound, ...

246 EFED4853 EOL_E_ERRORS_IN_SYMBOLS_FILE Errors in symbols file :syntax error in a line,double definition ofsame address orsymbol

247 EFED4854 EOL_E_NO_OBJECT_FOR_SYMBOL No object found

248 EFED4855 EOL_E_INPUT_BUFFER_TOO_LARGE Input buffer is too large

249 EFED4856 EOL_E_OUTPUT_BUFFER_TOO_SMALL Output buffer is toosmall

250 EFE84DBD EOL_E_REQUESTS_OPTIMIZATION_ERROR1 Internal error inrequests optimization :object addressingmode is not on 2 bytes

251 EFE84DBE EOL_E_REQUESTS_OPTIMIZATION_ERROR2 Internal error inrequests optimization :object addressingmode is not on 5 bytes

Page 146: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/36

___________________________________________________________________________

EN

GLI

SH # HRESULT NAME COMMENT

252 EFE84DBF EOL_E_REQUESTS_OPTIMIZATION_ERROR3 Internal error inrequests optimization :invalid objectaddressing mode

253 EFE84DC0 EOL_E_REQUESTS_OPTIMIZATION_ERROR4 Internal error inrequests optimization :invalid ROL object

254 EFE84DC1 EOL_E_REQUESTS_OPTIMIZATION_ERROR5 Internal error inrequests optimization :invalid Element object

255 EFE84DC2 EOL_E_REQUESTS_OPTIMIZATION_ERROR6 Internal error inrequests optimization :invalid Info object

256 EFE84DC3 EOL_E_REQUESTS_OPTIMIZATION_ERROR7 Internal error inrequests optimization :ROL object numbergreater than number ofexisting objects

257 EFE84DC4 EOL_E_REQUESTS_OPTIMIZATION_ERROR8 Internal error inrequests optimization :Element object numbergreater than number ofexisting objects

258 EFE84DC5 EOL_E_REQUESTS_OPTIMIZATION_ERROR9 Internal error inrequests optimization :Info object numbergreater than number ofexisting objects

259 EFE84DC6 EOL_E_REQUESTS_OPTIMIZATION_ERROR10 Internal error inrequests optimization :unprocessed option

260 EFE84DC7 EOL_E_REQUESTS_OPTIMIZATION_ERROR11 Internal error inrequests optimization :options implemented ina future version

261 EFE84DC8 EOL_E_REQUESTS_OPTIMIZATION_ERROR12 Internal error inrequests optimization :object not supplied inthis version

262 EFE84DC9 EOL_E_REQUESTS_OPTIMIZATION_ERROR13 Internal error inrequests optimization :invalid access type

Page 147: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

Appendix 9

___________________________________________________________________________

9/37

EN

GLI

SH# HRESULT NAME COMMENT

263 EFE84DCA EOL_E_REQUESTS_OPTIMIZATION_ERROR14 Internal error inrequests optimization :invalid parameters

264 EFE84DCB EOL_E_REQUESTS_OPTIMIZATION_ERROR15 Internal error inrequests optimization :request data sizegreater than buffer size

265 EFE84DCC EOL_E_OUT_OF_BITSARRAY_BOUNDARY The array of bits has asize exceeding theallowed boundary

266 EFE84DCD EOL_E_BAD_IO_TYPE Internal error inrequests optimization :Bad IO Type

267 EFE84DCE EOL_E_BAD_ADDR_LENGTH Internal error inrequests optimization :IO Adress length is notsupplied

268 EFE84DCF EOL_E_READ_ARRAY_FORBIDDEN Reading this kind ofarray is not allowed

269 EFE84DD0 EOL_E_MBI_NOT_ARRAY This kind of objectmust be call with aarray form

Page 148: User's Manual - guilleviniag.com server.pdf · OFS (OPC Factory Server) ... for the OFS, in particular for OLE Automation, OLE Custom programming and exception management : • Microsoft

9/38

___________________________________________________________________________

EN

GLI

SH