Results 1 to 4 of 4

Thread: Using MSComm

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Location
    Ames, IA U.S.A.
    Posts
    1

    Post

    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?

  2. #2
    Addicted Member
    Join Date
    Oct 1999
    Location
    Dallas,TX
    Posts
    170

    Post

    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

  3. #3
    Hyperactive Member Juan Carlos Rey's Avatar
    Join Date
    Aug 1999
    Location
    Mendoza, Argentina
    Posts
    301

    Post

    Why bother with serial port? Parallel port is much easier to work with, and you have at least 5 inputs (13 in bidirectional ports)

  4. #4
    Addicted Member
    Join Date
    Oct 1999
    Location
    Dallas,TX
    Posts
    170

    Post

    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width