
Universal Library User's Guide Universal Library for .NET Description & Use
26
MCC classes
To use board-specific Universal Library functions inside a .NET application, you use methods of the
appropriate class. UL for .NET classes are listed in Table 3.
Table 3. UL for .NET Board Classes
Access board-related Universal Library functions.
Utility class for storing and reporting error codes and messages.
Gets and sets board configuration settings.
Gets and sets counter configuration settings.
Gets and sets digital I/O configuration settings.
Gets and sets expansion board configuration settings.
Gets and sets global configuration settings.
Access utility Universal Library functions.
Reads and converts binary log files.
Refer to the Universal Library Function Reference (available on our web site at
www.mccdaq.com/PDFmanuals/sm-ul-functions.pdf) 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 Universal 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:
Komentarze do niniejszej Instrukcji