Test and Measurement Forum

dr daq polling digital inputs in c

Post your C and C++ discussions here

dr daq polling digital inputs in c

Postby 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
mechatronic
Newbie
 
Posts: 0
Joined: Tue Mar 27, 2012 7:08 pm

Re: dr daq polling digital inputs in c

Postby 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 Specialist
Martyn
Site Admin
Site Admin
 
Posts: 2285
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots


Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests