Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trigger event from serial port or other 2

Status
Not open for further replies.

Alabaster

Programmer
Joined
Aug 11, 2001
Messages
44
Location
CA
Hope someone can help with this...
I have a simple data collection app that has 5 user input fields and 2 auto-incrimenting fields. I need the program to watch a serial port or something to see a dry contact close and then print the page, incriment the 2 fields, then wait for the next contact event. I have the program built and ready to go, but I have no external input (my sample waits for a ALT-1 event so far) can someone please point me in the right direction for getting mechanical external imputs into my application.

Thanks

Peter
 
so are you looking to make your own input device, (ie like the weatherfolk have on the news??

if you leave your email i can send you a simple schematic for an input device using a max232 chip?!?! this way you can use the oncomm event of the mscomm control,

if this isnt what your after, can you be a little more specific!!

good luck If somethings hard to do, its not worth doing - Homer Simpson
 
You don't need any special device.

You just need a switch connected to the ground of the port, ( Pin 5 ) and the CTS pin ( Clear to send, pin 8 )

In the OnComm event for the control, check to see if the event is a change in status of the CTS line

Private Sub MSComm_OnComm ()

If comEvCTS then
' code here to do wqhatever you want
End If

End Sub

If you need to pull CTS high to get a state change, you could place the switch between CTS and DTR.

Robert
 
Thank you everyone, I'll try that this week and see how things go.

Peter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top