Author Topic: Monitor the DTR signal in VB as a digital input? Help?  (Read 12888 times)

mugsmugs

  • Member
  • ***
  • Posts: 1
Monitor the DTR signal in VB as a digital input? Help?
« 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

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Monitor the DTR signal in VB as a digital input? Help?
« Reply #1 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