Amir Azhdari
asked on
writing to parallel port in windows NT
hi ,
how i can write a byte of data to parallel port in windows NT ( without using components ) ?
Thanks you very much.
regards,
Amir
how i can write a byte of data to parallel port in windows NT ( without using components ) ?
Thanks you very much.
regards,
Amir
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dear Gwena
can you send me your source code Please ?
my email : azhdari@lycos.com
Thank you Gwena... you really helped me.
can you send me your source code Please ?
my email : azhdari@lycos.com
Thank you Gwena... you really helped me.
Gwena have you deleted the file from server? Can't download it :(
ASKER
Hi ginsonic
you have to right click the link to the file and select
'save target as' to download it..
you have to right click the link to the file and select
'save target as' to download it..
Hi AmirAzhdari :-)
I will send the code to your email
It was compiled using D2 standard
and there is a component you would need
to handle the fancy form shape...
But the main unit code will show you exactly
how to make easy use of zlportio
oh... also a small util I wrote would be needed to
stuff the zlportio.sys into the compiled exe so that
it can be extracted at runtime with my exemod.pas unit
exemod.pas is in the source code...
any questions about the source just ask... I did not
comment it :-)
I will send the code to your email
It was compiled using D2 standard
and there is a component you would need
to handle the fancy form shape...
But the main unit code will show you exactly
how to make easy use of zlportio
oh... also a small util I wrote would be needed to
stuff the zlportio.sys into the compiled exe so that
it can be extracted at runtime with my exemod.pas unit
exemod.pas is in the source code...
any questions about the source just ask... I did not
comment it :-)
Here is an article called "Using the Parallel Port as an Input/Output Channel":
http://digital.ni.com/public.nsf/websearch/953a4ab52663089d85256427004778c4?OpenDocument
And here are some procedures to write, reset and read parallel port:
//************************
procedure WriteToPort(PortAddress, DataValue: Word);
begin
DataValue := (DataValue*256) + DataValue;
asm
Mov ax, DataValue
Mov dx, PortAddress
Out dx, ax
end;
end;
//************************
procedure ResetPort(PortValue: word);
begin
asm
Mov ax,0
Mov dx,PortValue
Out dx,ax
end;
end;
//************************
function TBAIOPort.ReadPort(PortVal
var
ReadData: word;
begin
asm
Mov dx, PortValue
In ax, dx
Mov ReadData, ax
end;
Result := Byte(ReadData);
end;
//************************
Good luck,
Emad