bryan C.
2007-08-03 22:10:11 UTC
I am developing an application using Measurement Studio 2005 and I am having a design issue that I hope someone can help me with. I am using an NI USB-6229 digital input channel to read the value of a contact switch to find out if the switch is open or closed. While the application is running, I will need to know when the switch transitions from high to low, and low to high. However I will also need to read the current value of the switch at startup and a couple of times during the run cycle.
I am currently using an asynchronous callback to a function that will handle the transitions of the channel. The problem that I am having is that I can't read the current digital value of the channel without getting a runtime error saying that the channel reasources are in use. Is it possible to read the channel value without ending the asynchronous callback method or is there another solution that I haven't tried? I would like to avoid starting an stopping this method continuously, but if that is the only way I would like to know that too.
Thanks for your help!
I am currently using an asynchronous callback to a function that will handle the transitions of the channel. The problem that I am having is that I can't read the current digital value of the channel without getting a runtime error saying that the channel reasources are in use. Is it possible to read the channel value without ending the asynchronous callback method or is there another solution that I haven't tried? I would like to avoid starting an stopping this method continuously, but if that is the only way I would like to know that too.
Thanks for your help!