1 /* Humusoft data acquisition library.
\r
3 * Example that shows configuration of
\r
7 /* Copyright 2002-2007 Humusoft s.r.o. */
\r
11 #include "hudaqlib.h"
\r
14 int main(int argc, char* argv[])
\r
19 /* open a handle to the first MF624 device in the system */
\r
20 h = HudaqOpenDevice("MF624", 1, 0);
\r
23 printf("\nData acquisition device not found.\n");
\r
27 /* Configure encoder to count input pulses. */
\r
28 if(HudaqSetParameter(h, 0, HudaqEncMODE, HudaqEncMODERISING) != HUDAQSUCCESS)
\r
30 printf("\nCannot switch encoder to counting mode.\n");
\r
31 HudaqCloseDevice(h);
\r
35 /* Turn on hardware filter for input signal. */
\r
36 if(HudaqSetParameter(h, 0, HudaqEncFILTER, 1) != HUDAQSUCCESS)
\r
38 printf("\nCannot filter input signal.\n");
\r
41 printf("Counting external pulses on input A by encoder, press Enter to continue.\n");
\r
44 /* Read encoder 0 value, print it. */
\r
45 value = HudaqEncRead(h,0);
\r
46 printf("Encoder channel 0, value read %d.\n", 0, value);
\r
48 /* close the device handle */
\r
49 HudaqCloseDevice(h);
\r