cbGetConfig()

Returns a configuration option currently set for a board. By default, the configuration settings are loaded from the cb.cfg file created by InstaCal. If cbIgnoreInstaCal() is called first, the configuration settings will be the default values for the board in use. For either case, you can change the current configuration within a running program with the cbSetConfig() function.

Function Prototype

C/C++

int cbGetConfig(int InfoType, int BoardNum, int DevNum, int ConfigItem, int *ConfigVal)

Visual Basic

Function cbGetConfig(ByVal InfoType&, ByVal BoardNum&, ByVal DevNum&, ByVal ConfigItem&, ConfigVal&) As Long

Arguments

InfoType

The configuration information for each board is grouped into different categories. This argument specifies which category you want. Set it to one of the constants listed in the "InfoType argument values" below.

BoardNum

The number associated with the board when it was installed with InstaCal or created with cbCreateDaqDevice(). BoardNum may be 0 to 99.

DevNum

The purpose of the DevNum argument depends on the ConfigItem being passed. It can serve as a channel number, an index into the ConfigItem, or it can be ignored. See specific ConfigItem values below.

ConfigItem

Specifies which configuration item you wish to retrieve. Set it in conjunction with the InfoType argument using one of the constants listed in the "ConfigItem argument values" below.

ConfigVal

The specified configuration item is returned to this variable.

Returns

InfoType argument values

InfoTypeDescription
GLOBALINFOInformation about the configuration file.
BOARDINFOGeneral information about a board.
DIGITALINFOInformation about a digital device.
COUNTERINFOInformation about a counter device.
EXPANSIONINFOInformation about an expansion device.
MISCINFOOne of the miscellaneous options for the board.

ConfigItem argument values

Valid ConfigItem constant settings for each InfoType constant are as follows:

InfoType ConfigItemDescription
GlobalInfoGIVERSIONcb.cfg file format; used by the library to determine compatibility.

DevNum is ignored.
GINUMBOARDSMaximum number of boards that can be installed.

DevNum is ignored.
GINUMEXPBOARDSMaximum number of expansion boards that can be installed.

DevNum is ignored.
BOARDINFOBIADAIMODEAnalog input mode.

DevNum is ignored.
BIADCHANAIMODEAnalog input mode.

DevNum indicates the channel number.
BIADCHANTYPEAnalog input channel type. Use this setting with devices that have configurable input types.

DevNum indicates the channel number.
BIADCSETTLETIMEADC settling time.

DevNum is ignored.
BIADDATARATEA/D data rate.

DevNum indicates the channel number.
BIADRESA/D resolution.

DevNum is ignored.
BIADXFERMODEData transfer mode.

DevNum is ignored.
BIADTIMINGMODETiming mode.

DevNum is ignored.
BIADTRIGCOUNTNumber of analog input samples to acquire per trigger.

DevNum is ignored.
BIADTRIGSRCA/D trigger source.

DevNum indicates the channel number.
BIBASEADRBase address of the device.

DevNum is ignored.
BIBOARDTYPEUnique number from 0 to 8000 Hex which describes the type of board installed.

DevNum is ignored.
BICALTABLETYPEThe coefficients table used for calibration. 0 = Factory, 1 = Field.

DevNum is either ignored or specifies a base or expansion board.
BICHANRTDTYPERTD sensor type.

DevNum indicates the channel number.
BICHANTCTYPEThermocouple sensor type.

DevNum indicates the channel number.
BICINUMDEVSNumber of counter devices.

DevNum is ignored.
BICLOCKClock frequency in megahertz (MHz) (40, 10, 8, 6, 5, 4, 3, 2, 1) or 0 for not supported.

DevNum is ignored.
BICTRTRIGCOUNTNumber of counter samples to acquire per trigger.

DevNum is ignored.
BIDACFORCESENSERemote sensing state of an analog output channel (ENABLED or DISABLED.)

DevNum indicates the channel number.
BIDACRANGEAnalog output voltage range.

DevNum is ignored.
BIDACRESD/A resolution.

DevNum is ignored.
BIDACSTARTUPConfiguration register STARTUP bit setting.

DevNum indicates the channel number.

Refer to the Notes section below for additional information about using the BIDACSTARTUP option.
BIDACTRIGCOUNTNumber of analog output samples to acquire per trigger.

DevNum is ignored.
BIDACUPDATEMODEUpdate mode for a digital-to-analog converter (DAC).

DevNum is ignored.

Refer to the Notes section below for more information.
BIDETECTOPENTCOpen thermocouple detection setting. 0 = disabled, 1 = enabled.

DevNum is either ignored or specifies a base or expansion board; refer to device-specific information.
BIDINUMDEVSNumber of digital devices.

DevNum is ignored.
BIDISOFILTERAC filter setting. 0 = disabled, 1 = enabled.

DevNum is the bit number.
BIDITRIGCOUNTNumber of digital input samples to acquire per trigger.

DevNum is ignored.
BIDMACHANDMA channel — 0, 1, or 3.

DevNum is ignored.
BIDOTRIGCOUNTNumber of digital output samples to generate per trigger.

DevNum is ignored.
BIDTBOARDBoard number of the connected DT board.

DevNum is ignored.
BIEXTCLKTYPEExternal clock type.

DevNum is ignored.
BIEXTINPACEREDGEInput scan clock edge.

DevNum is ignored.
BIEXTOUTPACEREDGEOutput scan clock edge.

DevNum is ignored.
BIINPUTPACEROUTInput pacer clock state.

DevNum is ignored.
BIINTEDGEInterrupt edge. 0 = rising, 1 = falling.

DevNum is ignored.
BIINTLEVELInterrupt level. 0 for none, or 1 to 15.

DevNum is ignored.
BINETCONNECTCODECode used to connect with a device over a network connection.

DevNum is ignored.
BINETIOTIMEOUTAmount of time (in milliseconds) to wait for a WEB device to acknowledge a command or query sent to the device over a network connection. If no acknowledgement is received in this time a timeout occurs.

DevNum is ignored.
BINUMADCHANSNumber of A/D channels

DevNum is ignored.
BINUMDACHANSNumber of D/A channels.

DevNum is ignored.
BINUMIOPORTSNumber of I/O ports used by the device.

DevNum is ignored.
BINUMTEMPCHANSNumber of temperature channels.

DevNum is ignored.
BIPANIDPersonal Area Network (PAN) identifier for a USB device that supports wireless communication.

DevNum is ignored.
BIPATTERNTRIGPORTPattern trigger port.

DevNum is ignored.
BIRANGESelected voltage range.

DevNum is ignored.

For switch selectable gains only. If the selected A/D board does not have a programmable gain feature, this argument returns the range as defined by the install settings.
BIRFCHANNELRF channel number used to transmit/receive data by a USB device that supports wireless communication.

DevNum is ignored.
BIRSSReceived signal strength in dBm of a remote device.

DevNum is ignored.
BISERIALNUMCustom serial number assigned by a user to a USB device. To retrieve the factory serial number, use cbGetConfigString() with BIDEVUNIQUEID.

DevNum is ignored.
BISYNCMODESimultaneous mode setting. 0 = master, 1 = slave.

DevNum is ignored.
BITEMPAVGNumber of temperature samples per average.

DevNum is ignored.
BITEMPSCALETemperature scale.

DevNum is ignored.
BITEMPREJFREQTemperature rejection frequency.

DevNum is either ignored or specifies a base or expansion board.
BITERMCOUNTSTATBITTerminal count output status for a specified bit.

DevNum indicates the bit number. 0 = enabled, 1 = disabled.
BIWAITSTATEWait State jumper setting. 0 = disabled, 1 = enabled.

DevNum is ignored.
BIUSESEXPSExpansion board support. TRUE/FALSE value is returned.

DevNum is ignored.
BIUSERDEVIDNUMUser-configured string that identifies a USB device.

DevNum is ignored.
DIGITALINFODIDEVTYPEDevice Type – AUXPORT, FIRSTPORTA, and so on.

DevNum indicates a zero-based index that specifies the device.
DICONFIGCurrent configuration INPUT or OUTPUT.

DevNum indicates a zero-based index that specifies the device.
DINUMBITSNumber of bits in the port.

DevNum indicates a zero-based index that specifies the device.
DICURVALCurrent value of outputs.

DevNum indicates a zero-based index that specifies the device.
DIDISABLEDIRCHECKThe direction check setting for a specified port or bit when calling cbDOut(), cbDBitOut(), and cbDOutArray(). 0 = enabled, 1 = disabled.
DIINMASKBit configuration of the specified port. Any bits that return a value of 1 are configured for input. Refer to the Notes section below for additional information about using the DIINMASK option.

DevNum indicates a zero-based index that specifies the device.
DIOUTMASKBit configuration of the specified port. Any bits that return a value of 1 are configured for output. Refer to the Notes section below for additional information about using the DIOUTMASK option.

DevNum indicates a zero-based index that specifies the device.
COUNTERINFOCICTRNUMCounter number; indicated by DevNum.
CICTRTYPECounter type, where:

1 = 8254, 2 = 9513, 3 = 8536, 4 = 7266, 5 = event counter, 6 = scan counter, 7 = timer counter, 8 = quadrature counter, and 9 = pulse counter.

DevNum indicates a zero-based index that specifies the device.
EXPANSIONINFOXIBOARDTYPEBoard type (refer to the "Measurement Computing Device IDs topic in the Universal Library User's Guide)
XIMUXADCHAN1First A/D channel connected to the EXP board.
XIMUXADCHAN2Second A/D channel connected to the EXP board.
XIRANGE1Range (gain) of the low 16 channels.
XIRANGE2Range (gain) of the high 16 channels.
XICJCCHANA/D channel connected to the CJC.
XITHERMTYPESensor type. Use one of the sensor types listed below:
  • 1 = J
  • 2 = K
  • 3 = T
  • 4 = E
  • 5 = R
  • 6 = S
  • 7 = B
  • 257 = Platinum .00392
  • 258 = Platinum .00391
  • 259 = Platinum .00385
  • 260 = Copper .00427
  • 261 = Nickel/Iron .00581
  • 262 = Nickel/Iron .00527
XINUMEXPCHANSNumber of channels on the expansion board.

DevNum is ignored.
XIPARENTBOARDBoard number of the base A/D board.

DevNum is ignored.

Notes