[fpc-pascal] Access to RS232 ports with fpc

Jonas Maebe jonas.maebe at elis.ugent.be
Mon Nov 2 15:01:56 CET 2009


Holger Bruns wrote on Mon, 02 Nov 2009:

> Felipe Monteiro de Carvalho schrieb:
>> It may be useful to know that there is a serial communication example
>> using Synaser here:
>>
>> http://wiki.lazarus.freepascal.org/Hardware_Access#Serial_Communication
>>
> Yes, thank you. I checked this out. The procedure reccvbyte, as used  
> in this manner:
>
> Write(IntToHex(ser.RecvByte(1000), 2), ' ');
>
> reads every incoming character as zero. Simply, is does not work.

Are you certain that your serial port is actually configured  
correctly? Many people have successfully used these units in the past,  
so it most likely seems like a configuration or usage problem.

Moreover, the serread function you posted earlier is about as low  
level as you can get: it directly reads bytes from a handle using a  
system call. If that never works, then the problem is almost certainly  
completely unrelated to anything FPC.

You may also want to post the complete test program that you are  
using, maybe there is an error somewhere.

> I try to implement a direct port access. If this also leads to  
> access errors, I should give it up. Embarassing.

Please stop complaining in virtually every reply to people trying to help you.


Jonas

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the fpc-pascal mailing list