-
September 16th, 2013, 03:55 AM
#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
-
September 18th, 2013, 08:25 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|