QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA:...

23
QuickOPC 5.02 QuickOPC 5.02 Ing. Zbyne Ing. Zbyne k Zahradn k Zahradn i i k k OPC Labs OPC Labs

Transcript of QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA:...

Page 1: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

QuickOPC 5.02QuickOPC 5.02

Ing. ZbyneIng. Zbynek Zahradnk Zahradniikk

OPC LabsOPC Labs

Page 2: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

OverviewOverview• OPC (Data Access) – what is it• EasyOPC-DA: developer tool that provides access

to OPC data• Basic design principles

– Stateless model– Service-oriented– Support for widest selection of languages and

programming tools:• COM: especially scripting tools (OLE automation),• .NET – any language

– Easiness of use (short code)– Universally applicable (as much platforms as possible)

Page 3: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

FeaturesFeatures• Set of .NET classes, or “automation” COM objects with several

methods and properties• Simplifies the OPC interface to the maximum• Automatically connects to OPC servers, and disconnects from them• Detects servers and connections that are not functional, and

performs restarts and restorations to the original state• Automatically adds and removes OPC groups and items• Merges and optimizes requests from calling applications• Works as data cache• Automatically determines and changes the update rate of OPC

items• Converts data types to a subset that is known to be supported in all

tools (for .NET, those prescribed by CLS; for COM, VBScript being usually the most limiting)

Page 4: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

Compatible tools and languagesCompatible tools and languages

• .NET:– C#– Visual Basic.NET (VB.NET)– J#, F# etc.– different hosts (Console, WinForms, WPF, ASP.NET, etc.)

• COM:– VBScript (WSH, ASP, IE)– JScript (WSH, ASP, IE)– PHP (!)– Visual Basic 6.0– VBA (Word, Excel, PowerPoint etc., and applications from other vendors)– Visual FoxPro– C++ (in VS 6.0 or VS.NET 2003/2005/2008/2010)– Python– Delphi– LabVIEW– Many others (Xeneo Web Server etc.)

Page 5: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

Integration with custom applicationIntegration with custom application

// Create EasyOPC-DA componentvar EasyDAClient = new OpcLabs.EasyOpc.DataAccess.EasyDAClient();

// Read item value and display it in a message box MessageBox.Show(EasyDAClient.ReadItemValue("", "OPCLabs.KitServer.2", "Demo.Single").ToString());

Example of very simple coding (C#):

Page 6: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

Demo of usage in the appDemo of usage in the app

• „Demo“ from the installation

Page 7: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

Background processing done by Background processing done by EasyOPCEasyOPC

• Keeps track of (remote) comp[uters in use and connects to OPCEnum component on them. Automatically restores these connections in case of problems.

• Keeps track of OPC servers in use, and maintains only one optimized connection to every server. Periodically checks status of OPC server and its connection, and automatically restores the connection in case of problems. Recreates the original state in the restored connection, so that ot contaisn the same groups and items as before the problem.

• Satisfies the client app requests with data from cache, or creates new OPC groups and adds items as needed..

• Optimizes adding new and removing old OPC items so that if possible, multiple items are being added (or removed) in one call.

• Queues incoming values (callbacks) from connected OPC servers and processes them asynchronously.

• Monitors usage of individual OPC items and modified its „update rate“ as needed. This requires creating new OPC groups or removing OPC groups that are no longer in use. Tato činnost vyžaduje též vytváření nových grup a rušení nepoužitých grup. „Update rate“ values that are close are put into common “buckets” in order to reduce the number of groups necessary.

• Removes OPC items athat are not used for extended periods of time.• Disconnects from OPC servers that are not used for extended periods of time.• If the number of OPC servers or OPC items exceeds the pre-set capacity limits, removes or

disconnects those that were not used for longest time period (LRU algorithm).

Page 8: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

ApplicationsApplications

• Operator interfaces (HMI) to systems based on OPC• Specialized applications using OPC data (computational,

monitoring, database, logging etc.)• Making OPC data accessible to tools that would

otherwise be difficult or impossible• OPCDAAuto replacement• Recipes and batch processes• Testing of OPC Servers and devices• OEM products• other

Page 9: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

SpecifiSpecificationscations

• Will connect to all OPC Data Access (Custom Interface) 1.0x, 2.0x and 3.0x servers

• Connects to OPC UA (Universal Architecture) servers through UA Proxy (included)

Page 10: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

LicenLicensingsing

• Trial License– Provides valid data for 30 minutes– OPC Labs can generate special trial license upon request

• Commercial Licenses (.bin file for License Manager)– meant for System Integrators (SI)– per machine, or royalty free– see price list

• Special Licenses:– ISV, OEM, VAR licenses

Page 11: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

InstalInstallationlation• Single file, can be placed on Web

– needs certain Prerequisites

• Installing will put on your computer:– EasyOPC-DA components– Simulation OPC Server– OPC Core Components– Documentation– and more

• Bonus Pack:– Free tools– Examples in various tools and languages

Page 12: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

OPC Item GeneratorOPC Item Generator• This tool generates code parts for the developer

Page 13: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

AvailabilityAvailability

• Trial version: On the Web for download

• The licensed version is the same software, in addition the license must be installed on the computer running the component– Licenses generated individually by OPC Labs

or by vendor– Delivered in form of .BIN file

Page 14: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

PROGRAMMINGPROGRAMMING

Page 15: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

ObjeObjectct model model

• The main object is EasyDAClient– Methods such as:

• ReadItem (MachineName, ServerClass, ItemID [, AccessPath [, DataType]]) • ReadItemValue (MachineName, ServerClass, ItemID [, AccessPath [, DataType]]) • WriteItemValue (MachineName, ServerClass, ItemID [, AccessPath], Value) • GetPropertyValue (…)• SubscribeItem (…)• methods with “Invoke”: work asynchronously, be notified upon completion• methods with “Multiple”: work effectively with large amount of items• Browsing methods (for servers, branches or leaves)

– Properties:• ClientMode (preferred access methods etc.)• HoldPeriods• UpdateRates• Timeouts

• Helper objects: – VTQ (Value, Timestamp, Quality)– Descriptors, elements etc. – see documentation

Page 16: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

OPC User ObjectsOPC User ObjectsSet o = CreateObject("OPCLabs.UserBrowseServer")

o.MachineName = ""

o.RunMe

WScript.Echo o.ServerClass

Page 17: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

Configurable ParametersConfigurable Parameters• Some are in instance properties• Some are in static properties (.NET) or configurable through the tool

(COM):

Page 18: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

TroubleshootingTroubleshooting

• Error messages: find out as much as possible – not only error number, but also its text and additional information (e.g. Err.Source, Err.Description in VBScript)

• Many errors may come directly from the OPC Server

• Invoking problems, „Access denied“ and similar –DCOM configuration, IIS configuration, user and file permissions

• Slowness: improper settings or use of timeouts

Page 19: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

DCOM aDCOM andnd IIS IIS issues issues

• Be careful about user accounts under which the client application, EasyOPC and OPC Server run, sometimes even other components (e.g. OPCEnum)

• Depending on IIS settings, EasyOPC may be called under specific authenticated user, or under the account configured for anonymous access

Page 20: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

FUTUREFUTURE

Page 21: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

VerVersionsion 55..110 a0 and laternd later

• OPC Alarms and Events (A&E) support• Native OPC Universal Architecture Client• usability improvements• advanced functions• return of the Web (?)

Page 22: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

Additional informationAdditional information

• Documentation in the product and on the Web

• www.opclabs.com, www.quickopc.com – Online Forums

• www.opcwebclient.com, www.opcdata.net

Page 23: QuickOPC 5.02 Ing. Zbynek Zahradnik OPC Labs. Overview OPC (Data Access) – what is it EasyOPC-DA: developer tool that provides access to OPC data Basic.

ConclusionConclusion

• Questions

• Discussion

Thank you!