xPCI-3200 API
xPCI-3200 Scan functions

Functions

_INT_ i_PCI3200_InitScanModuleAcquisitionSensor (HANDLE h_DeviceHandle, BYTE b_ModuleIndex, BYTE b_SensorType, BYTE b_SensorModel[4], BYTE b_ConnectionType, DOUBLE d_RtdResistance[2])
 
_INT_ i_PCI3200_InitScanModuleAcquisition (HANDLE h_DeviceHandle, BYTE b_ModuleIndex, DWORD dw_ConversionFrequency, BYTE b_DelayMode, DWORD dw_DelayTime, BYTE b_DelayUnit, BYTE b_AcquisitionMode, BYTE b_ExtTriggerMode)
 
_INT_ i_PCI3200_StartScanModuleAcquisition (HANDLE h_DeviceHandle, BYTE b_ModuleIndex)
 
_INT_ i_PCI3200_StopScanModuleAcquisition (HANDLE h_DeviceHandle, BYTE b_ModuleIndex)
 
_INT_ i_PCI3200_ReleaseScanModuleAcquisition (HANDLE h_DeviceHandle, UCHAR b_ModuleIndex)
 

Detailed Description

Function Documentation

_INT_ i_PCI3200_InitScanModuleAcquisitionSensor ( HANDLE  h_DeviceHandle,
BYTE  b_ModuleIndex,
BYTE  b_SensorType,
BYTE  b_SensorModel[4],
BYTE  b_ConnectionType,
DOUBLE  d_RtdResistance[2] 
)

Initialize the sensor connected to a analog-input module of the board.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleIndexIndex of the module (0-3)
[in]b_SensorTypeThe type of the sensor connected (ADDIDATA_THERMOCOUPLE for TC sensors, ADDIDATA_RTD for RTD sensors)
[in]b_SensorModelA array that contains the model of the sensors that are connected.
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]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]d_RtdResistanceA array that contains the resistance R0 of the RTD sensors. Only fill this array if you use RTD sensors.
R0 is the resistance of your sensor for a temperature of 0 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: One of the sensor model in b_SensorModel is wrong (not in the TC sensors model list)
-6: b_SensorType is set to ADDIDATA_RTD, but the connection type is not set to APCI3200_CONNECTION_TYPE_DIFFERENTIAL
-7: One of the sensor model in b_SensorModel is wrong (not in the RTD sensors model list)
-8: Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI3200_InitScanModuleAcquisition ( HANDLE  h_DeviceHandle,
BYTE  b_ModuleIndex,
DWORD  dw_ConversionFrequency,
BYTE  b_DelayMode,
DWORD  dw_DelayTime,
BYTE  b_DelayUnit,
BYTE  b_AcquisitionMode,
BYTE  b_ExtTriggerMode 
)

Initialize the selected analog-input module for a scan acquisition. Before calling this function, you must call i_PCI3200_InitScanModuleAcquisitionSensor function.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleIndexIndex of the module (0-3)
[in]dw_ConversionFrequencyThe frequency of conversion (20Hz, 40Hz, 80Hz or 160Hz)
[in]b_DelayModeSpecify if you want to use a delay (APCI3200_DELAY_NOT_USED or APCI3200_DELAY_MODE1_USED)
[in]dw_DelayTimeThe delay time value. It is the time between two scan acquisition (the acquisition time is included). (0-1023)
[in]b_DelayUnitThe unit of dw_DelayTime (APCI3200_UNIT_MS or APCI3200_UNIT_S)
[in]b_AcquisitionModeSpecify if you want to use continuous acquisition or not (APCI3200_SINGLE_SCAN or APCI3200_CONTINUOUS_SCAN)
[in]b_ExtTriggerModeSpecify if you want to use an external trigger (digital input) or not.
  • APCI3200_DISABLE: do not use external trigger
  • APCI3200_FIRST_LOW_EDGE_START_ALL_SCAN: when detecting a falling edge, the acquisition is started
  • APCI3200_FIRST_HIGH_EDGE_START_ALL_SCAN: when detecting a rising edge, the acquisition is started
  • APCI3200_FIRST_EDGE_START_ALL_SCAN: when detecting a falling or a rising edge, the acquisition is started
Return values
0: No error
-1: The h_DeviceHandle parameter is wrong
-2: The b_ModuleIndex parameter is wrong
-3: The dw_ConversionFrequency parameter is wrong
-4: The b_DelayMode parameter is wrong
-5: The b_DelayUnit parameter is wrong
-6: The dw_DelayTime parameter is wrong
-7: The b_AcquisitionMode parameter is wrong
-8: The b_ExtTriggerMode parameter is wrong
-9: The sensors of the module were not initialized. Call i_PCI3200_InitScanModuleAcquisitionSensor before calling this function
-10: Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI3200_StartScanModuleAcquisition ( HANDLE  h_DeviceHandle,
BYTE  b_ModuleIndex 
)

Start a scan acquisition on the selected analog-input module.
Once the acquisition is started, you will receive the values measured by the board with your interrupt routine callback. Before calling this function, you must call the function i_PCI3200_InitScanModuleAcquisition. You must also install an interrupt routine.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleIndexIndex of the module (0-3)
Return values
0: No error
-1: The h_DeviceHandle parameter is wrong
-2: The b_ModuleIndex parameter is wrong
-3: No interrupt routine installed. Call the function i_PCI3200_SetBoardIntRoutine before calling this function
-4: The module was not initialized. Call the function i_PCI3200_InitScanModuleAcquisition before calling this function
-5: A scan acquisition is still started on this module. Stop it before trying to start it.
-6: Error while calling IOCTL function (wrong handle ?)
_INT_ i_PCI3200_StopScanModuleAcquisition ( HANDLE  h_DeviceHandle,
BYTE  b_ModuleIndex 
)

Stop a scan acquisition on the selected analog-input module.

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleIndexIndex of the module (0-3)
Return values
0: No error
-1The h_DeviceHandle parameter is wrong
-2The b_ModuleIndex parameter is wrong
-3Error while calling IOCTL function (wrong handle ?)
-4The module is not initialized for scan
-5The scan is not started on this module
-6Failed to stop scan on this module
_INT_ i_PCI3200_ReleaseScanModuleAcquisition ( HANDLE  h_DeviceHandle,
UCHAR  b_ModuleIndex 
)

Reset scan on the selected module

Parameters
[in]h_DeviceHandleHandle of the board
[in]b_ModuleIndexIndex of the module (0 to numberOfModules)
Return values
0: No error
-1The h_DeviceHandle parameter is wrong
-2the b_ModuleIndex parameter is wrong
-3the scan is started on this module call i_PCI3200_StopScanModuleAcquisition before.
-4Error while calling IOCTL function (wrong handle ?)