# get_config()

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 ignore_instacal() 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 set_config().

## Prototype

get_config(info_type, board_num, dev_num, config_item)

## Parameters

info_type (InfoType)

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

board_num (int)

The number associated with the board when it was installed with InstaCal or created with create_daq_device().

dev_num (int)

The purpose of the dev_num parameter depends on on the value of the config_item parameter. It can serve as a channel number, an index into the config_item, or it can be ignored. Refer to the config_item parameter values below.

config_item (GlobalInfo, BoardInfo, DigitalInfo, CounterInfo, or ExpansionInfo)

Specifies which configuration item you wish to retrieve. Set it in conjunction with the info_type parameter using one of the constants listed in the config_item parameter values below.

## Returns

- The specified configuration item (int)

### info_type parameter values

InfoType | Description
GLOBALINFO | Information about the configuration file.
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.

### config_item parameter values

info_type | config_item | Description
GlobalInfo | VERSION | cb.cfg file format; used by the library to determine compatibility. dev_num is ignored.
NUMBOARDS | Maximum number of boards that can be installed. dev_num is ignored.
NUMEXPBOARDS | Maximum number of expansion boards that can be installed. dev_num is ignored.
BOARDINFO | ADAIMODE | Analog input mode. dev_num is ignored.
ADCHANAIMODE | Analog input mode. dev_num indicates the channel number.
ADCHANTYPE | Analog input channel type. Use this setting with devices that have configurable input types. dev_num indicates the channel number.
ADCSETTLETIME | ADC settling time. dev_num is ignored.
ADDATARATE | A/D data rate. dev_num indicates the channel number.
ADRES | A/D resolution. dev_num is ignored.
ADXFERMODE | Data transfer mode. dev_num is ignored.
ADTIMINGMODE | Timing mode. dev_num is ignored.
ADTRIGCOUNT | Number of analog input samples to acquire per trigger. dev_num is ignored.
ADTRIGSRC | A/D trigger source. dev_num indicates the channel number.
BASEADR | Base address of the device. dev_num is ignored.
BOARDTYPE | Unique number from 0 to 8000 Hex which describes the type of board installed. dev_num is ignored.
CALTABLETYPE | The coefficients table used for calibration. 0 = Factory, 1 = Field. dev_num is either ignored or specifies a base or expansion board.
CHANRTDTYPE | RTD sensor type. dev_num indicates the channel number.
CHANTCTYPE | Thermocouple sensor type. dev_num indicates the channel number.
CINUMDEVS | Number of counter devices. dev_num is ignored.
CLOCK | Clock frequency in megahertz (MHz) (40, 10, 8, 6, 5, 4, 3, 2, 1) or 0 for not supported. dev_num is ignored.
CTRTRIGCOUNT | Number of counter samples to acquire per trigger. dev_num is ignored.
DACFORCESENSE | Remote sensing state of an analog output channel (ENABLED or DISABLED.) dev_num indicates the channel number.
DACRANGE | Analog output voltage range. dev_num is ignored.
DACRES | D/A resolution. dev_num is ignored.
DACSTARTUP | Configuration register STARTUP bit setting. dev_num indicates the channel number. Refer to the Notes section below for additional information.
DACTRIGCOUNT | Number of analog output samples to acquire per trigger. dev_num is ignored.
DACUPDATEMODE | Update mode for a digital-to-analog converter (DAC). dev_num is ignored. Refer to the Notes section below for additional information.
DETECTOPENTC | Open thermocouple detection setting. 0 = disabled, 1 = enabled. dev_num is either ignored or specifies a base or expansion board; refer to device-specific information.
DINUMDEVS | Number of digital devices. dev_num is ignored.
DISOFILTER | AC filter setting. 0 = disabled, 1 = enabled. dev_num is the bit number.
DITRIGCOUNT | Number of digital input samples to acquire per trigger. dev_num is ignored.
DMACHAN | DMA channel — 0, 1, or 3. dev_num is ignored.
DOTRIGCOUNT | Number of digital output samples to generate per trigger. dev_num is ignored.
DTBOARD | Board number of the connected DT board. dev_num is ignored.
EXTCLKTYPE | External clock type. dev_num is ignored.
EXTINPACEREDGE | Input scan clock edge. dev_num is ignored.
EXTOUTPACEREDGE | Output scan clock edge. dev_num is ignored.
INPUTPACEROUT | Input pacer clock state. dev_num is ignored.
INTEDGE | Interrupt edge. 0 = rising, 1 = falling. dev_num is ignored.
INTLEVEL | Interrupt level. 0 for none, or 1 to 15. dev_num is ignored.
NETCONNECTCODE | Code used to connect with a device over a network connection. dev_num is ignored.
NETIOTIMEOUT | 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. dev_num is ignored.
NUMADCHANS | Number of A/D channels dev_num is ignored.
NUMDACHANS | Number of D/A channels. dev_num is ignored.
NUMIOPORTS | Number of I/O ports used by the device. dev_num is ignored.
NUMTEMPCHANS | Number of temperature channels. dev_num is ignored.
PANID | Personal Area Network (PAN) identifier for a USB device that supports wireless communication. dev_num is ignored.
PATTERNTRIGPORT | Pattern trigger port. dev_num is ignored.
RANGE | Selected voltage range. dev_num is ignored. For switch selectable gains only. If the selected A/D board does not have a programmable gain feature, this parameter returns the range as defined by the install settings.
RFCHANNEL | RF channel number used to transmit/receive data by a USB device that supports wireless communication. dev_num is ignored.
RSS | Received signal strength in dBm of a remote device. dev_num is ignored.
SERIALNUM | Custom serial number assigned by a user to a USB device. To retrieve the factory serial number, use get_config_string() with DEVUNIQUEID. dev_num is ignored.
SYNCMODE | Simultaneous mode setting. 0 = master, 1 = slave. dev_num is ignored.
TEMPAVG | Number of temperature samples per average. dev_num is ignored.
TEMPSCALE | Temperature scale. dev_num is ignored.
TEMPREJFREQ | Temperature rejection frequency. dev_num is either ignored or specifies a base or expansion board.
TERMCOUNTSTATBIT | Terminal count output status for a specified bit. dev_num indicates the bit number. 0 = enabled, 1 = disabled.
WAITSTATE | Wait State jumper setting. 0 = disabled, 1 = enabled. dev_num is ignored.
USESEXPS | Expansion board support. TRUE/FALSE value is returned. dev_num is ignored.
USERDEVIDNUM | User-configured string that identifies a USB device. dev_num is ignored.
DIGITALINFO | DEVTYPE | Device Type – AUXPORT, FIRSTPORTA, and so on. dev_num indicates a zero-based index that specifies the device.
CONFIG | Current configuration INPUT or OUTPUT. dev_num indicates a zero-based index that specifies the device.
NUMBITS | Number of bits in the port. dev_num indicates a zero-based index that specifies the device.
CURVAL | Current value of outputs. dev_num indicates a zero-based index that specifies the device.
DISABLEDIRCHECK | The direction check setting for a specified port or bit when calling d_out(), d_bit_out(), and d_out_array(). 0 = enabled, 1 = disabled.
INMASK | Bit 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 INMASK option. dev_num indicates a zero-based index that specifies the device.
OUTMASK | Bit 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 OUTMASK option. dev_num indicates a zero-based index that specifies the device.
COUNTERINFO | CTRNUM | Counter number associated with the given dev_num.
CTRTYPE | Counter 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. dev_num indicates a zero-based index that specifies the device.
EXPANSIONINFO | BOARDTYPE | Board type; refer to the Measurement Computing Device IDs topic.
MUXADCHAN1 | First A/D channel connected to the EXP board.
MUXADCHAN2 | Second A/D channel connected to the EXP board.
RANGE1 | Range (gain) of the low 16 channels.
RANGE2 | Range (gain) of the high 16 channels.
CJCCHAN | A/D channel connected to the CJC.
THERMTYPE | Sensor 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
NUMEXPCHANS | Number of channels on the expansion board. dev_num is ignored.
PARENTBOARD | Board number of the base A/D board. dev_num is ignored.

## Notes

- Use the BoardInfo.DACSTARTUP option to determine whether a board's DAC values before the last power down are stored.
- With ConfigItem set to BoardInfo.DACSTARTUP, this function returns 0 when the startup bit is disabled. Current DAC settings are stored as startup values.
- This function returns 1 when the startup bit is enabled. The last DAC values are stored as startup values.
- Use BoardInfo.DACUPDATEMODE option to check the update mode for a DAC board
- With config_item set to BoardInfo.DACUPDATEMODE, this function returns 0 when the DAC update mode is immediate. Values written with a_out() are automatically output by the DAC channels.
- This function returns 1 when the DAC update mode is set to on command. Values written with a_out() are not output by the DAC channels until a set_config() call is made with its config_item parameter set to BoardInfo.DACUPDATECMD
- Use the DigitalInfo.INMASK and DigitalInfo.OUTMASK options to determine if an AUXPORT is configurable. Execute get_config() twice to the same port - once using DigitalInfo.INMASK and once using DigitalInfo.OUTMASK. If the calls return input and output bits that overlap, the port is not configurable.
- You can determine overlapping bits by Anding both parameters.
- Example: for a device with seven bits of digital I/O (four outputs and three inputs), the result of DigitalInfo.INMASK is always 7 (0000 0111), while the result of DigitalInfo.OUTMASK is always 15 (0000 1111). When you AND both results together, you get a non-zero number (7). Any non-zero number indicates that input and output bits overlap for the specified port, and the port is a non-configurable AUXPORT.