Managing IVI-C Driver Functionality
When an IVI-C driver is linked to an IVI.NET driver via the IVI-C Page of the Driver Settings Editor, Nimbus creates a complete IVI-C driver that is based on the functionality defined in the IVI.NET driver. This topic introduces important concepts in understanding how the IVI-C driver functionality is defined and managed.
This topic only applies to IVI.NET driver projects that have a linked IVI-C driver on the IVI-C Page of the Driver Settings Editor.
The first important thing to understand about IVI-C drivers linked to IVI.NET is that they are structurally identical to standalone IVI-C drivers (those created by choosing IVI-C Driver directly from the New Project Wizard). Unlike the IVI-C wrappers built upon IVI-COM drivers, the driver code for the IVI.NET driver and a linked IVI-C driver are completely separate -- housed in separate DLLs. The IVI-C driver is composed of purely native C++ code, while the IVI.NET driver is (typically) composed of purely managed C# code. There are no inherent compile-time, runtime, or versioning dependencies between an IVI.NET driver and a linked IVI-C driver. Additionally, each driver maintains its own help and setup project.
A linked IVI-C driver may be added to an IVI.NET driver at any stage during the IVI.NET driver development process. Nimbus will create the IVI-C driver C++ project and optionally create the IVI-C unit test, help, and setup projects. The IVI-C driver will include as many of the IVI.NET driver methods and properties as could be translated to IVI-C. The topic Linking IVI.NET and IVI-C Methods and Properties discusses how Nimbus creates and manages associations between IVI.NET methods and properties and their IVI-C function and attribute counterparts.
Although a new linked IVI-C driver can be added to an IVI.NET driver solution at any stage during development, an existing IVI-C driver cannot be linked to an IVI.NET driver solution. Linked IVI-C drivers must always be created based upon an IVI.NET driver -- either at IVI.NET project creation time with the New Project Wizard runs or later via the IVI-C Page of the Driver Settings Editor. However a standalone IVI-C driver cannot be linked to an existing IVI.NET driver. This hold true even if the IVI-C driver was initially created with the IVI.NET driver and later unlinked from it (via the IVI.NET Driver Settings Editor). Unlinking an IVI-C driver from an IVI.NET driver makes that IVI-C driver a standalone IVI-C driver, just as if it had never been linked to IVI.NET at all.
IVI-C drivers linked to IVI.NET must always be created from the IVI.NET driver project -- either when the IVI.NET New Project Wizard runs or when the driver developer explicitly enables it via the IVI-C Page of the Driver Settings Editor. Existing IVI-C drivers cannot be linked to IVI.NET.
The Nimbus user interface allows you to view the IVI.NET and IVI-C hierarchies in a single Driver Designer. window. Both designers are accessed by double-clicking the Driver Designer node under the Nimbus project node in Solution Explorer. The Driver Designer that appears as a tabbed document window displays separate tabs for the IVI.NET Designer and the IVI-C Designer.
The terminology used to describe IVI-C driver functionality is slightly different than that used to describe IVI.NET functionality. A method in IVI.NET is referred to as a function when speaking in the context of IVI-C. Similarly, a property in IVI.NET corresponds to an attribute in IVI-C. This terminology is used throughout the IVI specifications and is followed in this documentation as much as possible.
The IVI.NET Designer is referred to as the master view because it "pushes" changes made in it to the IVI-C hierarchy. For instance, when a method is added to the IVI.NET driver, a corresponding IVI-C function is also added to the driver project. Nimbus maintains the association between the IVI.NET method and the IVI-C function so that it can keep the function names, parameter names, and parameter types synchronized between the two. Additionally, Nimbus can often automatically generate and maintain the appropriate code to implement both the IVI-C function using design data entered in the IVI.NET designer.
When Nimbus automatically creates IVI-C items, such as IVI-C functions, attributes, and parameters, based on changes made in the IVI.NET Designer, various "transforms" may be required, such as translating IVI.NET data types like long and double to IVI-C data types like ViInt32 and ViReal64. The topic Linking IVI.NET and IVI-C Methods and Properties provides details on these automatic transforms.
It is critical to understand the difference in behavior when working from the IVI-COM Designer versus the IVI-C Designer. Since the IVI.NET Designer is the master view, changes made there typically affect both the IVI.NET and IVI-C hierarchies. By contrast, editing the IVI-C driver via the IVI-C Designer only affects the IVI-C hierarchy.
The IVI-C Designer does not push changes to the IVI.NET hierarchy.
As an example, using the IVI-C Designer, renaming an IVI-C function from Configure to ConfigureTrigger will only rename the IVI-C function. The IVI.NET method will still be named Configure and the IVI.NET method and IVI-C function will still be linked with one another. Similarly, adding a function using the IVI-C Designer only adds the function to the IVI-C hierarchy -- a corresponding method is NOT added to the IVI.NET hierarchy. In fact, this is how IVI-C-only functions are created. IVI-C-only functions are discussed below.
Nimbus offers two convenient ways to navigate between items in the IVI.NET hierarchy and their linked items in the IVI-C hierarchy:
From the tree view, right-click the desired item, such as an IVI.NET method, and choose Go to IVI-C .... The IVI-C Designer is immediately opened and linked item is selected. Correspondingly, a Go to IVI.NET... context menu command is available when working in the IVI-C Designer.
The Info Panel shows the linked IVI.NET or IVI-C item name as a hyperlink. Clicking it navigates to the linked item in the alternate view.
As discussed above, IVI.NET methods are initially created with an linked IVI-C function. Changes made to the IVI.NET method in the IVI.NET Designer, such as adding parameters, are "pushed" to the IVI-C function so that the two items stay in sync. Most of the time, this is the desired behavior. However, there are some instances where it is not possible or desirable to expose an IVI.NET method in the IVI-C driver. Such an IVI.NET method has no linked IVI-C function and is termed an IVI.NET-only method. Correspondingly, there are occaisions where an IVI-C function serves no useful purpose in the IVI.NET hierarchy. This requires IVI-C functions that have no IVI.NET counterpart -- these are termed IVI-C-only functions.
Nimbus fully supports the ability to create IVI.NET-only methods and IVI-C-only functions. In addition, other items, such as properties, function parameters, and enums can all be exposed in one of the hierarchies and not exposed in the others. The topic Linking IVI.NET and IVI-C Methods and Properties discusses how IVI.NET-only and IVI-C-only items are created and managed.
Download a complete CHM version of this documentation here.