DapiDIGetCounter
Description
This command reads the counter of a digital input.
Definition
ULONG DapiDIGetCounter(ULONG handle, ULONG ch, ULONG mode);
Parameters
handle=This is the handle of an opened module.
ch=Specifies the digital input,from which the counter will be read.
mode=0 (Normal counter function)
mode=DAPI_CNT_MODE_READ_WITH_RESET (Reading and resetting the counter)
mode=DAPI_CNT_MODE_READ_LATCHED (Reading the latched counter)
Return value
Value of the counter.
Example program
value = DapiDIGetCounter(handle, 0 ,0); // Zähler von DI Chan 0 wird gelesen
value = DapiDIGetCounter(handle, 1 ,0); // Zähler von DI Chan 1 wird gelesen
value = DapiDIGetCounter(handle, 8 ,0); // Zähler von DI Chan 8 wird gelesen
value = DapiDIGetCounter(handle, 0 ,DAPI_CNT_MODE_READ_WITH_RESET); // Zähler von DI Chan 0 wird gelesen UND resettet
value = DapiDIGetCounter(handle, 1, DAPI_CNT_MODE_READ_LATCHED); // Auslesen des gespeicherten Zählerstandes von DI Chan 1
|