PORTS Forum

Ports and Interfaces => Serial Ports => Topic started by: mugsmugs on July 27, 2010, 02:36:33 pm

Title: Monitor the DTR signal in VB as a digital input? Help?
Post by: mugsmugs on July 27, 2010, 02:36:33 pm
I’m a PLC guy and not very experienced with VB.  I need to write something in VB to look at the DTR signal from the serial port as a digital input.  I have a touch probe that has a dry contact, which I need to wire to the DTR of the serial port, then detect when this goes high using VB to trigger another event.  I have read a lot about this, but I’m still not clear on exactly how to do it.


Jim
Title: Re: Monitor the DTR signal in VB as a digital input? Help?
Post by: Jan Axelson on July 27, 2010, 05:55:22 pm
In VB .NET, in the System.IO.Ports namespace, see:

SerialPinChangedEventHandler

SerialPinChange Enumeration

My Serial Ports page has an example of serial-port communications using VB .NET.

DTR is an output on PCs. You would monitor the the contact on DSR, which is an input.

Jan