I try to write to the parallelport controlregister. I use the following code.
Code: Select all
;---------------Deklaration der Variabeln ---------------------------------------
PortNumD.l = $378 ; PortNummer des Datenregisters (LPT1)
PortNumS.l = $379 ; PortNummer des Statusregisters (LPT1)
PortNumC.l = $37A ; PortNummer des Controlregisters (LPT1)
Samples = 0
j = 1
;----------------------------------check library file open)----------------------
LibOpen.l = OpenLibrary(1,"io.dll")
If LibOpen = 0
End
EndIf
;---------------------------------open function io.dll--------------------------
CallFunction(1,"PortOut", PortNumC,%0000) ; write to port 37ah
Text$ = InputRequester("Number of samples!", "Integerzahl", "")
Samples =Val(Text$)
Repeat
CallFunction(1,"PortOut", PortNumC,%0000) ; write 0 to 37ah "Strobe"
Ergebnis.b= CallFunction(1,"PortIn", PortNumC)
INC j
Until j >= Samples
Zahl$ = StrF(Ergebnis.b)
Ergebnis.b = MessageRequester("Info", Zahl$, 0)
If I write %0001 to the controregister the result is 3. If I write %0000 to the controregister the result is 0. When I write %0011 to the register the result is 3. I do not understand the reason. What is my mistake?
You can find the io.dll here: http://www.geekhideout.com/iodll.shtml