User`s manual

CYDAS UDR Library User’s Guide CYDAS UDR Library for .NET Description & Use
20
Parameter data types
Many of the CYDAS UDR 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.
Public Function AConvertData(ByVal numPoints As Integer, ByRef adData As
Short, ByRef chanTags As Short) As MccDaq.ErrorInfo
Member of MccDaq.MccBoard
VB.NET
Public Function AConvertData(ByVal numPoints As Integer, ByRef adData As
System.UInt16, ByRef chanTags As System.UInt16) As MccDaq.ErrorInfo
Member of MccDaq.MccBoard
public MccDaq.ErrorInfo AConvertData (System.Int32 numPoints, System.Int16
adData, System.Int16 chanTags)
Member of MccDaq.MccBoard
C#
.NET
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 7.
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 UDR Library and UDR Library for .NET
Table 5-2 lists the differences between the CYDAS UDR Library and the CYDAS UDR Library for .NET.
Table 5-2. Differences between UDR Library and UDR Library for .NET
CYDAS UDR Library CYDAS UDR 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 UDR Library 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.