Delphi and Interfacing I/O Card

Hi,
   I've installed an I/O card (Digital Input / Output Card) into my PC and I want to control it (such as get or out data ) but I don't know how to program my Delphi application (I can do it in Turbo Pascal 7.0 on Dos). My questions are ...
   1. What is the source program to control (Get or Out data) I/O card?
   2. Where can I buy the Delphi Programming Books about Interfacing I/O Card, what is it's name?
                                                                                Best regard.
                                                                                      John
JohnyutasAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
mscatenaConnect With a Mentor Commented:
Under Windows 3.X, Windows 95 and Windows 98, you may use the following code to read from and write to ports.

Under Windows NT you *MUST* write a Device Driver. This cannot be done in Delphi: the executable format is different. You would need Microsoft Visual C++ 5/6 AND the Driver Development Kit (DDK) that is part of Microsoft Developers Network. It's possible to write a device driver that works both under NT and Win/98.

function ReadPortB(Port: Word): byte;
begin
  asm
    mov dx, Port
    in al, dx
    mov result, al
  end;
end;

procedure WritePortB(Port: Word; Val: byte);
begin
  asm
    mov dx, Port
    mov al, Val
    out dx, al
  end;
end;
0
 
intheCommented:
Hi
maybe something you can use here:

http://www.torry.ru/comms.htm

Regards Barry
0
All Courses

From novice to tech pro — start learning today.