dr daq polling digital inputs in c

Post your C and C++ discussions here
Post Reply
mechatronic
Newbie
Posts: 0
Joined: Tue Mar 27, 2012 7:08 pm

dr daq polling digital inputs in c

Post by mechatronic » Tue Mar 27, 2012 7:29 pm

Hello

i have written a program in c which polls the digital inputs every 20ms
...

Code: Select all

  
        UsbDrDaqGetInput(g_handle, 1, 0, &value1);
        UsbDrDaqGetInput(g_handle, 2, 0, &value2);
        UsbDrDaqGetInput(g_handle, 3, 0, &value3);
do some checks
 Sleep(20);

...

this works fine but after a time, sometimes 1min sometimes 30min it crashes with returning 255.
I have reduced the program only to the loop above but it did not help.
is there any timelimit of polling the inputs?



greetings from germany

Martyn
Site Admin
Site Admin
Posts: 3226
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: dr daq polling digital inputs in c

Post by Martyn » Wed Mar 28, 2012 9:43 am

Try putting a short delay between each of the GetInput calls and see if that fixes the problem.
Martyn
Technical Support Manager

Post Reply