User`s guide
Universal Library User's Guide Universal Library for .NET Description & Use
25
Parameter data types
Many of the Universal Library for .NET methods are overloaded to provide for signed or unsigned data types
as parameters. The AConvertData() method is shown below using both signed and unsigned data types.
VB.NET
Public Function AConvertData(ByVal numPoints As Integer, ByRef adData As
Short, ByRef chanTags As Short) As MccDaq.ErrorInfo
Member of MccDaq.MccBoard
Public Function AConvertData(ByVal numPoints As Integer, ByRef adData As
System.UInt16, ByRef chanTags As System.UInt16) As MccDaq.ErrorInfo
Member of MccDaq.MccBoard
C# .NET
public MccDaq.ErrorInfo AConvertData (System.Int32 numPoints, System.Int16
adData, System.Int16 chanTags)
Member of MccDaq.MccBoard
public MccDaq.ErrorInfo AConvertData (System.Int32 numPoints, System.UInt16
adData, System.UInt16 chanTags)
Member of MccDaq.MccBoard
For most data acquisition applications, unsigned data values are easier to manage. However, since Visual
Basic (version 6 and earlier) does not support unsigned data types, it may be easier to port these programs to
.NET if the signed data types are used for the method parameters. For additional information on using signed
data types, refer to the section ―16-bit values using a signed integer data type‖ on page 16.
The short (Int16) data type is Common Language Specification (CLS) compliant, is supported in VB, and will
be included in any future .NET language developed for the .NET framework. Using CLS-compliant data types
ensures future compatibility. Unsigned data types are not CLS compliant, but are still supported by various
.NET languages, such as C#.
Differences between the UL and UL for .NET
Table 2 lists the differences between the Universal Library and the Universal Library for .NET.
Table 2. Differences between UL and UL for .NET
Universal Library
Universal Library for .NET
Board Number
The board number is included as a
parameter to the board functions.
An MccBoard class is created for each board installed,
and the board number is passed to that board class.
Functions
Set of function calls defined in a header.
Set of methods. Methods of MccBoard or MccService
classes. To access a method, instantiate a UL for .NET
class and call the appropriate method using that class.
Constants
Constants are defined and assigned a
value in the "header" file.
Constants are defined as enumerated types.
Return value
The return value is an Error code.
The return value is an ErrorInfo object that contains the
error's number and message.
Board number
In a .NET application, multiple boards may be programmed by creating an MccBoard Class object for each
board installed:
Board0 = new MccBoard(0)
Board1 = new MccBoard(1)
Board2 = new MccBoard(2)
Note that the board number may be passed into the MccBoard class, which eliminates the need to include the
board number as a parameter to the board methods.