CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2013
    Posts
    1

    Serial Port write in System.Threading.Timer

    I wrote an apllication that check sql table and if it has proper record then selected command is writen to the serial port.

    It's working almost fine, but sometimes application crash.
    It seams to writing method that i call by System.Threading.Timer cause exception that i can't find.

    What is the better way to write to serial port in time interval.
    1. Open the port, call System.Threading.Timer with write method, close the port when closing program
    2. call the System.Threading.Timer with operartions: open the port, call write method, close the port

    bye
    Sebastian

  2. #2
    Join Date
    Sep 2013
    Location
    Wisconsin
    Posts
    5

    Re: Serial Port write in System.Threading.Timer

    Best to close the port after you are done using it. Is your crash possibly caused by attempting to access an already open port (Access Denied) ?

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

Featured