User`s manual

CYDAS UDR Library User’s Guide CYDAS UDR Library for .NET Description & Use
21
MCC classes
To use board-specific CYDAS UDR Library functions inside a .NET application, you use methods of the
appropriate class. UDR Library for .NET classes are listed in Table 5-3.
Table 5-3. UDR Library for .NET Board Classes
UDR Library for .NET Class Description
MccBoard Access board-related CYDAS UDR Library functions.
ErrorInfo Utility class for storing and reporting error codes and messages.
BoardConfig Gets and sets board configuration settings.
CtrConfig Gets and sets counter board configuration settings.
DioConfig Gets and sets digital I/O configuration settings.
ExpansionConfig Gets and sets expansion board configuration settings.
GlobalConfig Gets and sets global configuration settings.
MccService Access utility CYDAS UDR Library functions.
Refer to the CYDAS UDR Library Function Reference (available on our website, on this software CD, and
C:\MCC\Documents (by default) after software is installed.) for additional class information.
Methods
Methods are accessed through the class containing them. The following example demonstrates how to call the
AIn() method from within a 32-bit Windows application and also from a .NET application.
VB Application using CBW32.DLL VB .NET Application using MCCDAQ.DLL
Dim Board As Integer
Dim Channel As Integer
Dim Range As Integer
Dim ULStat As Integer
Dim DataValue As Short
Board =0
Channel = 0
Range =BIP5VOLTS;
ULStat =cbAIn(Board, Channel, Range,
DataValue)
Dim Board0 As MccBoard
Board0 = new MccDaq.MccBoard(0)
Dim Channel As Integer
Dim Range As MccDaq.Range
Dim ULStat As ErrorInfo
Dim DataValue As UInt16
Channel = 0
Range =Range.BIP5VOLTS;
ULStat =Board0.AIn(Channel, Range,
DataValue)
Enumerated types
Instead of using constants such as BIP5VOLTS, the CYDAS UDR Library for .NET uses enumerated types. An
enumerated type takes settings such as range types, scan options or digital port numbers and puts them into
logical groups. Some examples are:
Range.Bip5Volts
Range.Bip10Volts
Range.Uni5Volts
Range.Uni10Volts
ScanOptions.Background
ScanOptions.Continuous
ScanOptions.BurstMode