Ik ben op zoek naar een progie, om de lpt poort aan te sturen onder win NT/2000/XP. Ik heb dit al aan de gang met een DLL en een progie, maar ik zoek nu een progie waarmee ik pinnen hoog kan maken, door een opdracht op de commandline.
--------------------------------------------------------------------------------
Control program
The following program is an example how to control parallel port LPT1 data pins from your software. This example directly controls the parallel port registers, so it does not work under some multitasking operating system which does not allow that. It works nicely under MSDOS. You can look the Borland Pascal 7.0 code (should compile also with earlier versions also) and then download the compiled program LPTOUT.EXE.
Program lpt1_output;
Uses Dos;
Var
addr:word;
data:byte;
e:integer;
Begin
addr:=MemW[$0040:$0008];
Val(ParamStr(1),data,e);
Port[addr]:=data;
End.
How to use the program
LPTOUT.EXE is very easy to use program. The program takes one parameter, which is the data value to send to the parallel port. That value must be integer in decimal format (for example 255). Hexadecimal numbers can also be used, but they must be preceded by $ mark (for example $FF). The program hoes not have any type of error checking to keep it simple. If your number is not in correct format, the program will send some strange value to the port.
Example how to use the program
LPTOUT 0
Set all datapins to low level.
LPTOUT 255
Set all datapins to high level.
LPTOUT 1
Set datapin D0 to high level and all other datapins to low level.
How to calculate your own values to send to program
You have to think the value you give to the program as a binary number. Every bit of the binary number control one output bit. The following table describes the relation of the bits, parallel port output pins and the value of those bits.
Pin 2 3 4 5 6 7 8 9
Bit D0 D1 D2 D3 D4 D5 D6 D7
Value 1 2 4 8 16 32 64 128
For example if you want to set pins 2 and 3 to logic 1 (led on) then you have to output value 1+2=3. If you want to set on pins 3,5 and 6 then you need to output value 2+8+16=26. In this way you can calculate the value for any bit combination you want to output.
-----------------------------------------------------------------------------
Duz ik bedoel in een command line: lptpoort.exe 3
dat dus zorgt dat pinnen 2 en 3 hoog worden en dat ik ze met bijvoorbeeld lptpoort 0 weer uit zet, zoals op de site staan. Heeeeeel eenvoudig maar ik kan duz niet programeren. In quickbasic was ik vroeger wel bezig, maar die kan niet direct een poort meer aansturen onder alle NT versies van windows. Ik hoop dat iemand hier een progie weet dat ik hiervoor kan gebruiken [linkie?]
Zoals je ziet kan dit progie duz niet onder die winnt versies werken. Anders wat ik nu aan het solderen met relais etc... Misschien maak ik nog een site als ik dit aan de gang heb met al de progies!
--------------------------------------------------------------------------------
Control program
The following program is an example how to control parallel port LPT1 data pins from your software. This example directly controls the parallel port registers, so it does not work under some multitasking operating system which does not allow that. It works nicely under MSDOS. You can look the Borland Pascal 7.0 code (should compile also with earlier versions also) and then download the compiled program LPTOUT.EXE.
Program lpt1_output;
Uses Dos;
Var
addr:word;
data:byte;
e:integer;
Begin
addr:=MemW[$0040:$0008];
Val(ParamStr(1),data,e);
Port[addr]:=data;
End.
How to use the program
LPTOUT.EXE is very easy to use program. The program takes one parameter, which is the data value to send to the parallel port. That value must be integer in decimal format (for example 255). Hexadecimal numbers can also be used, but they must be preceded by $ mark (for example $FF). The program hoes not have any type of error checking to keep it simple. If your number is not in correct format, the program will send some strange value to the port.
Example how to use the program
LPTOUT 0
Set all datapins to low level.
LPTOUT 255
Set all datapins to high level.
LPTOUT 1
Set datapin D0 to high level and all other datapins to low level.
How to calculate your own values to send to program
You have to think the value you give to the program as a binary number. Every bit of the binary number control one output bit. The following table describes the relation of the bits, parallel port output pins and the value of those bits.
Pin 2 3 4 5 6 7 8 9
Bit D0 D1 D2 D3 D4 D5 D6 D7
Value 1 2 4 8 16 32 64 128
For example if you want to set pins 2 and 3 to logic 1 (led on) then you have to output value 1+2=3. If you want to set on pins 3,5 and 6 then you need to output value 2+8+16=26. In this way you can calculate the value for any bit combination you want to output.
-----------------------------------------------------------------------------
Duz ik bedoel in een command line: lptpoort.exe 3
dat dus zorgt dat pinnen 2 en 3 hoog worden en dat ik ze met bijvoorbeeld lptpoort 0 weer uit zet, zoals op de site staan. Heeeeeel eenvoudig maar ik kan duz niet programeren. In quickbasic was ik vroeger wel bezig, maar die kan niet direct een poort meer aansturen onder alle NT versies van windows. Ik hoop dat iemand hier een progie weet dat ik hiervoor kan gebruiken [linkie?]
Zoals je ziet kan dit progie duz niet onder die winnt versies werken. Anders wat ik nu aan het solderen met relais etc... Misschien maak ik nog een site als ik dit aan de gang heb met al de progies!
Ondernemer in tech (oud LOQED.com, nu UpToMore.com)