jcwh
asked on
Read pulses through RS-232
I need to read the output from a magnetic reed device in the PC. The reed device gives a pulse when it sense the metal.
How can I achieve the above mentioned scenario?
It would be best if sample codes are provided.
Which pins do I connect the wires from the magnetic reed device to the RS232 and whether can I connect straight to the pins without any interfacing circuitry?
Output of the reed is 24Vdc (max).
How can I achieve the above mentioned scenario?
It would be best if sample codes are provided.
Which pins do I connect the wires from the magnetic reed device to the RS232 and whether can I connect straight to the pins without any interfacing circuitry?
Output of the reed is 24Vdc (max).
Ask this question in the C programming area, the best real time programming experts are there.
ASKER
What 24Vdc (max) means is that the reed device can operate with voltages ranging to 24 Vdc (max), therefore, it can also function with 5 Vdc.
The reed is just a magnetic switch that closes when it sense a magnet.
The reed is just a magnetic switch that closes when it sense a magnet.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Don't even try to connect that directly to the serial port, it'll just blow up the UART. You need some device that transforms the pulses to a signal with a voltage and impedance that can work with a serial port and adds the necessary protocol logic. Then, see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.asp ("Serial Communications in Win32") on how to read the data from the serial port.