cbSetConfig()

Changes board configuration options at runtime.

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 using this function

Function prototype

C/C++

int cbSetConfig(int InfoType, int BoardNum, int DevNum, int ConfigItem, int ConfigVal)

Visual Basic

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

Arguments

InfoType

The configuration information for each board is grouped into different categories. InfoType specifies which category you want. Set it to one of the constants listed in the InfoType argument values section 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 ConfigItems below.

ConfigItem

Specifies which configuration item you wish to set. Set it in conjunction with the InfoType argument using the table under ConfigItem argument values section below.

ConfigVal

The value to set the specified configuration item to.

Returns

InfoType argument values

InfoTypeDescription
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

InfoTypeConfigItemDescription
BoardInfoBIADCHANTYPEAnalog input channel type. Use this setting with devices that have configurable input types.

DevNum indicates the channel number.

Use this setting in conjunction with one of these ConfigVal settings:
  • AI_CHAN_TYPE_VOLTAGE (Voltage mode, ±60 V, ±15 V, ±4 V, ±1 V, ±1.25 mV)
  • AI_CHAN_TYPE_CURRENT (Current mode, ±25 mA)
  • AI_CHAN_TYPE_RESISTANCE_10K4W (4-wire Resistance mode, 10 kΩ)
  • AI_CHAN_TYPE_RESISTANCE_1K4W (4-wire Resistance mode, 1 kΩ)
  • AI_CHAN_TYPE_RESISTANCE_10K2W (2-wire Resistance mode, 10 kΩ)
  • AI_CHAN_TYPE_RESISTANCE_1K2W (2-wire Resistance mode, 1 kΩ)
  • AI_CHAN_TYPE_TC (Thermocouple mode, ±125 mV)
  • AI_CHAN_TYPE_RTD_1000OHM_4W (4-wire RTD mode, 1000 Ω)
  • AI_CHAN_TYPE_RTD_100OHM_4W (4-wire RTD mode, 100 Ω)
  • AI_CHAN_TYPE_RTD_1000OHM_3W (3-wire RTD mode, 1000 Ω)
  • AI_CHAN_TYPE_RTD_100OHM_3W (3-wire RTD mode, 100 Ω)
  • AI_CHAN_TYPE_QUART_BRIDGE_350OHM (Quarter-bridge mode, 350 Ω)
  • AI_CHAN_TYPE_QUART_BRIDGE_120OHM (Quarter-bridge mode, 120 Ω)
  • AI_CHAN_TYPE_HALF_BRIDGE (Half-bridge mode, 500 mV/V)
  • AI_CHAN_TYPE_FULL_BRIDGE_62PT5mVV (Full-bridge mode, ±62.5 mV/V)
  • AI_CHAN_TYPE_FULL_BRIDGE_7PT8mVV (Full-bridge mode, ±7.8 mV/V)
BIADCSETTLETIMEADC settling time.

DevNum is ignored.

Use this setting in conjunction with one of these ConfigVal settings:
  • SETTLE_DEFAULT
  • SETTLE_1us
  • SETTLE_5us
  • SETTLE_10us
  • SETTLE_1ms
BIADDATARATEA/D data rate.

DevNum indicates the channel number.
BIADTIMINGMODEADC timing mode.

DevNum is ignored.

Use this setting in conjunction with one of these ConfigVal settings:
  • 1 (High Speed)
  • 8 (60 Hz rejection)
  • 9 (50 Hz rejection)
  • 15 (High resolution)
BIADTRIGCOUNTADC trigger count.

DevNum is ignored.

For use with the cbAInScan()/AInScan() RETRIGMODE option to set up repetitive trigger events.
BIADTRIGSRCA/D trigger source.

DevNum indicates the channel number.

Use this setting in conjunction with one of these ConfigVal settings:
  • 0
  • 1
  • 2
  • 3
BIADXFERMODESets the data transfer mode to either kernel mode (default) or user mode.

DevNum is ignored.

Use this setting in conjunction with one of these ConfigVal settings:
  • XFER_KERNEL
  • XFER_USER
BIBASEADRBase address of the device.

DevNum is ignored.
BICALTABLETYPECoefficients table used for calibration.

DevNum is ignored.

Use this setting in conjunction with one of these ConfigVal settings:
  • CAL_TABLE_FACTORY
  • CAL_TABLE_FIELD
BICALOUTPUTCal pin voltage on supported USB devices.

DevNum is ignored.
BICHANRTDTYPERTD sensor type.

DevNum indicates the channel number.

Use this setting in conjunction with one of these ConfigVal settings:
  • RTD_PT_3750
  • RTD_PT_3850
  • RTD_PT_3851
  • RTD_PT_3911
  • RTD_PT_3916
  • RTD_PT_3920
  • RTD_PT_3928
  • Custom
BICHANTCTYPEThermocouple sensor type.

DevNum indicates the channel number.

Use this setting in conjunction with one of these ConfigVal settings:
  • TC_TYPE_J
  • TC_TYPE_K
  • TC_TYPE_S
  • TC_TYPE_R
  • TC_TYPE_B
  • TC_TYPE_E
  • TC_TYPE_T
  • TC_TYPE_N
BICLOCKClock frequency in megahertz (MHz) – 1, 4, 6 or 10.

DevNum indicates the channel number.
BICTRTRIGCOUNTNumber of counter samples to acquire per trigger.

DevNum is ignored.

For use with the cbCInScan() RETRIGMODE option to set up repetitive trigger events.
BIDACFORCESENSEEnables or disables remote sensing of an analog output channel.

DevNum indicates the channel number. ConfigItem is ENABLED OR DISABLED.
BIDACSTARTUPConfiguration register STARTUP bit setting.

DevNum is ignored.

Set to 0 or 1 to enable/disable the storing of digital-to-analog converter (DAC) startup values. Current or last stored values are written to the DACs each time the board is powered up. Refer to the "Notes" section below for additional information about using the BIDACSTARTUP option.
BIDACRANGED/A range code.

DevNum indicates the channel number.

Refer to board-specific information for a list of the supported ranges.
BIDACTRIGCOUNTDAC trigger count.

DevNum is ignored.

For use with the cbAOutScan()/AOutScan() RETRIGMODE option to set up repetitive trigger events.
BIDACUPDATECMDUpdates all analog output channels.

DevNum and ConfigVal are not used and can be set to 0.

Refer to the "Notes" section below for more information.
BIDACUPDATEMODEUpdate mode for a digital-to-analog converter (DAC).

DevNum is ignored.

Use this setting in conjunction with one of these ConfigVal settings:
  • UPDATEIMMEDIATE
  • UPDATEONCOMMAND
Refer to the "Notes" section below for more information.
BIDACSETTLETIMEDAC settling time.

DevNum is ignored.
BIDETECTOPENTCOpen thermocouple detection setting. 0 = disable, 1 = enable.

DevNum is either ignored or specifies a base or expansion board; refer to device-specific information.
BIDIDEBOUNCESTATEState of the digital inputs when debounce timing is set.

DevNum is ignored.
BIDIDEBOUNCETIMEDebounce time of digital inputs.

DevNum is ignored.
BIDISOFILTERAC filter setting. 0 = disable, 1 = enable.

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

DevNum is ignored.
BIDMACHANDMA channel.

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

DevNum is ignored.
BIEXTCLKTYPEExternal clock type.

DevNum is ignored.

Use this setting in conjunction with one of these ConfigVal settings:
  • CONTINUOUS_CLK
  • GATED_CLK
BIEXTINPACEREDGEThe input pacer clock edge.

DevNum is ignored.

Use this setting in conjunction with one of these ConfigVal settings:
  • EXT_PACER_EDGE_RISING
  • EXT_PACER_EDGE_FALLING
BIEXTOUTPACEREDGEThe output pacer clock edge.

DevNum is ignored.

Use this setting in conjunction with one of these ConfigVal settings:
  • EXT_PACER_EDGE_RISING
  • EXT_PACER_EDGE_FALLING
BIINPUTPACEROUTInput pacer clock output enable/disable setting.

DevNum is ignored.

When enabled, the input clock is set for output.
BIINTEDGEInterrupt edge. 0 = rising, 1 = falling.

DevNum is ignored.
BIINTLEVELInterrupt level.

DevNum is ignored.
BIHIDELOGINDLGEnables or disables the Device Login dialog.

DevNum is ignored.

Set to a nonzero value to disable the dialog. When disabled, the cbDeviceLogin() function must be used to log in to a device session.
BINETCONNECTIONCODECode 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.
BIOUTPUTPACEROUTEnables or disables the output pacer clock signal. When enabled, the output clock is set for output.
BIPANIDThe Personal Area Network (PAN) identifier set for a USB device that supports wireless communication.

DevNum is ignored.
BIPATTERNTRIGPORTThe pattern trigger port.

DevNum is ignored.

Use this setting in conjunction with one of these ConfigVal settings:
  • AUXPORT0 (default)
  • AUXPORT1
BIRANGEThe selected voltage range. Refer to board-specific information for the ranges supported by a device.

DevNum is ignored.
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.
BISERIALNUMUser-configured identifier of a supported USB device.

DevNum is ignored.
BISRCADPACEROutputs the A/D pacer signal to the SYNC pin on supported USB devices.
Deprecated; unless your application calls deprecated methods, use BIINPUTPACEROUT.
BISYNCMODEThe simultaneous mode setting. 0 = master, 1 = slave.
BITEMPAVGNumber of samples per average. Use this setting in conjunction with one of these ConfigVal settings:
  • 1 to 16384 (if the BITEMPREJFREQ rejection frequency is off (0)
  • 16 to 16384 (if the BITEMPREJFREQ rejection frequency is on (50 or 60)
When specified, multiple readings are acquired, averaged, and converted to temperature.
BITEMPSCALETemperature scale.

DevNum is ignored.

Use this setting in conjunction with one of these ConfigVal settings:
  • CELSIUS
  • FAHRENHEIT
  • KELVIN
BITEMPREJFREQRejection frequency. Use this setting in conjunction with these settings:

DevNum:
  • 0 (base board)
  • 1 (expansion board)
ConfigVal:
  • 0 (off)
  • 50 (50 Hz noise rejection)
  • 60 (60 Hz noise rejection)
BITERMCOUNTSTATBITTerminal count output status.
DevNum indicates the bit number. 0 = enabled, 1 = disabled.
BIWAITSTATEWait State jumper setting. 0 = disable, 1 = enable.
DIGITALINFODIDISABLEDIRCHECKThe direction check setting for a specified port or bit when calling cbDOut(), cbDBitOut(), and cbDOutArray().

Use this setting in conjunction with one of these ConfigVal settings:
  • 0 (enables the direction check)
  • 1 (disables the direction check)
EXPANSIONINFOXIMUXADCHAN1First A/D channel connected to the board
XIMUXADCHAN2Second A/D channel connected to the board.
XIRANGE1Range (gain) of the low 16 channels.
XIRANGE2Range (gain) of the high 16 channels.
XICJCCHANA/D channel connected to the CJC channel.
XITHERMTYPEThermocouple type.

Notes

cbSetConfig(BOARDINFO, boardNumber, 0, BIDACSTARTUP, 1);

for (int i=1; i <8; i++)

{

cbAOut(boardNumber, i, BIP5VOLTS, DACValue[i]);

}

cbSetConfig(BOARDINFO, boardNumber, 0, BIDACSTARTUP, 0);