DRV_CounterEventStart

INT32S DRV_CounterEventStart (
   PTR_T DeviceHandle,
   PT_CounterEvenStart *lpCounterEventStart );

Purpose

On the device indicated by the DeviceHandle, it configures the specified counter for event-counting and starts the operation. The DRV_CounterEventRead can be used to read the count value and the status after initialization.

As for PCI1780/MIC3780/PCM3780/MIC3756, the DRV_CounterConfig must be called first to configure functions before initializing the operation with the DRV_CounterEventStart.

By calling the DRV_CounterEventStart directly, the default counting mode is as follows:
For PCI1780/MIC3780, counting mode D is used; for MIC3756, there is no gate control and DO00 is used to stop the counting.

Parameters

Some parameters, such as target counter channel (counter) and gate mode (GateMode), are stored in the PT_CounterEventStart structure pointed by the lpCounterEventStart.

Name Direction Range Description
DeviceHandle input default The pointer retrieved from DRV_DeviceOpen which specifies the target device.
lpCounterEventStart input default The pointer to indicate the user-prepared structure PT_CounterEventStart that stores target counter channel (INT16U counter) and gate mode (INT16U GateMode).

Return

   1. SUCCESS Successful.
   2. InvalidDeviceHandle the DeviceHandle is NULL.
   3. InvalidChannel The target channel (usCounter of lpCounterConfig ) is out of range.
   4. Other value Please reference ErrorCodes.