07-14-2010 11:59 AM
hi folks, I am working on a usb 6008 daq board with visual studio 2003 and measurement studio 7.1. I have an analog task working fine, now I need to read also a digital input to check if the user is pushing a button. I have created a digital task with a single channel and a single sample reading on demand, and I have put inside the analog callback the
Led1.Value = myDigitalReader.ReadSingleSampleSingleLine
code, so that when I change the input value, a led goes on and off.
the code compiles fine, but unfortunately when i run the program, at this line the program stops working without sending error messages. I have tried debugging but the cursor disappears. Any ideas?
it would be even better if there was a way to detect when the digital input changes its state without reading the input at each iteration.
tks
nunzio
07-15-2010 07:03 AM
Hi nunzio,
you can try to modify your code as follow
Led1.Value = myDigitalReader.ReadSingleSampleSingleLine()
Otherwise you can read this or this post to try to find a different solution.
Please tell me if you resolve your issue.
Ciao!
07-21-2010 05:36 AM
Tks a lot Simone for your reply. It was my stupid fault, I hadn't correctly initialised the digital task. Now it works perfectly.
NI rules!
ciao
n.