What’s New in QuickOPC-Classic 5.20

From QuickOPC Knowledge Base
Jump to: navigation, search

Previous: What’s New in QuickOPC-Classic 5.12

Key changes:

  • OPC Live Mapping and Binding
  • New Browsing Dialogs


Note: Most changes in this version affect QuickOPC.NET only.

Development Tools Integration

  • The components are now automatically installed into Visual Studio Toolbox:
5.20-toolbox.png
  • API members are now annotated using ReSharper (http://www.jetbrains.com/resharper/) attributes, such as the most common [CanBeNull] and [NotNull] attributes. ReSharper users benefit from the annotations, as possible improper usages are recognized and highlighted by ReSharper’s code inspection feature.
  • The API now uses Microsoft Code Contracts (http://msdn.microsoft.com/en-us/devlabs/dd491992.aspx, http://research.microsoft.com/en-us/projects/contracts/) to express coding assumptions. This results in higher consistency in error checking, and the contracts are also explicitly visible in the reference documentation, showing the developer clearly what are the expectations about method inputs and outputs, etc. Developers who want to gain further benefit can enable Code Contracts in their projects, and use the QuickOPC contract assemblies supplied with the product for achieving better code quality.

Packaging

  • There are new assemblies, and some existing assembly names have changed.
  • The assemblies are now installed into the GAC (Global Assembly Cache) by the setup program. You do not have to install assemblies into the GAC on the runtime computers, though.

Licensing

  • The licenses now contain information about software version numbers covered, and a software release date covered. This means that licenses issued can already take into account the maintenance terms and period, and do not have to be-issued for software covered by the maintenance.

Development Models

  • Added a new development model: Live Binding.

With Live Binding, no manual coding is necessary to obtain OPC connectivity. You simply use the Visual Studio Designer to configure bindings between properties of visual or non-visual components, and OPC data. All functionality for OPC reads, writes, subscriptions etc. is provided by the QuickOPC components. The live binding model is allowed by the new BindingExtender and DABinder components that you drag from the toolbox to the designer surface. You can then use extender commands in the Properties window, or on the context menu of each component (control), to bind the component’s properties to OPC data:

5.20-commands.png

After selecting the “Bind to OPC Item” command, you select the OPC data you want to bind to, and you are done. The currently configured bindings appear as additional entries in the Properties window:

5.20-properties.png

You can also invoke the full-featured binding editor, and configure all aspects on bindings – either on individual component (control), or for a whole container (form) at once:

5.20-bindingcollectioneditor.png

The Live Binding model is currently available for Windows Forms (or UI-less) containers only.

  • Added a new development model: Live Mapping.

The Live Mapping model allows you to write objects that correspond logically to a functionality provided by whatever is “behind” the OPC data. For example, if part of your application works with a boiler, it is natural for you to create a boiler object in the code. You then describe how your objects and their members correspond to OPC data – this is done using attributes to annotate your objects. Using Live Mapping methods, you then map your objects to OPC data, and perform OPC operations on them. For example, when you subscribe to OPC items, incoming OPC item changes can directly set corresponding properties in your objects, without any further coding. You can then focus on writing the code that handles these property changes, abstracting away the fact how they come in. To give an example, here is a piece of code of a .NET object annotated for live mapping with OPC Data Access, in C#:

    [DAType]
    class BoilerInputPipe
    {
        [DANode]
        public FlowTransmitter FlowTransmitter1 = new FlowTransmitter();

        [DANode]
        public Valve Valve = new Valve();
        
        [DANode, DAItem]
        public bool InAlarm { get; set; };
    }
 
  • Added a new development model: Reactive Programming.

This development model merges the world of Microsoft Reactive Extensions (Rx) for .NET with OPC. The Reactive Extensions (http://msdn.microsoft.com/en-us/data/gg577609.aspx) is a library to compose asynchronous and event-based programs using observable collections (data streams) and LINQ-style query operators.

  • The new development models, along with the original and traditional Procedural Coding Model, can be freely mixed in the same project.

Components

  • Both QuickOPC-COM and QuickOPC.NET: Reduced latency of OPC reads and writes.
  • Added support for .NET generics. This allows achieving type safety with OPC data values which are of variant type. There are now new generic types that accept type parameters determining the type of the value; for example, the developer can use DAVtq<int> for OPC data that carry integer values. There are also new generic methods that accept or return the generics.

The developers are encouraged to use generics, but the existing types remain unchanged and can be used as before.

  • There are new namespaces, and some existing types (mainly the Windows Forms dialogs) have been moved to different namespaces. The new namespace structure consistently distinguishes between different OPC specifications, and whether the type is specific to a technology (such as Windows Forms).
  • New browsing dialogs. Existing dialogs for browsing OPC Data Access servers, items and properties have been greatly improved visually and in functionality. Completely new dialogs have been added, covering all necessary OPC Alarms&Events browsing. A “universal” dialog that can be configured to browse just about anything related to OPC is also provided.

In total, 10 different dialogs are available; click here for details. Below is an example of one of the dialogs:

5.20-browseforopcdaitem.png
  • The existing OPC browsing dialogs have been replaced by new ones, meaning that their names and namespaces have changed.
  • Added support for specifying OPC items (or any nodes in address space) using browse paths (a series of “short” item names), instead of item IDs, for all operations (not only for browsing, as in Version 5.12). The DAItemDescriptor now inherits from DANodeDescriptor and therefore contains a BrowsePath property that can be used for this purpose. Also, many methods that accepted just node ID have been changed to accept DANodeDescriptor, allowing you to choose between node ID or a browse path.
  • ChangeMultipleSubscriptions and UnsubscribeMultipleItems methods now return “void”, as they always succeed unless there is a coding error.
  • UnsubscribeMultipleItems method can be passed IEnumerable<int> in place of an array of handles.
  • DataSource and ValueAge have moved from DAClientMode to a new object, DAReadParameters. There are now overloads of the ReadXXXX methods that accept a valueAge argument, or a argument of type DAReadParameters. This means that you can now easily specify the data source (cache or device), or desired value age, with each call.
  • The DAGroupParameters object now has a FromInt32 static method, and a corresponding implicit conversion operator, that allow it be constructed from an integer that represents the requested update rate (in milliseconds). This means that in C# and many other languages, you can simply use an integer update rate at all places where DAGroupParameters object is expected, if you are fine with specifying just the update rate and keeping the other properties of DAGroupParameters at their defaults.
  • In browsing, it is easier to distinguish or select the proper type of server, with the new ServerFamilies enumeration, and the Families property on the ServerCategories object. As opposed to server category, the server family corresponds to e.g. OPC Data Access in general, without distinguishing the individual specification versions, such as OPC-DA 1.0, 2.0 or 3.0.
  • New DAPropertyId.GetName and GetPropertyType methods can be used to obtain the string identifier of the property, or its type.
  • Added the most generic OPC Alarms&Events address space browsing method, BrowseNodes. It combines the functionality of BrowseAreas and BrowseSources, and it also allows the widest range of filtering options by passing in an argument of type AENodeFilter.
  • Added new method, EasyAEClient.QueryCategoryConditions, for finding out event conditions supported by given event category. Added new method, EasyAEClient.QueryCategoryAttributes, for finding out event attributes that the server can provide as part of an event notification within a given event category.
  • New extension methods on EasyAEClient for OPC Alarms&Events: FindEventCategory and FindEventCondition return information about the given category given its ID, or about the given condition given its name.
  • The VarTypeUtilities static class provides a FromType method that allows you to determine the COM-based type VarType (used in OPC operations) that corresponds to a given .NET Type.
  • The DAUtilities static class provides methods that allow you to determine whether a given data type (VarType), percent deadband, update rate or value age are valid values in OPC Data Access.
  • The AEUtilities static class provides methods that allow you to determine whether given data type (VarType), event severity, event type filter, or notification rate are valid values in OPC Alarms&Events.

Examples

  • Added LiveBindingDemo example: Shows live binding of OPC Data Access information (from simulation OPC server) to standard Windows Forms controls (Microsoft). All binding to OPC data is achieved with no manual coding, only by configuring the components in Visual Studio.
5.20-livebindingdemo.png
  • Added IndustrialGadgetsDemo example: Shows live binding of OPC Data Access items (from simulation OPC server) to controls from Industrial Gadgets .NET (a separate product, http://www.industrialgadgets.net/). The application has been developed with no manual coding - all functionality is achieved by configuring the components in Visual Studio.
5.20-demowithindustrialgadgetsnet.png
  • Added InstrumentationControlsDemo example: Shows live binding of OPC Data Access items (from simulation OPC server) to controls from Instrumentation .NET (a separate product, http://www.instrumentationopc.com/). The binding is done with no manual coding - all functionality is achieved by configuring the components in Visual Studio.
5.20-demowithinstrumentationcontrols.png
  • Added SymbolFactoryDemo example: Shows live binding of OPC Data Access items (from simulation OPC server) to controls from Symbol Factory .NET (a separate product, http://www.symbolfactory.net/). All controls are bound to a single source item. The application has been developed with no manual coding - all functionality is achieved by configuring the components in Visual Studio.
5.20-demowithsymbolfactorynet.png
  • Added ConsoleLiveMapping example: Creates an object structure for a boiler, describes its mapping into OPC OPC Data Access server using attributes, and then performs the live mapping. Boiler data is then read, written and/or subscribed to using plain .NET object access.
  • Added WebService1 example: A simple Web service using ASMX technology. Provides "Hello World" method to read a value of an OPC item.
  • Added WcfService1 example: A simple Web service using WCF technology. Provides a GetData method to read a value of an OPC item. Use WcfClient1 project (under Console folder) to test this Web service.
  • Added WcfClient1 example: Using a Web service provided by the WcfService1 project (under Web folder), gets and displays a value of an OPC item.
  • Added SimpleLogToSql example: Logs OPC Data Access item changes into an SQL database, using a subscription.
  • Added LogAsStringToSql example: Logs OPC Data Access item changes into an SQL database, using a subscription. Values of all data types are stored in a single NVARCHAR column.
  • Added LogAsUnionToSql example: Logs OPC Data Access item changes into an SQL database, using a subscription. Values of all data types are stored in separate columns.
  • Added LogToSqlEnhanced example: Logs OPC Data Access item changes into an SQL database, using a subscription. Item values and qualities are stored in their respective columns. Notifications with the same timestamp are merged into a single row.
  • Added WindowsService1 example: A Windows Service that subscribes to items from the simulation server, and logs their changes into a file.
  • Added OvenControl example: Monitors sensors in an industrial oven, indicates level alarms by changing colors, allows the user to change a setpoint, and logs the values into a CSV file.
  • Added DataGridWebApplication example: Demonstrates how easily can WebControls.GridView be populated with data read from OPC Data Access server.
  • Added VoleReadItemValue example: Show how to read OPC item value using only C++ language features and libraries that are portable across compilers. Makes use of STLSoft and VOLE libraries.
  • Added examples in T-SQL (for Microsoft SQL Server). ReadAndDisplayValue.sql reads and displays an OPC item value, using QuickOPC-COM.
  • Added ReadCurrentDataCom example: Shows how to use QuickOPC-COM from managed code inside SQL Server (SQLCLR). Reads data of multiple OPC items and returns them in a recordset. The recordset can then be inserted into a log table in the SQL database.

OPC Interoperability

  • Improved browsing interoperability with RSLinx OPC Server.

Details

Browsing Dialogs

  • OpcServerDialog: A dialog box from which the user can select an OPC "Classic" server.
5.20-opcserverdialog.png
  • OpcComputerAndServerDialog: A dialog box from which the user can select a computer and an OPC server residing on it.
5.20-opccomputerandserverdialog.png
  • OpcBrowseDialog: A dialog with various OPC nodes from which the user can select. This dialog can be configured to serve many different purposes.
5.20-opcbrowsedialog.png
  • DAItemDialog: a dialog box from which the user can select an OPC Data Access item.
5.20-daitemdialog.png
  • DAPropertyDialog: A dialog box from which the user can select an OPC Data Access property.
5.20-dapropertydialog.png
  • AEAreaOrSourceDialog: A dialog box from which the user can select OPC-A&E event areas or sources.
5.20-aeareaorsourcedialog.png
  • AECategoryDialog: A dialog box from which the user can select from OPC-A&E event categories provided by the OPC server.
5.20-aecategorydialog.png
  • AECategoryConditionDialog: A dialog box from which the user can select OPC-A&E category available on a specified event condition.
5.20-aecategoryconditiondialog.png
  • AEAttributeDialog: a dialog box from which the user can select OPC-A&E event attributes.
5.20-aeattributedialog.png