Event Counting Function

General Counter (Intel 8254 or AMD 9513A)

The DRV_CounterEventStart function starts the counter operation. When the counter is running, you can use the DRV_CounterEventRead function to read the count value repeatedly. Call the DRV_CounterReset function to stop the counter operation when it is complete.

For PCI1780/MIC3780/PCM3780/MIC3756, DRV_CounterConfig function must be called first to configure the settings, or else if DRV_CounterEventStart function is called directly, the default counting mode will be used:

For PCI1780/MIC3780/PCM3780, counting mode D (refer to hardware manuals) is used;

For MIC3756, No Gate is used. DO00 is used as the stop counting output mode.

Notice:

Intel 8254 and AMD Am9513A are commonly used chips in Advantech DA&C cards. Both are 16-bit and can be extended as a 32-bit counter by the driver  that is, it counts up to 232-1.