DRV_CounterConfig

INT32S DRV_CounterConfig (
   PTR_T DeviceHandle,
   PT_CounterConfig *lpCounterConfig );

Purpose

This function can be used in PCI-1780/MIC3780/PCM3780/MIC3756 only.

On the device indicated by the DeviceHandle, it configures a specified channel and its necessary parameters for output mode. This function must be called before calling the DRV_CounterEventStart.

Parameters

Some parameters, such as target counter channel (usCounter), initial counter value (usInitValue), count direction (usCountDirect), output mode (usOutputMode), gate source(usGateSrc) and gate polarity (usGatePolarity), are stored in the PT_CounterConfig, structure pointed by the lpCounterConfig.

Name Direction Range Description
DeviceHandle input default The pointer retrieved from DRV_DeviceOpen which specifies the target device.
lpCounterConfig input default The pointer to indicate the user-prepared structure PT_CounterConfig that stores target counter channel (INT16U usCounter), initial counter value (INT16U usInitValue), counter mode (INT16U usCountMode), etc.

Return

   1. 0 Successful.
   2. InvalidDeviceHandle The Devicehandle is NULL.
   3. InvalidChannel The target channel (usCounter of lpCounterConfig ) is out of range.
   5. InvalidInputParam The initial value (usInitValue of lpCounterConfig) is wrong, i.e. usInitValue is not within the range that the counter supports.