Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6501/magnetic reed switch input

I am considering purchasing the 6501 and I just wanted to make sure it will fit my needs. I am looking for a product that will let me connect multiple (10-12) sensors. Each of these sensors is actually a magnetic reed switch. I am interested in monitoring switch closures. I would like to be able to see the data as number of closures (for each switch) in a given time period, but it would also be acceptable if each closure was time-stamped and logged. Is it possible to connect this type of switch as a sensor, and if so, will the 6501 fit my application? 
0 Kudos
Message 1 of 7
(5,952 Views)

It looks like what you want to do is shown as #4 from this figure in the 6501 data sheet. You don't mention how often you need to check the switch closures and as the acquisition is software timed, the speed will depend on your system and your program. You don't mention what programming language you will be using but assuming that it is LabVIEW, you can acquire data as a digital waveform type which will give you a timestamp, add your own timestamp whenever you do a DAQmx Read, or put your acquisition in a timed loop which will give you a more reliable rate.

Message Edited by Dennis Knutson on 09-11-2006 02:40 PM

Message 2 of 7
(5,944 Views)

Yes, I'd be using LabVIEW.

I'm pretty new to this type of stuff, so please excuse any dumb questions or comments on my part. You mention how often I need to check the switch closures. Does this type of system actually have to check (at a specified interval) whether or not the switch is open or closed, or does it just constantly monitor the state of the switch?

0 Kudos
Message 3 of 7
(5,936 Views)
You have to write the program to continuously read the state of the digital inputs on the DAQ board. If you already have LabVIEW, you should be able to go to Help>Find Examples to get you started. Look under Hardware Input and Output>DAQmx>Digital Measurements for Read Dig Chan and Read Dig Port. Either one can be used a the basis for what you want. The DAQmx Read is just inside a while loop and the state of the digital inputs is displayed as either an array of Booleans or as a hex number. The DAQ Assistant can also be used inside a while loop.
0 Kudos
Message 4 of 7
(5,930 Views)
Thanks for posting the NI Forums.  I wanted to add to Dennis' excellent advice by mentioning some of the additional limitations that may arise with the USB-6501.  The USB-6501 is a static (software timed) only digital device.  In other words you cannot specify a rate of acquisition in hardware but only use software polling.  Some typical acheivable data acquisition rates for the USB-6501 can be found at:

http://digital.ni.com/public.nsf/websearch/376BBB979269F9C5862570F7006A030F?OpenDocument

To answer your question: yes, this type of system would actually check as some interval whether the switch is open or closed.  This is the case with most digital data acquisition systems.  The key is to acquire at a fast enough rate that the information you care about is preserved.  For example, you will want to acquire faster than the fastest rate at which the reed switch can change state and thus acquire the actual state of the switch during your acquisition.  If acquired at a lower rate you will miss transitions.

Let me know if you have any further questions.

Regards,

Neil S.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 7
(5,914 Views)
And on the other side of the coin, if you sample too fast, you may end up detecting contact bounce of the switch. Switches rarely close 'cleanly'- that is the contacts may tend to bounce close and open many times before it settles down to a solid close. Depending on your detection time needs, you could use hardware RC filtering or software filtering of some means. Mercury wetted reed relays are another way to go, the liquid nature of their contacts allows clean closes and also a self-renewing contact (it keeps clean, no oxide buildup).
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 6 of 7
(5,912 Views)
Excellent point!
0 Kudos
Message 7 of 7
(5,905 Views)