I developed a GPS application written in Delphi but I have problems of communication with USB emulators. I Try Serial Port Control v1.4, it seems to work perfectly.
I work with your example TinyTerm.I put a simple form with 2 buttons and a TMemo.
With Button1, I send a sentence to the port where a GPS is connected. Parameters in Open procedure are 57600,N,8,1. If communication is OK, GPS answers a sentence with serial number.
With button2 I stop the test with a simple procedure called Stop_Test :
FTSerialControl1.Close; TTY.Lines.Add(' Test finished...');
No problem... when i use button1 followed by button2. One second of delay and it's OK. If I call Stop_Test in FormClose evenment, same thing...
I have a problem when I want to close the port by program. Basically when I have anwser of GPS, I close the port. In a FTSerialControl1CommEvent procedure, I recover anwser of GPS and I call Stop_Test. When I make this, application is freezing... What is the right way to close the port by program ?
Many thanks. ( sorry for my bad english !!!)
IP Logged
Andrew FabulaTech Forum Moderator
Moderator FabulaTech Forum Senior Member
Gender: Posts: 427
Re: Close procedure Reply #1 on: Apr 13th, 2006, 7:14am
You can not call blocking methods (like CLOSE or READ with non-zero Timeout parameter ) within FTSerialControl1CommEvent handler because that can cause deadlocks as in your case. We suggest you to close port outside of handler.