Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-03 Thread Marco van de Voort
In our previous episode, "Vinzent H?fler" said: > > > Accessing ports is limited to ports < 03ffh, more ports cannot be > > released with fpioperm. This means to me, successful serial port access > > on higher addresses cannot yet be implemented with fpc. > > Or any other compiler, for that mat

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-03 Thread Henry Vermaak
2009/11/3 Marc Santhoff : > > I don't know wheter todays Lunix systems have static device nodes seen > here for ttys or if they are created dynamically and the rights have to > be set in some configuration file - consult your systems docs or a good > tutorial or book an those questions. The permis

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-03 Thread Marc Santhoff
Am Dienstag, den 03.11.2009, 09:39 +0100 schrieb Tomas Hajny: > On Tue, November 3, 2009 02:33, Holger Bruns wrote: > > Brad Campbell schrieb: > >> > >> Why not try attaching your test code that is failing so we can help > >> you get it working? > > > > Done. My fault was the following declaration:

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-03 Thread Henry Vermaak
2009/11/3 Holger Bruns : > in trouble with it. Secondly, it appears to be necessary to use the fpc > compiler as "root", not simply as a user, I guess. You need permissions to access any files on linux. Device nodes are files, too. This is what it looks like on debian: h...@technical09:~/source

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-03 Thread Tomas Hajny
On Tue, November 3, 2009 02:33, Holger Bruns wrote: > Brad Campbell schrieb: >> >> Why not try attaching your test code that is failing so we can help >> you get it working? > > Done. My fault was the following declaration: > > var inbuffer: array of char; > > This is a better declaration: > > var

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Holger Bruns
Brad Campbell schrieb: Why not try attaching your test code that is failing so we can help you get it working? Done. My fault was the following declaration: var inbuffer: array of char; This is a better declaration: var inbuffer: array[0..10] of char; Now I got my code working. Hidden poi

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Brad Campbell
Holger Bruns wrote: The real sad thing is, that one cannot produce software for Linux, based on the restricted free pascal compiler. I am really disappointed. That's an interesting assertion. I use serial.pp on i386 Linux, x86_64 Linux, PPC OSX & Intel OSX flawlessly. I use synaser on Win32.

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Holger Bruns
Marc Santhoff schrieb: sDefaultPort: string = '/dev/cuaa0'; { this would be /dev/ttyS2 for you } fPort = sDefaultPort; { Init } fCom := SerOpen(fPort); if (fCom > -1) then begin SerSetParams(fCom, 1200, 7, NoneParity, 2, []); end else begin writeln('Metex: failed to open port'); n := Get

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Vinzent Höfler
Holger Bruns : > Accessing ports is limited to ports < 03ffh, more ports cannot be > released with fpioperm. This means to me, successful serial port access > on higher addresses cannot yet be implemented with fpc. Or any other compiler, for that matter, because this is a system restriction. P

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Marc Santhoff
Am Montag, den 02.11.2009, 15:20 +0100 schrieb Holger Bruns: > I am new to linux and wrote only small things for MS-DOS before. As far > as I could read on the internet, fpc uses ioperm and iopl, and I will > try to use iopl to get access to the ports I want to use. The problem is > indeed the

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Gustavo Enrique Jimenez
> No, the "1000" means the size of a buffer, not a part address. The port > address I try to use is 0xEC00, which is the base address for an UART on a > PCI card. Linux sees this UART as /dev/ttyS2. Accessing the registers > direcly should be easy, because 3 lines of assembler code should do this >

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Holger Bruns
Bernd Mueller schrieb: Holger Bruns wrote: Holger Bruns schrieb: I try to implement a direct port access. If this also leads to access errors, I should give it up. Embarassing. Accessing ports is limited to ports < 03ffh, more ports cannot be released with fpioperm. This means to me, successfu

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Bernd Mueller
Holger Bruns wrote: Holger Bruns schrieb: I try to implement a direct port access. If this also leads to access errors, I should give it up. Embarassing. Accessing ports is limited to ports < 03ffh, more ports cannot be released with fpioperm. This means to me, successful serial port access on

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Holger Bruns
Florian Klaempfl schrieb: Holger Bruns schrieb: Holger Bruns schrieb: I try to implement a direct port access. If this also leads to access errors, I should give it up. Embarassing. Accessing ports is limited to ports < 03ffh, more ports cannot be released with fpioperm. This me

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Jonas Maebe
Holger Bruns wrote on Mon, 02 Nov 2009: Accessing ports is limited to ports < 03ffh, more ports cannot be released with fpioperm. This means to me, successful serial port access on higher addresses cannot yet be implemented with fpc. If this policy can be ruled out, let me know. fpioperm

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Florian Klaempfl
Holger Bruns schrieb: > Holger Bruns schrieb: >> I try to implement a direct port access. If this also leads to access >> errors, I should give it up. Embarassing. > Accessing ports is limited to ports < 03ffh, more ports cannot be > released with fpioperm. This means to me, successful serial port

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Holger Bruns
Holger Bruns schrieb: I try to implement a direct port access. If this also leads to access errors, I should give it up. Embarassing. Accessing ports is limited to ports < 03ffh, more ports cannot be released with fpioperm. This means to me, successful serial port access on higher addresses can

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Jonas Maebe
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 recc

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Holger Bruns
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(

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Holger Bruns
Jonas Maebe schrieb: Holger Bruns wrote on Mon, 02 Nov 2009: Martin schrieb: you can do: var buffer: Array of byte; SetLength(Buffer, 1000); SerRead(Handle, Buffer[0], 1000); I checked this out. It works not reliable. Sometimes I get real data, sometimes the data are corrupted. I have no i

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Frank Peelo
Jürgen Hestermann schrieb: function SerRead(Handle: TSerialHandle; var Buffer; Count: LongInt): LongInt; begin Result := fpRead(Handle, Buffer, Count); end; i don't understand the declaration for "buffer" in the function below, because no type is declared for "buffer". Untyped para

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Jonas Maebe
Holger Bruns wrote on Mon, 02 Nov 2009: Martin schrieb: you can do: var buffer: Array of byte; SetLength(Buffer, 1000); SerRead(Handle, Buffer[0], 1000); I checked this out. It works not reliable. Sometimes I get real data, sometimes the data are corrupted. I have no idea to rule out cor

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Roberto Padovani
There's nothing limited within the compiler! If you have the same knowledge and expertise of Pascal and C, IMHO with gcc you will only be complicating your life. About serial port, low level routine need some practice, but you can go quickly to the point with this component for lazarus: http://s

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-02 Thread Marco van de Voort
In our previous episode, Holger Bruns said: > > The only way to get rid of this problem is a direct port access. But > direct port access is only possible for the first 200 port addresses. A > "port" array is not yet implemented, and the required higher port > addresses are strictly ruled out f

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-01 Thread Holger Bruns
Martin schrieb: Holger Bruns wrote: Jürgen Hestermann schrieb: function SerRead(Handle: TSerialHandle; var Buffer; Count: LongInt): LongInt; begin Result := fpRead(Handle, Buffer, Count); end; i don't understand the declaration for "buffer" in the function below, because no type is d

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-01 Thread Felipe Monteiro de Carvalho
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 It's much easier to use then using the lower level routines yourself. -- Felipe Monteiro de Carvalho

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-01 Thread Martin
Holger Bruns wrote: Jürgen Hestermann schrieb: function SerRead(Handle: TSerialHandle; var Buffer; Count: LongInt): LongInt; begin Result := fpRead(Handle, Buffer, Count); end; i don't understand the declaration for "buffer" in the function below, because no type is declared for "buff

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-01 Thread Holger Bruns
Jürgen Hestermann schrieb: function SerRead(Handle: TSerialHandle; var Buffer; Count: LongInt): LongInt; begin Result := fpRead(Handle, Buffer, Count); end; i don't understand the declaration for "buffer" in the function below, because no type is declared for "buffer". I believe tha

Re: [fpc-pascal] Access to RS232 ports with fpc

2009-11-01 Thread Jürgen Hestermann
function SerRead(Handle: TSerialHandle; var Buffer; Count: LongInt): LongInt; begin Result := fpRead(Handle, Buffer, Count); end; i don't understand the declaration for "buffer" in the function below, because no type is declared for "buffer". I believe that the type is irrelevant, yo

[fpc-pascal] Access to RS232 ports with fpc

2009-11-01 Thread Holger Bruns
Hello, I am new to this list. For programming the serial ports on a linux system, I tried to use the "serial" unit. i don't understand the declaration for "buffer" in the function below, because no type is declared for "buffer". How can I read a character from the selected serial port? This i