set_config()

Changes board configuration options at runtime. 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

set_config(info_type, board_num, dev_num, config_item, config_val)

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

Specifies which configuration item you wish to set. Set it in conjunction with the info_type parameter using the config_item parameter values table.

config_item (BoardInfo, DigitalInfo, CounterInfo, or ExpansionInfo)

The value to set the specified configuration item to.

info_type parameter 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.

config_item parameter values

info_type config_itemDescription
GlobalInfoVERSIONcb.cfg file format; used by the library to determine compatibility.

dev_num is ignored.
NUMBOARDSMaximum number of boards that can be installed.

dev_num is ignored.
NUMEXPBOARDSMaximum number of expansion boards that can be installed.

dev_num is ignored.
BOARDINFOADCHANTYPEAnalog input channel type. Use this setting with devices that have configurable input types.

dev_num indicates the channel number.

Set config_val to one of the AiChanType enum values.
ADCSETTLETIMEADC settling time.

dev_num is ignored.

Set config_val to one of the SettleTime enum values.
ADDATARATEA/D data rate.

dev_num indicates the channel number.
ADTIMINGMODEADC timing mode.

dev_num is ignored.

Set config_val to one of the AdTimingMode enum values.
ADTRIGCOUNTADC trigger count.

dev_num is ignored.

For use with the a_in_scan RETRIGMODE option to set up repetitive trigger events
ADXFERMODEA/D trigger source.

dev_num indicates the channel number.

Set config_val to 0, 1, 2, or 3.
ADTRIGSRCSets the data transfer mode to either kernel mode (default) or user mode.

dev_num is ignored.

Set config_val to one of the XferMode enum values.
BASEADRBase address of the device.

dev_num is ignored.
CALTABLETYPECoefficients table used for calibration.

dev_num is ignored.

Set config_val to one of the CalTable enum values.
CALOUTPUTCal pin voltage on supported USB devices.

dev_num is ignored.
CHANRTDTYPERTD sensor type.

dev_num indicates the channel number.

Set config_val to one of the PlatinumRTDType enum values.
CHANTCTYPEThermocouple sensor type.

dev_num indicates the channel number.

dev_num indicates the channel number.

Set config_val to one of the TcType enum values.
CLOCKClock frequency in megahertz (MHz) (40, 10, 8, 6, 5, 4, 3, 2, 1) or 0 for not supported.

dev_num indicates the channel number.

Set config_val to one of the following values: 1, 4, 6 or 10.
CTRTRIGCOUNTNumber of counter samples to acquire per trigger.

dev_num is ignored.

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

dev_num indicates the channel number.

Set config_val to one of the State enum values.
DACRANGED/A range code.

dev_num indicates the channel number. Refer to board-specific information for a list of the supported ranges.
DACSETTLETIMEDAC settling time.

dev_num is ignored.
DACSTARTUPConfiguration register STARTUP bit setting.

dev_num 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.
DACTRIGCOUNTDAC trigger count.

dev_num is ignored.

For use with the a_out_scan()RETRIGMODE option to set up repetitive trigger events.
DACUPDATECMDUpdate mode for a digital-to-analog converter (DAC).

dev_num is ignored.
DACUPDATEMODEUpdate mode for a digital-to-analog converter (DAC).

dev_num is ignored.

Set config_val to one of the DACUpdate enum values.
DETECTOPENTCOpen thermocouple detection setting.

dev_num is either ignored or specifies a base or expansion board; refer to device-specific information.

Set config_val to one of the State enum values.
DIDEBOUNCESTATEState of the digital inputs when debounce timing is set.

dev_num is ignored.
DIDEBOUNCESTATEState of the digital inputs when debounce timing is set.

dev_num is ignored.
DISOFILTERAC filter setting. 0 = disable, 1 = enable.

dev_num is the bit number.

Set config_val to one of the State enum values.
DITRIGCOUNTNumber of digital input samples to acquire per trigger.

dev_num is ignored.
DMACHANDMA channel.

dev_num is ignored.
DOTRIGCOUNTNumber of digital output samples to generate per trigger.

dev_num is ignored.
EXTCLKTYPEExternal clock type.

dev_num is ignored.

Set config_val to one of the ExtClockType enum values.
EXTINPACEREDGEThe input pacer clock edge.

dev_num is ignored.

Set config_val to one of the ExtPacerEdgeType enum values.
EXTOUTPACEREDGEThe output pacer clock edge.

dev_num is ignored.

Set config_val to one of the ExtPacerEdgeType enum values.
INPUTPACEROUTInput pacer clock state.

dev_num is ignored.

Set config_val to one of the State enum values. When enabled, the input clock is set for output.
INTEDGEInterrupt edge. 0 = rising, 1 = falling.

dev_num is ignored.
INTLEVELInterrupt level.

dev_num is ignored.
HIDELOGINDLGEnables or disables the Device Login dialog.

dev_num is ignored.

Set config_val to one of the State enum values. When disabled, the device_login() function must be used to log in to a device session.
NETCONNECTCODECode used to connect with a device over a network connection.

dev_num is ignored.
NETIOTIMEOUTAmount 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 then a timeout occurs.

dev_num is ignored.
NUMADCHANSNumber of A/D channels

dev_num is ignored.
OUTPUTPACEROUTEnables or disables the output pacer clock signal. When enabled, the output clock is set for output.
PANIDPersonal Area Network (PAN) identifier for a USB device that supports wireless communication.

dev_num is ignored.
PATTERNTRIGPORTPattern trigger port.

dev_num is ignored.

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

dev_num is ignored.
RFCHANNELRF channel number used to transmit/receive data by a USB device that supports wireless communication.

dev_num is ignored.
RSSReceived signal strength in dBm of a remote device.

dev_num is ignored.
SERIALNUMUser-configured identifier of a supported USB device.

dev_num is ignored.
SYNCMODESimultaneous mode setting.

dev_num is ignored.

Set config_val to either 0 (master) or 1 (slave).
TEMPAVGNumber of temperature samples per average. Set config_val to one of the following values:
  • 1 to 16384 (if the TEMPREJFREQ rejection frequency is off (0)
  • 16 to 16384 (if the TEMPREJFREQ rejection frequency is on (50 or 60)
When specified, multiple readings are acquired, averaged, and converted to temperature.
TEMPSCALETemperature scale.

dev_num is ignored.

Set config_val to one of the following values:
  • CELCIUS
  • FAHRENHEIT
  • KELVIN
TEMPREJFREQRejection frequency. Use this setting in conjunction with these settings:
dev_num:
  • 0 (base board)
  • 1 (expansion board)
config_val:
  • 0 (off)
  • 50 (50 Hz noise rejection)
  • 60 (60 Hz noise rejection)
TERMCOUNTSTATBITTerminal count output status.

dev_num indicates the bit number.

Set config_val to one of the State enum values.
WAITSTATEWait State jumper setting.

dev_num is ignored.

Set config_val to one of the State enum values.
DIGITALINFODISABLEDIRCHECKThe direction check setting for a specified port or bit when calling d_out(), d_bit_out(), and d_out_array().

Set config_val to one of the following values:
  • 0 (enables the direction check)
  • 1 (disables the direction check)
EXPANSIONINFOMUXADCHAN1First A/D channel connected to the EXP board.
MUXADCHAN2Second A/D channel connected to the EXP board.
RANGE1Range (gain) of the low 16 channels.
RANGE2Range (gain) of the high 16 channels.
CJCCHANA/D channel connected to the CJC.
THERMTYPEThermocouple type.