User manual

Table Of Contents
DELIB API reference |
Seite 113
4.3.7. DapiDIGetCounter
Description
This command reads the counter of a digital input
Definition
ULONG DapiDIGetCounter(handle, ch, par1);
Parameters
handle=This is the handle of an opened module.
ch=Specifies the digital input, from which the counter will be read
par1=0 (Normal counter function)
par1=DAPI_CNT_MODE_READ_WITH_RESET (Reading and resetting the
counter)
Return value
Value of the counter.
Example program
value = DapiDIGetCounter(handle, 0 ,0);
// Reading counter of DI Chan 0
value = DapiDIGetCounter(handle, 1 ,0);
// Reading counter of DI Chan 1
value = DapiDIGetCounter(handle, 8 ,0);
// Reading counter of DI Chan 8
value = DapiDIGetCounter(handle, 0 ,DAPI_CNT_MODE_READ_WITH_RESET);
// Reading AND resetting counter of DI Chan 0