September 16th, 2013, 04:55 AM
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
September 18th, 2013, 09:25 PM
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) ?
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!