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
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
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.
InfoType | Description |
BOARDINFO | General information about a board. |
DIGITALINFO | Information about a digital device. |
COUNTERINFO | Information about a counter device. |
EXPANSIONINFO | Information about an expansion device. |
MISCINFO | One of the miscellaneous options for the board. |
InfoType | ConfigItem | Description |
BoardInfo | BIADCHANTYPE | Analog 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:
|
BIADCSETTLETIME | ADC settling time. DevNum is ignored. Use this setting in conjunction with one of these ConfigVal settings:
| |
BIADDATARATE | A/D data rate. DevNum indicates the channel number. | |
BIADTIMINGMODE | ADC timing mode. DevNum is ignored. Use this setting in conjunction with one of these ConfigVal settings:
| |
BIADTRIGCOUNT | ADC trigger count. DevNum is ignored. For use with the cbAInScan()/AInScan() RETRIGMODE option to set up repetitive trigger events. | |
BIADTRIGSRC | A/D trigger source. DevNum indicates the channel number. Use this setting in conjunction with one of these ConfigVal settings:
| |
BIADXFERMODE | Sets 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:
| |
BIBASEADR | Base address of the device. DevNum is ignored. | |
BICALTABLETYPE | Coefficients table used for calibration. DevNum is ignored. Use this setting in conjunction with one of these ConfigVal settings:
| |
BICALOUTPUT | Cal pin voltage on supported USB devices. DevNum is ignored. | |
BICHANRTDTYPE | RTD sensor type. DevNum indicates the channel number. Use this setting in conjunction with one of these ConfigVal settings:
| |
BICHANTCTYPE | Thermocouple sensor type. DevNum indicates the channel number. Use this setting in conjunction with one of these ConfigVal settings:
| |
BICLOCK | Clock frequency in megahertz (MHz) – 1, 4, 6 or 10. DevNum indicates the channel number. | |
BICTRTRIGCOUNT | Number of counter samples to acquire per trigger. DevNum is ignored. For use with the cbCInScan() RETRIGMODE option to set up repetitive trigger events. | |
BIDACFORCESENSE | Enables or disables remote sensing of an analog output channel. DevNum indicates the channel number. ConfigItem is ENABLED OR DISABLED. | |
BIDACSTARTUP | Configuration 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. | |
BIDACRANGE | D/A range code. DevNum indicates the channel number. Refer to board-specific information for a list of the supported ranges. | |
BIDACTRIGCOUNT | DAC trigger count. DevNum is ignored. For use with the cbAOutScan()/AOutScan() RETRIGMODE option to set up repetitive trigger events. | |
BIDACUPDATECMD | Updates 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. | |
BIDACUPDATEMODE | Update mode for a digital-to-analog converter (DAC). DevNum is ignored. Use this setting in conjunction with one of these ConfigVal settings:
| |
BIDACSETTLETIME | DAC settling time. DevNum is ignored. | |
BIDETECTOPENTC | Open thermocouple detection setting. 0 = disable, 1 = enable. DevNum is either ignored or specifies a base or expansion board; refer to device-specific information. | |
BIDIDEBOUNCESTATE | State of the digital inputs when debounce timing is set. DevNum is ignored. | |
BIDIDEBOUNCETIME | Debounce time of digital inputs. DevNum is ignored. | |
BIDISOFILTER | AC filter setting. 0 = disable, 1 = enable. DevNum is the bit number. | |
BIDITRIGCOUNT | Number of digital input samples to acquire per trigger. DevNum is ignored. | |
BIDMACHAN | DMA channel. DevNum is ignored. | |
BIDOTRIGCOUNT | Number of digital output samples to generate per trigger. DevNum is ignored. | |
BIEXTCLKTYPE | External clock type. DevNum is ignored. Use this setting in conjunction with one of these ConfigVal settings:
| |
BIEXTINPACEREDGE | The input pacer clock edge. DevNum is ignored. Use this setting in conjunction with one of these ConfigVal settings:
| |
BIEXTOUTPACEREDGE | The output pacer clock edge. DevNum is ignored. Use this setting in conjunction with one of these ConfigVal settings:
| |
BIINPUTPACEROUT | Input pacer clock output enable/disable setting. DevNum is ignored. When enabled, the input clock is set for output. | |
BIINTEDGE | Interrupt edge. 0 = rising, 1 = falling. DevNum is ignored. | |
BIINTLEVEL | Interrupt level. DevNum is ignored. | |
BIHIDELOGINDLG | Enables 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. | |
BINETCONNECTIONCODE | Code used to connect with a device over a network connection. DevNum is ignored. | |
BINETIOTIMEOUT | Amount 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. | |
BINUMADCHANS | Number of A/D channels. DevNum is ignored. | |
BIOUTPUTPACEROUT | Enables or disables the output pacer clock signal. When enabled, the output clock is set for output. | |
BIPANID | The Personal Area Network (PAN) identifier set for a USB device that supports wireless communication. DevNum is ignored. | |
BIPATTERNTRIGPORT | The pattern trigger port. DevNum is ignored. Use this setting in conjunction with one of these ConfigVal settings:
| |
BIRANGE | The selected voltage range. Refer to board-specific information for the ranges supported by a device. DevNum is ignored. | |
BIRFCHANNEL | RF channel number used to transmit/receive data by a USB device that supports wireless communication. DevNum is ignored. | |
BIRSS | Received signal strength in dBm of a remote device. DevNum is ignored. | |
BISERIALNUM | User-configured identifier of a supported USB device. DevNum is ignored. | |
BISRCADPACER | Outputs the A/D pacer signal to the SYNC pin on supported USB devices. Deprecated; unless your application calls deprecated methods, use BIINPUTPACEROUT. | |
BISYNCMODE | The simultaneous mode setting. 0 = master, 1 = slave. | |
BITEMPAVG | Number of samples per average. Use this setting in conjunction with one of these ConfigVal settings:
| |
BITEMPSCALE | Temperature scale. DevNum is ignored. Use this setting in conjunction with one of these ConfigVal settings:
| |
BITEMPREJFREQ | Rejection frequency. Use this setting in conjunction with these settings: DevNum:
| |
BITERMCOUNTSTATBIT | Terminal count output status. DevNum indicates the bit number. 0 = enabled, 1 = disabled. | |
BIWAITSTATE | Wait State jumper setting. 0 = disable, 1 = enable. | |
DIGITALINFO | DIDISABLEDIRCHECK | The 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:
|
EXPANSIONINFO | XIMUXADCHAN1 | First A/D channel connected to the board |
XIMUXADCHAN2 | Second A/D channel connected to the board. | |
XIRANGE1 | Range (gain) of the low 16 channels. | |
XIRANGE2 | Range (gain) of the high 16 channels. | |
XICJCCHAN | A/D channel connected to the CJC channel. | |
XITHERMTYPE | Thermocouple type. |
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);