Hi Synalist,
I have stumbled across an interesting problem when using Synaser to connect
to a Serial port. I think this might be hardware related and maybe someone
has a solution:
I am using a Advantech PC104 board that has 2 serial RS232 ports and have
Linux loaded as the OS. To this I connect a device that sends binary data to
the serial port on the Advantech board.
When I connect to view the data in Minicom, I can see the Binary data being
received. I then close Minicom and run my application that can process this
binary data and everything works fine to this point. When I stop my
application and restart it, I get the error "Bad file number" when trying to
connect and configure the serial port. I then have to run minicom again
where it connects and receives the data, and once I close minicom am I able
to run my application again after which I receive the binary data again and
then there are no errors when connecting to the ports.
So what is comes to is that I have to run minicom everytime I want to
restart my application. I am not sure what Minicom does in order to have
access to the serial port and have noted some basic AT commands sent from
minicom which should not make a difference. From within my application I
basically call:
SerialObj.Connect('/dev/ttyS0');
SerialObj.Config('9600',8,'N',1,false,false)
if SerialObj.LastError = 0 then
begin
//...code continues here
end
else
begin
//....an error occured when connecting to the serial port.
Writeln('Serial Port Error:', SerialObj.LastErrorDesc);
end;
Is there something that I can look at to gain access to the serial port
without having to run minicom all the time?
Thanks in advance!
W
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public