Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-03

Acces IO-ports in Linux with FPC 2.2.0

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Iisakki Kosonen

Hi,

I am developing a free pascal software in Linux, which uses the parallel digital input/output card (with intel 8255) in an industrial PC. I was able to compile and run without problems with FP 2.0.4.

Now, that the oldlinux unit is removed in the latest FPC, I cannot compile the program any more.
The error messages are:
- identifier not found "fdOpen"
- identifier not found "fdWrite"
- identifier not found "fdRead"

I have tried replacing the oldlinux with other FP units including: SysUtils, Baseunix, Unix, UnixUtil, but it did not help.

Only adding the Unix-unit helped a bit, because then the following error messages disappeared (constants):
- Intentifier not found "OpenRdWr"
- Intentifier not found "OpenSync"

Could someone tell, what to do in order to compile the code with: fdOpen, fdWrite and fdRead in FP 2.2.X Or is there another solution to access the parallel IO-cards, may be there is a piece of software for this already ?

Regards
- Iisakki

Reply by email

Johann Glaser
to Iisakki Kosonen

Hi!

Show quoted text 10 lines
I am developing a free pascal software in Linux, which uses the parallel digital input/output card (with intel 8255) in an industrial PC. I was able to compile and run without problems with FP 2.0.4. Now, that the oldlinux unit is removed in the latest FPC, I cannot compile the program any more. The error messages are: - identifier not found "fdOpen" - identifier not found "fdWrite" - identifier not found "fdRead"

It seems you have a driver for this card and want to talk to the driver via a Linux device (in /dev/). My first thought was you wanted to access x86 IO ports (using IN and OUT instructions).

Simply use the online help to find the desired functions, e.g. http://community.freepascal.org:10000/docs-html/rtl/baseunix/fpopen This also lists the constants used for the access mode.

Bye
Hansi

Reply by email

Marc Santhoff
to Iisakki Kosonen: I am developing a free pascal software in Linux, which uses the parallel digital…
Iisakki Kosonen wrote 25 lines
Hi, I am developing a free pascal software in Linux, which uses the parallel digital input/output card (with intel 8255) in an industrial PC. I was able to compile and run without problems with FP 2.0.4. Now, that the oldlinux unit is removed in the latest FPC, I cannot compile the program any more. The error messages are: - identifier not found "fdOpen" - identifier not found "fdWrite" - identifier not found "fdRead" I have tried replacing the oldlinux with other FP units including: SysUtils, Baseunix, Unix, UnixUtil, but it did not help. Only adding the Unix-unit helped a bit, because then the following error messages disappeared (constants): - Intentifier not found "OpenRdWr" - Intentifier not found "OpenSync" Could someone tell, what to do in order to compile the code with: fdOpen, fdWrite and fdRead in FP 2.2.X Or is there another solution to access the parallel IO-cards, may be there is a piece of software for this already ?

If you are using real files or named devices you could switch to using "sysutils". There you'll find "FileOpen", "FileREad" and so on. The modes are called "fmOpenRead", ...

Search through the rtl.pdf. I think these should be cross platform. For using "BaseUnix" the same doc has the names of the modes in the chapter fitting the unit name.

Marc Santhoff

Reply by email

Iisakki Kosonen
to Johann Glaser: Hi! It seems you have a driver for this card and want to talk to the driver via a Linux…

Thanks for the help, problem solved
- Iisakki

Johann Glaser wrote 33 lines
Hi! > I am developing a free pascal software in Linux, which uses the > parallel digital input/output card (with intel 8255) in an industrial PC. > I was able to compile and run without problems with FP 2.0.4. > > Now, that the oldlinux unit is removed in the latest FPC, > I cannot compile the program any more. > The error messages are: > - identifier not found "fdOpen" > - identifier not found "fdWrite" > - identifier not found "fdRead" > It seems you have a driver for this card and want to talk to the driver via a Linux device (in /dev/). My first thought was you wanted to access x86 IO ports (using IN and OUT instructions). Simply use the online help to find the desired functions, e.g. http://community.freepascal.org:10000/docs-html/rtl/baseunix/fpopen This also lists the constants used for the access mode. Bye Hansi _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply by email