Click to See Complete Forum and Search --> : Using MSComm
djbarnard
Nov 1st, 1999, 04:17 AM
We are developing an application using serial port pins as inputs from switches. We are watching the carrier-detect pin with CommEvent to detect a switch open or close. The problem: can't seem to reset it without shutting off the application and restarting. Is there any way to reset the CommEvent settings during runtime?
PhilipG
Nov 1st, 1999, 07:36 AM
Sure, just close the port and reopen it. As long as the settings (DTREnable, etc..) haven't changed, you should be able to just close and open again for a reinitialization.
HTH,
Phil
Juan Carlos Rey
Nov 1st, 1999, 08:46 AM
Why bother with serial port? Parallel port is much easier to work with, and you have at least 5 inputs (13 in bidirectional ports)
PhilipG
Nov 1st, 1999, 09:30 AM
Parallel Port programming in VisualB can be a pain in the arse and really has more disadvantages than advantages. Because messages aren't sent by Windows on STROBE or other printer signals, you don't have an easy way to trigger your software on Recieve, etc. You can program events to monitor the STROBE pin, but doing this causes more CPU "polling". Since Windows already provides serial messages, Visual Basic makes use of these messages and provides the programmer an easy clean way with the OnComm Event.
Hell, the parallel port is soon to be dead anyway. USB is much faster, has more device capactity, and is as easy to program. The better question would be - "Why bother with parallel port?"
Phil
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.