230 likes | 599 Views
QuickOPC 5.02. Ing. Zbyne k Zahradn i k OPC Labs. Overview. OPC (Data Access) – what is it EasyOPC -DA: developer tool that provides access to OPC dat a Basic design principles S tateless model S ervice-oriented Support for widest selection of languages and programming tools:
E N D
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 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)
Features • 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)
Compatible 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.)
Integration 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#):
Demo of usage in the app • „Demo“ from the installation
Background processing done by EasyOPC • 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 serversand 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).
Applications • Operator interfaces (HMI) to systems based on OPC • Specialized applicationsusing OPC data (computational, monitoring, database, loggingetc.) • Making OPC dataaccessible to tools that would otherwise be difficult or impossible • OPCDAAuto replacement • Recipes and batch processes • Testing of OPC Servers and devices • OEM products • other
Specifications • 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)
Licensing • 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
Installation • Single file, can be placed on Web • needs certain Prerequisites • Installing will put on your computer: • EasyOPC-DAcomponents • Simulation OPC Server • OPC Core Components • Documentation • and more • Bonus Pack: • Free tools • Examples in various tools and languages
OPC Item Generator • This tool generates code parts for the developer
Availability • 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 .BINfile
Object 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
OPC User Objects Set o = CreateObject("OPCLabs.UserBrowseServer") o.MachineName = "" o.RunMe WScript.Echo o.ServerClass
Configurable Parameters • Some are in instance properties • Some are in static properties (.NET) or configurable through the tool (COM):
Troubleshooting • 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 andfilepermissions • Slowness: improper settings or use of timeouts
DCOM and IIS 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
Version5.10 and later • OPC Alarms and Events (A&E) support • Native OPC Universal Architecture Client • usability improvements • advanced functions • return of the Web (?)
Additional information • Documentation in the product and on the Web • www.opclabs.com, www.quickopc.com • Online Forums • www.opcwebclient.com, www.opcdata.net
Conclusion • Questions • Discussion Thank you!