User`s manual

CYDAS UDR Library User’s Guide CYDAS UDR Library for .NET Description & Use
17
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
CYDAS UDR Library. The
MccBoard class methods have virtually the same parameters set as their UDR
Library 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 5-1 on page 18 for a list of
MccDaq enumerated values.
The CYDAS UDR Library Function Reference contains detailed information about all MccBoard class
methods. This document is available on our website, on this software CD, and C:\MCC\Documents (by
default) after software is installed.
ErrorInfo class
Most UDR Library 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.