xPCI-3001 API
|
Functions | |
_INT_ | i_PCI3001_SetAnalogInputMode (HANDLE h_DeviceHandle, BYTE b_InputMode) |
_INT_ | i_PCI3001_GetAnalogInputMode (HANDLE h_DeviceHandle, PBYTE pb_InputMode) |
_INT_ | i_PCI3001_Read1AnalogInput (HANDLE h_DeviceHandle, BYTE b_Channel, BYTE b_Gain, BYTE b_Polarity, WORD w_ConvertingTime, BYTE b_InterruptFlag, PWORD pw_ChannelValue) |
_INT_ | i_PCI3001_ReadMoreAnalogInputs (HANDLE h_DeviceHandle, BYTE b_ChannelCount, PBYTE pb_Channel, PBYTE pb_Gain, PBYTE pb_Polarity, WORD w_ConvertingTime, BYTE b_InterruptFlag, PWORD pw_ChannelValue) |
_INT_ | i_PCI3001_InitAndStartAnalogInputSequence (HANDLE h_DeviceHandle, DWORD dw_SequenceCount, DWORD dw_SequenceBeforeInterrupt, BYTE b_ChannelCount, PBYTE pb_Channel, PBYTE pb_Gain, PBYTE pb_Polarity, WORD w_ConvertingTime, BYTE b_DelayMode, DWORD dw_DelayTime, BYTE b_ExtTriggerMode) |
_INT_ | i_PCI3001_StopAnalogAcquisition (HANDLE h_DeviceHandle) |
_LONG_ | l_PCI3001_ReadSequenceData (HANDLE deviceHandle, DWORD size, PVOID data) |
_INT_ i_PCI3001_SetAnalogInputMode | ( | HANDLE | h_DeviceHandle, |
BYTE | b_InputMode | ||
) |
Set analog input mode to single-ended or differential input
The input mode has to be set at least once before any call to an analog input function.
Once set, the configuration will last until the program ends, or another mode is set.
In single-ended mode, 16 analog inputs are available.
In differential mode, there are only 8 analog inputs available.
Please refer to the manual for further information.
[in] | h_DeviceHandle | Handle of the board |
[in] | b_InputMode | Input mode (PCI3001_INPUT_MODE_SINGLE_ENDED or PCI3001_INPUT_MODE_DIFFERENTIAL) |
_INT_ i_PCI3001_GetAnalogInputMode | ( | HANDLE | h_DeviceHandle, |
PBYTE | pb_InputMode | ||
) |
Get analog input mode (single-ended or differential input)
In single-ended mode, 16 analog inputs are available.
In differential mode, there are only 8 analog inputs available.
Please refer to the manual for further information.
[in] | h_DeviceHandle | Handle of the board |
[out] | pb_InputMode | Input mode (PCI3001_INPUT_MODE_UNDEFINED, PCI3001_INPUT_MODE_SINGLE_ENDED or PCI3001_INPUT_MODE_DIFFERENTIAL) |
_INT_ i_PCI3001_Read1AnalogInput | ( | HANDLE | h_DeviceHandle, |
BYTE | b_Channel, | ||
BYTE | b_Gain, | ||
BYTE | b_Polarity, | ||
WORD | w_ConvertingTime, | ||
BYTE | b_InterruptFlag, | ||
PWORD | pw_ChannelValue | ||
) |
Reads the current value of the analog input channel b_Channel with a gain b_Gain, in the input voltage range b_Polarity and a conversion time w_ConvertingTime
[in] | h_DeviceHandle | Handle of the board |
[in] | b_Channel | Channel to read (Single-ended : 0 to 15, differential : 0-7) |
[in] | b_Gain | Input gain. Adjusts the input voltage to be in the converter's range (-10V to 10V) and get the best resolution. Gain acts like a multiplying coefficient, so a value of 2 will double the input voltage before it goes through the converter. For example, if the input voltage is between 0V and 2V, a gain value of 5 should be used. Possible values are PCI3001_GAIN_1, PCI3001_GAIN_2, PCI3001_GAIN_5 and PCI3001_GAIN_10 |
[in] | b_Polarity | Selection of the input voltage range.
|
[in] | w_ConvertingTime | Selection of the conversion time, from 10 to 32767us. |
[in] | b_InterruptFlag | Wether an interrupt is generated at EOS (End Of Sequence) or not |
[out] | pw_ChannelValue | The raw analog value (0x0000 to 0x0FFF) (12 bits) |
_INT_ i_PCI3001_ReadMoreAnalogInputs | ( | HANDLE | h_DeviceHandle, |
BYTE | b_ChannelCount, | ||
PBYTE | pb_Channel, | ||
PBYTE | pb_Gain, | ||
PBYTE | pb_Polarity, | ||
WORD | w_ConvertingTime, | ||
BYTE | b_InterruptFlag, | ||
PWORD | pw_ChannelValue | ||
) |
Reads several analog input channels
The priority of the analog input channels is set with the scan list
The scan list allows to determine the input voltage range and the gain for each analog input channel
The gain is defined with parameter pb_Gain for each analog input channel
The input voltage range is defined with parameter pb_Polarity for each analog input channel
[in] | h_DeviceHandle | Handle of the board |
[in] | b_ChannelCount | Number of acquisitions in the sequence (1 to 16) |
[in] | pb_Channel | Array of the channels to read |
[in] | pb_Gain | Array of gain for each channel (see i_PCI3001_Read1AnalogInput) |
[in] | pb_Polarity | Array of input voltage range for each channel (see i_PCI3001_Read1AnalogInput) |
[in] | w_ConvertingTime | Selection of the conversion time, from 10us to 32767us. |
[in] | b_InterruptFlag | Wether an interrupt is generated at EOS (End Of Sequence) or not. Read values are available in the interrupt callback function |
[out] | pw_ChannelValue | Raw output values (0x0 to 0x0FFF) (12 bits) |
_INT_ i_PCI3001_InitAndStartAnalogInputSequence | ( | HANDLE | h_DeviceHandle, |
DWORD | dw_SequenceCount, | ||
DWORD | dw_SequenceBeforeInterrupt, | ||
BYTE | b_ChannelCount, | ||
PBYTE | pb_Channel, | ||
PBYTE | pb_Gain, | ||
PBYTE | pb_Polarity, | ||
WORD | w_ConvertingTime, | ||
BYTE | b_DelayMode, | ||
DWORD | dw_DelayTime, | ||
BYTE | b_ExtTriggerMode | ||
) |
This function initializes a sequence acquisition
Thanks to a sequence acquisition, you can get analog values from the board very fastely (or slowly if you want)
After having initialized the sequence, to get the data you will have to wait an interrupt, and then read the data from the board.
You may have a look on the sample available with this DLL, that will explain you how to do.
[in] | h_DeviceHandle | Handle of the board |
[in] | dw_SequenceCount | The total number of sequence to acquire. Set it to 0 if you want to use continuous acquisition (i.e. infinite acquisition) |
[in] | dw_SequenceBeforeInterrupt | Specify the number of sequence to wait before generating an interruption. For high frequency, set a high number (512 if using maximum frequency for example). |
[in] | b_ChannelCount | The number of channels in one sequence. Rule: (b_ChannelCount * dw_SequenceBeforeInterrupt) must be a multiple of 2 |
[in] | pb_Channel | Array of the channels to read (see i_PCI3001_Read1AnalogInput) |
[in] | pb_Gain | Array of gain for each channels (see i_PCI3001_Read1AnalogInput) |
[in] | pb_Polarity | Array of polarity for each channels (see i_PCI3001_Read1AnalogInput) |
[in] | w_ConvertingTime | Time interval in us between 2 conversions of successive input channels (from 10 us to 32767 us). |
[in] | b_DelayMode | Specifiy the type of delay to use between two acquisitions of a sequence
|
[in] | dw_DelayTime | Waiting time in us between two conversion cycles (from 100 us to 3276850 us) This parameter is only relevant if APCI3001_DELAY_MODUS or APCI3001_DELAY_1_MODUS are used This parameter must be a multiple of 50 |
[in] | b_ExtTriggerMode | Two modes are possible :
|
_INT_ i_PCI3001_StopAnalogAcquisition | ( | HANDLE | h_DeviceHandle | ) |
Stops any analog acquisition
[in] | h_DeviceHandle | Handle of the board |
_LONG_ l_PCI3001_ReadSequenceData | ( | HANDLE | deviceHandle, |
DWORD | size, | ||
PVOID | data | ||
) |
Enables to read data acquired by a sequence acquisition.
This function can be called in the interrupt routine that you registered. (see samples)
deviceHandle | handle to the board |
size | size of data to read. To be powerfull, should be ( sequence size * sequence before interrupt ) * sizeof ( USHORT ) |
data | Pointer that will be fill with the data of the board |