User`s guide
Universal Library User's Guide Universal Library for .NET Description & Use
21
The following code examples demonstrate how to create a new instance of the MccBoard class with the board
number passed to it:
Visual Basic
Private DaqBoard As MccDaq.MccBoard
DaqBoard = New MccDaq.MccBoard(BoardNumber)
C#
private MccDaq.MccBoard DaqBoard;
DaqBoard = new MccDaq.MccBoard(BoardNumber);
Class properties
The MccBoard class also contains six properties that you can use to examine or change the configuration of
your board. The configuration information for all boards is stored in the CB.CFG file, and is loaded from
CB.CFG by all programs that use the library.
Properties
Description
BoardName
Name of the board associated with an instance of the MccBoard class.
BoardNum
Number of the board associated with an instance of the MccBoard class.
BoardConfig
Gets a reference to a cBoardConfig class object. Use this class reference to get or set
various board settings.
CtrConfig
Gets a reference to a cCtrConfig class object. Use this class reference to get or set
various counter settings.
DioConfig
Gets a reference to a cDioConfig class object. Use this class reference to get or set
various digital I/O settings.
ExpansionConfig
Gets a reference to a cExpansionConfig class object. Use this class reference to get or set
various expansion board settings.
Class methods
The MccBoard class contains close to 80 methods that are equivalents of the function calls used in the standard
Universal Library. The MccBoard class methods have virtually the same parameters set as their UL
counterparts.
The following code examples demonstrate how to call the AIn()method of the MccBoard object MccDaq:
Visual Basic
ULStat = DaqBoard.AIn(Chan, Range, DataValue)
C#
ULStat = DaqBoard.AIn(Chan, Range, out DataValue);
Many of the arguments are MccDaq enumerated values. Enumerated values take settings such as range types
or scan options and put them into logical groups. For example, to set a range value, reference a value from the
MCCDaq.Range enumerated type, such as Range.Bip5Volts. Refer to Table 1 on page 23 for a list of MccDaq
enumerated values.
The Universal Library Function Reference contains detailed information about all MccBoard class methods.
This document is available on our web site at www.mccdaq.com/PDFmanuals/sm-ul-functions.pdf.
ErrorInfo class
Most UL methods return ErrorInfo objects. These objects contain two properties that provide information on
the status of the method called:
ErrorInfo.Message property gets the text of the error message associated with a specific error code.
ErrorInfo.Value property gets the named constant value associated with the ErrorInfo object.
The ErrorInfo class also includes error code enumerated values, which define the error number and
associated message which can be returned when you call a method.