05-25-2007 03:36 PM
05-29-2007 06:06 PM
05-31-2007 03:08 PM
Thanks Abhinav T.,
Scan lists seem to imply that there is some co-ordination of activity among a list of relays. I won't have that at all. You see, I have hundreds of tests running in separate threads, starting and stopping at unpredictable times. Most of those individual threads only care about a single relay. None of the threads care or even know anything at all about what is happening outside of their tiny little world with just one relay.
So, I need to close just one of 200 relays, any one of them, at any time, without any regard whatsoever to what the other 199 relays are doing. In fact, I expect that many of those other 199 will be opening and closing as their teeny-tiny tests dictate even while I depend on my one little relay to be long since settled.
With that in mind, does it help somehow to have 200 scan lists, each with just one relay in each?
If not, then how can I know that my one little relay is settled even if others in the module are openning and closing all the time?
Thanks,
Dave
06-01-2007 11:59 AM
06-01-2007 12:07 PM
So.... niSwitch_WaitForDebouce waits for *ALL* relays in the module to settle. Is that right? If so, then it is no good for me.
Does niSwitch_IsDebounced work on just an individual relay? For example, can I ask if relay 87 is debounced? And if relay 87 is debounced but dozens of other relays are bouncing like mad, will asking about 87 tell me only about relay 87 and return right away indicating that relay 87 is not bouncing irrespective of what other relays may or may not be doing? Remember, I want to do this on a relay by relay basis and not on a device wide basis.
This has been difficult to communicate, alas.
thanks,
d
06-04-2007 05:05 PM
06-05-2007 08:20 AM
Now I need to know what the #@$% a ViSession is. I just want to turn relays on and off, individually, and know when they are settled individually.
I'd like someone to call. After almost 2 weeks I am almost more confused than when I began 937-671-4346.
Dave
06-06-2007 10:18 AM
Dave,
The ViSession is one of the inputs to the WaitForDebounce function. It is essentially a reference to an niSwitch session that is created using the niSwitch Initialize function. Any calls to a switch using the niSwitch driver require a ViSession.
I have found an example that does exactly what you are looking for as well. If you navigate to Start >> Programs >> National Instruments >> NI-Switch >> Examples >> C >> niSwitchMakingConnectionsOnASwitch >> niSwitchMakingConnectionsOnASwitch.C you can find an example that shows you how to setup a ViSession, connect a switch and wait for debounce. I have also attached the code to this post for your convinience.
You can contact an Applications Engineer by going to www.ni.com/ask