xPCI-3200 API
xPCI-3200 Temperature function

Functions

_INT_ i_PCI3200_Read1Temperature (HANDLE h_DeviceHandle, BYTE b_ModuleIndex, BYTE b_ChannelIndex, BYTE b_SensorType, BYTE b_SensorModel, DOUBLE d_RtdResistance, BYTE b_Gain, BYTE b_ConnectionType, DWORD dw_ConversionFrequency, DOUBLE *pd_TemperatureValue)
 
_INT_ i_PCI3200_ReadMoreTemperature (HANDLE h_DeviceHandle, DWORD dw_ConnectionType[4], DWORD dw_ChannelMask[4], DWORD dw_SensorType[4], DWORD dw_SensorModel[4], DOUBLE d_RtdResistance[8], DWORD dw_Gain[4], DWORD dw_ConversionFrequency, DWORD dw_Interrupt, DWORD dw_Trigger, DOUBLE *pd_TemperatureValues)
 
_INT_ i_PCI3200_ReadMoreTemperatureTrigger (HANDLE h_DeviceHandle, DOUBLE *pd_TemperatureValue)
 
_INT_ i_PCI3200_ReadMoreTemperatureTriggerRelease (HANDLE h_DeviceHandle)
 

Detailed Description

Function Documentation

_INT_ i_PCI3200_Read1Temperature ( HANDLE  h_DeviceHandle,
BYTE  b_ModuleIndex,
BYTE  b_ChannelIndex,
BYTE  b_SensorType,
BYTE  b_SensorModel,
DOUBLE  d_RtdResistance,
BYTE  b_Gain,
BYTE  b_ConnectionType,
DWORD  dw_ConversionFrequency,
DOUBLE *  pd_TemperatureValue 
)

Read the temperature of a connected sensor.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleIndexIndex of the module (0-3)
[in]b_ChannelIndexIndex of the channel (0-3) If b_ConnectionType is set to differential, then the value must be 0 or 1 (only 2 channels)
[in]b_SensorTypeThe type of the sensor connected (ADDIDATA_THERMOCOUPLE for TC sensors, ADDIDATA_RTD for RTD sensors)
[in]b_SensorModelThe model of the sensor.
If b_SensorType is ADDIDATA_THERMOCOUPLE :
  • ADDIDATA_THERMOCOUPLE_TYPE_B
  • ADDIDATA_THERMOCOUPLE_TYPE_E
  • ADDIDATA_THERMOCOUPLE_TYPE_J
  • ADDIDATA_THERMOCOUPLE_TYPE_K
  • ADDIDATA_THERMOCOUPLE_TYPE_N
  • ADDIDATA_THERMOCOUPLE_TYPE_R
  • ADDIDATA_THERMOCOUPLE_TYPE_S
  • ADDIDATA_THERMOCOUPLE_TYPE_T
If b_SensorType is ADDIDATA_RTD :
  • ADDIDATA_RTD_TYPE_PT
  • ADDIDATA_RTD_TYPE_Ni
[in]d_RtdResistanceThe resistance R0 of the RTD sensor. Set it to 0 if you do not use RTD sensor.
R0 is the resistance of your sensor for a temperature of 0 Celcius
[in]b_GainThe gain you want to use.
  • - 0: x1
  • - 1: x2
  • - 2: x4
  • - 3: x8
  • - 4: x16
  • - 5: x32
  • - 6: x64
  • - 7: x128
[in]b_ConnectionTypeThe type of the connection that is used (APCI3200_CONNECTION_TYPE_SINGLE for single-ended, and APCI3200_CONNECTION_TYPE_DIFFERENTIAL for differential)
If b_SensorType is RTD, b_ConnectionType must be set to APCI3200_CONNECTION_TYPE_DIFFERENTIAL
[in]dw_ConversionFrequencyThe frequency of conversion (20Hz, 40Hz, 80Hz or 160Hz)
[out]pd_TemperatureValueA pointer on a value that will be filled with the measured temperature (in Celcius)
Return values
0: No error
-1: The h_DeviceHandle parameter is wrong
-2: The b_ModuleIndex parameter is wrong
-3: The b_SensorType parameter is wrong
-4: The b_ConnectionType parameter is wrong
-5: b_SensorType is set to ADDIDATA_RTD, but the connection type is not set to APCI3200_CONNECTION_TYPE_DIFFERENTIAL
-6: The b_ChannelIndex parameter is wrong
-7: The dw_ConversionFrequency parameter is wrong
-8: The b_Gain parameter is wrong
-9: Error while calling IOCTL function (wrong handle ?)
-10: Error while reading the calibration gain value
-11: Error while reading the calibration offset value
-12: Error while reading the calibration values of the channel
-13: Error while reading the CJC value
-14: Error while reading the CJC gain value
-15: Error while reading the CJC offset value
-16: Error while computing the temperature of the CJC
-17: Error while computing the TC-X value of the CJC
-18: Error while computing the temperature -19 : Sensor model is wrong
-20: Error while computing the RTD temperature
-30: The b_SensorType parameter is wrong
-100Failed to read Eeprom
_INT_ i_PCI3200_ReadMoreTemperature ( HANDLE  h_DeviceHandle,
DWORD  dw_ConnectionType[4],
DWORD  dw_ChannelMask[4],
DWORD  dw_SensorType[4],
DWORD  dw_SensorModel[4],
DOUBLE  d_RtdResistance[8],
DWORD  dw_Gain[4],
DWORD  dw_ConversionFrequency,
DWORD  dw_Interrupt,
DWORD  dw_Trigger,
DOUBLE *  pd_TemperatureValues 
)

Read more temperature function allows to read several channels of the board.

Parameters
[in]h_DeviceHandleHandle of the board
[in]dw_ConnectionTypeConnectionType for each module to read (if module not used, don't have to be set)
  • dw_ConnectionType[0] (module 0)
    • APCI3200_CONNECTION_TYPE_SINGLE
    • APCI3200_CONNECTION_TYPE_DIFFERENTIAL
  • dw_ConnectionType[1] (module 1)
    • APCI3200_CONNECTION_TYPE_SINGLE
    • APCI3200_CONNECTION_TYPE_DIFFERENTIAL
  • dw_ConnectionType[2] (module 2)
    • APCI3200_CONNECTION_TYPE_SINGLE
    • APCI3200_CONNECTION_TYPE_DIFFERENTIAL
  • dw_ConnectionType[3] (module 3)
    • APCI3200_CONNECTION_TYPE_SINGLE
    • APCI3200_CONNECTION_TYPE_DIFFERENTIAL
[in]dw_ChannelMaskChannel mask for one module. (Example dw_ChannelMask[0] = 0x4 to read module 0 channel 2)
  • dw_ChannelMask[0] (module 0)
    • Bit 0: Channel 0
    • Bit 1: Channel 1
    • Bit 2: Channel 2 (only if b_ConnectionType[0] = APCI3200_CONNECTION_TYPE_SINGLE)
    • Bit 3: Channel 3 (only if b_ConnectionType[0] = APCI3200_CONNECTION_TYPE_SINGLE)
  • dw_ChannelMask[1] (module 1)
    • Bit 0: Channel 0
    • Bit 1: Channel 1
    • Bit 2: Channel 2 (only if b_ConnectionType[1] = APCI3200_CONNECTION_TYPE_SINGLE)
    • Bit 3: Channel 3 (only if b_ConnectionType[1] = APCI3200_CONNECTION_TYPE_SINGLE)
  • dw_ChannelMask[2] (module 2) only if APCI3200-16
    • Bit 0: Channel 0
    • Bit 1: Channel 1
    • Bit 2: Channel 2 (only if b_ConnectionType[2] = APCI3200_CONNECTION_TYPE_SINGLE)
    • Bit 3: Channel 3 (only if b_ConnectionType[2] = APCI3200_CONNECTION_TYPE_SINGLE)
  • dw_ChannelMask[3] (module 3) only if APCI3200-16
    • Bit 0: Channel 0
    • Bit 1: Channel 1
    • Bit 2: Channel 2 (only if b_ConnectionType[3] = APCI3200_CONNECTION_TYPE_SINGLE)
    • Bit 3: Channel 3 (only if b_ConnectionType[3] = APCI3200_CONNECTION_TYPE_SINGLE)
[in]dw_SensorTypeThe type of the sensor connected for each channel to read
  • dw_SensorType[0] (module 0)
    • Bit 0..7: Channel 0 configuration
      • ADDIDATA_THERMOCOUPLE for TC sensors
      • ADDIDATA_RTD for RTD sensors
    • Bit 8..15: Channel 1 configuration
      • ADDIDATA_THERMOCOUPLE for TC sensors
      • ADDIDATA_RTD for RTD sensors
    • Bit 16..23: Channel 2 configuration (only if b_ConnectionType[0] = APCI3200_CONNECTION_TYPE_SINGLE)
      • ADDIDATA_THERMOCOUPLE for TC sensors
      • ADDIDATA_RTD for RTD sensors
    • Bit 24..31: Channel 3 configuration (only if b_ConnectionType[0] = APCI3200_CONNECTION_TYPE_SINGLE)
      • ADDIDATA_THERMOCOUPLE for TC sensors
      • ADDIDATA_RTD for RTD sensors
  • dw_SensorType[1] (module 1) ...
[in]dw_SensorModelThe model of the sensor
  • dw_SensorModel[0] (module 0)
    • Bit 0..7 channel 0 configuration
      • If b_SensorType is ADDIDATA_THERMOCOUPLE :
        • ADDIDATA_THERMOCOUPLE_TYPE_B
        • ADDIDATA_THERMOCOUPLE_TYPE_E
        • ADDIDATA_THERMOCOUPLE_TYPE_J
        • ADDIDATA_THERMOCOUPLE_TYPE_K
        • ADDIDATA_THERMOCOUPLE_TYPE_N
        • ADDIDATA_THERMOCOUPLE_TYPE_R
        • ADDIDATA_THERMOCOUPLE_TYPE_S
        • ADDIDATA_THERMOCOUPLE_TYPE_T
      • If b_SensorType is ADDIDATA_RTD :
        • ADDIDATA_RTD_TYPE_PT
        • ADDIDATA_RTD_TYPE_Ni
    • Bit 8..15 channel 1 configuration...
    • Bit 16..23 channel 2 configuration (only if b_ConnectionType[0] = APCI3200_CONNECTION_TYPE_SINGLE...
    • Bit 24..31 channel 3 configuration (only if b_ConnectionType[0] = APCI3200_CONNECTION_TYPE_SINGLE...
  • dw_SensorModel[1] (module 1)...
[in]d_RtdResistanceThe resistance R0 of the RTD sensor. Set it to 0 if you do not use RTD sensor.
[in]dw_GainGain for each channel by module
  • dw_Gain[0] (module 0)
    • Bit 0..7: Gain channel 0
      • - 0: x1
      • - 1: x2
      • - 2: x4
      • - 3: x8
      • - 4: x16
      • - 5: x32
      • - 6: x64
      • - 7: x128
    • Bit 8..15: Gain channel 1
      • - 0: x1
      • - 1: x2
      • - 2: x4
      • - 3: x8
      • - 4: x16
      • - 5: x32
      • - 6: x64
      • - 7: x128
    • Bit 16..23: Gain channel 2 (only if b_ConnectionType[0] = APCI3200_CONNECTION_TYPE_SINGLE)
    • Bit 24..31: Gain channel 3 (only if b_ConnectionType[0] = APCI3200_CONNECTION_TYPE_SINGLE)
  • dw_Gain[1] (module 1)...
  • dw_Gain[2] (module 2)...
  • dw_Gain[3] (module 3)...
[in]dw_ConversionFrequencyConversion frequency for each channels
  • 20: 20 Hz
  • 40: 40 Hz
  • 80: 80 Hz
  • 160: 160 Hz
[in]dw_TriggerEnable / Disable software trigger
  • 0: Software trigger not used
  • 1: Use software trigger (Use i_PCI3200_ReadTemperatureTrigger and i_PCI3200_ReadTemperatureTriggerRelease functions)
[in]dw_InterruptEnable / Disable interrupt
  • 0: Disable interrupt (data stored in pd_TemperatureValues)
  • 1: Enable interrupt (no data in pd_TemperatureValues)
[in]pd_TemperatureValuesTable with all temperature values in module and channel order. This table depends on dw_ChannelMask parameter
  • Example dw_ChannelMask[0] = 0x4, dw_ChannelMask[2] = 0x2, other dw_ChannelMask = 0
    -> pd_TemperatureValues[0] = module 0 channel 2
    -> pd_TemperatureValues[1] = module 2 channel 0
    -> pd_TemperatureValues[2] = module 2 channel 1
Return values
-1: The h_DeviceHandle parameter is wrong
-2: The dw_ConversionFrequency parameter is wrong
-3: The dw_Interrupt parameter is wrong
-4: The dw_Trigger parameter is wrong
-5: The dw_ConnectionType parameter is wrong
-6: One module is already initialized for read more
-7: One module is already initialized for scan
-8: The dw_ChannelMask parameter is wrong
-9: The dw_SensorType parameter is wrong
-10The dw_Gain parameter is wrong
-11The dw_ChannelMask cannot be equal to 0
-12Failed to get board value
-13Error while calling IOCTL function (wrong handle ?)
-14Interrupt routine is not set
-100Failed to read Eeprom
_INT_ i_PCI3200_ReadMoreTemperatureTrigger ( HANDLE  h_DeviceHandle,
DOUBLE *  pd_TemperatureValue 
)

Allows to run the last read more acquisition without reading all parameters again, only channels values are read again. In i_PCI3200_ReadMoreTemperature function dw_Trigger parameter must be set to 1 in order to use this function.

Parameters
[in]h_DeviceHandleHandle of the board
[out]pd_TemperatureValueTemperature values corresponding to dw_ChannelMask from i_PCI3200_ReadMoreTemperature function
Return values
-1: The h_DeviceHandle parameter is wrong
-2: Error while calling IOCTL function (wrong handle ?)
-3: Trigger was not activated in i_PCI3200_ReadMoreTemperature function
-4: An acquisition is already running
_INT_ i_PCI3200_ReadMoreTemperatureTriggerRelease ( HANDLE  h_DeviceHandle)

Release the acquisition started by i_PCI3200_ReadMoreTemperature function with trigger selected

In i_PCI3200_ReadMoreTemperature function dw_Trigger parameter must be set to 1 in order to use this function.

Parameters
[in]h_DeviceHandleHandle of the board
Return values
-1: The h_DeviceHandle parameter is wrong
-2: Error while calling IOCTL function (wrong handle ?)
-3: Trigger was not activated in i_PCI3200_ReadMoreTemperature function