PC + Linux + I/O card HOWTO

S

Thread Starter

Steve Edmonds

My last Automation project involved a Contec ISA A/D, D/A, I/O card in a PC, programmed in C under dos with direct pc port read/writes.

I would like to do similar under linux and recommendations on card vendor, PC I/O addressing and programming language appreciated. Basic I/O cards with Linux support or ISA cards with documented I/O addressing. Pointer to libraries/information for PC hardware port I/O under Linux.

Thanks, steve
 
R

Rokicki, Andrew

One way you can do this is to provide a I/O driver that will allow you to access I/O ports in the same way as DOS. This will allow you to use any card you want without card specific driver.
I used this aproach before and it worked well.

Without the driver you can access port, but your program needs root privelages and that is not always a good idea.
 
M

Marc Le Douarain

You can take a look at classicladder on SourceForge. It actually read the parallel ports directly with inb() and outb() in real-time under RTLinux (as you can do under DOS). Accessing another card if you have the correct I/O informations is the same that under DOS.
 
C

Curt Wuollet

Hi Steve,

I use ComputerBoards DAS1602 and PCI-DAS1602-16 for ATE. These are full function cards that offer 200khz 12 or 16 bit ADC with 16 SE or 8 diff. inputs, two DACS and 24 DIO. I use the OSS drivers (I can probably help with links) and C. The first step in my opinion is to find what cards are well supported with current drivers. The ones I'm using may not be the best at the moment but I've been doing this for quite a while and there were a lot less choices at the time. The Linux Lab Project is your friend. There you can get info about COMEDI which supports a lot od cards. If all you need is DIO, I have drivers and level translators from ttl to 24 volt levels for the DIO48 card and similar. The drivers and the hardware artwork are Open Source and free. Please feel free to ask questions as I got help from the community in the beginning and will gladly pay it back.

Regards

cww
 
We have an open-source project to write a SoftPLC - perhaps a bit more grandiose than you asked, but it might fit the bill.

"http://mat.sf.net":http://mat.sf.net

> programmed in C under dos with direct pc port read/writes.
...
> I would like to do similar under linux and recommendations on card
> vendor, PC I/O addressing and programming language appreciated.

You can do exactly the same, a normal C program reading and writing I/O ports. All you'll need is a short wrapper to change the I/O permissions or the I/O privilege level and then call your program, and you're set.

The other way is to do a proper kernel driver, which is a bit more fiddly, but perhaps more widely useful.::


Jiri
--
Jiri Baum <[email protected]> http://www.csse.monash.edu.au/~jirib
MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools
 
R

Richard Prescott

> Would DOSEMU under Linux do the job?<

Only if you allow DOSEMU to read/write to certain port.
 
Top