FAQ | Points | Add... | Recent posts | Search | Register | Log in


[C++] Sterowanie portem LPT pod Windows 98


Post new topic  This topic is locked      Main Page -> Forum Index -> Programming Generally -> [C++] Sterowanie portem LPT pod Windows 98
Author
Message
super_sonic
Poziom 16
Poziom 16


Joined: 10 Apr 2003
Posts: 320
Location: gliwice

Post#1 Post from the author of the topic 08 Jan 2004 13:06   

[C++] Sterowanie portem LPT pod Windows 98


czy ktos wie jak korzystajac z WinApi wystawic bajt na porcie LPT?czy moglby ktos mnei poratowac kawalkiem kodu?

Temat zamykam. - arnoldziq

Back to top
   
mmm777
Poziom 21
Poziom 21


Joined: 16 Jun 2003
Posts: 1176
Location: zagłębie/¶l±sk

Post#2 08 Jan 2004 13:17   

Re: WinApi i LPT


Jeżeli to NT+, to system do portów nie dopuszcza programów użytkowych, trzeba mieć driver np. GiveIO (http://www.geocities.com/Miroslaw_Maczka/winnt/), a potem po prostu in i out instrukcje maszynowe...
Back to top
   
super_sonic
Poziom 16
Poziom 16


Joined: 10 Apr 2003
Posts: 320
Location: gliwice

Post#3 Post from the author of the topic 09 Jan 2004 10:17   

Re: WinApi i LPT


program bedzie chodzil na win98 , a moglbys mnie poratowac przykladowym kodem?bylbym wdzieczny:)
Back to top
   
Google

Google Adsense


Post# Post from the author of the topic 09 Jan 2004 10:17   





Back to top
   
mmm777
Poziom 21
Poziom 21


Joined: 16 Jun 2003
Posts: 1176
Location: zagłębie/¶l±sk

Post#4 09 Jan 2004 10:43   

Re: WinApi i LPT


Niestety, moje do¶wiadczenia s± poniek±d odwrotne, przerabiałem tylko programator do Atmeli (Spider Brain) z Win9x tak, by chodził pod NT. Poszukaj po forum, były tu jakie¶ przykłady. Jeżeli kompilator ma funkcje inp i out, to nie będzie problemów.
Back to top
   
super_sonic
Poziom 16
Poziom 16


Joined: 10 Apr 2003
Posts: 320
Location: gliwice

Post#5 Post from the author of the topic 09 Jan 2004 15:19   

Re: WinApi i LPT


Dziekuje Ci
Back to top
   
powerm
Poziom 18
Poziom 18


Joined: 20 Dec 2003
Posts: 590

Post#6 09 Jan 2004 19:03   


Nie wiem czemu utrudniasz sobie zycie.
Wyslanie bajtu to wyslanie jednej litery ASCII.
Wiec zaloz sobie driver Generic Text i kopiuj do niego litera po literze np type a > lpt1:
Back to top
   
Google

Google Adsense


Post# 09 Jan 2004 19:03   





Back to top
   
super_sonic
Poziom 16
Poziom 16


Joined: 10 Apr 2003
Posts: 320
Location: gliwice

Post#7 Post from the author of the topic 10 Jan 2004 11:21   

Re: WinApi i LPT


no tyle ze musze sobie utrudniac zycie bo to czesc mojaj pracy dyplomowej:(musze sam to napisac, ale dzieki
Back to top
   
Google

Google Adsense


Post# Post from the author of the topic 10 Jan 2004 11:21   





Back to top
   
BoskiDialer
Poziom 22
Poziom 22


Joined: 28 Nov 2003
Posts: 1533
Location: Żory

Post#8 11 Feb 2004 17:42   

Re: WinApi i LPT


eh.. jak lpt to czyli port 378:

zapisz:
asm
mov dx,0378h
mov al,dana
out dx,al
end;

odczyt:
asm
mov dx,0378h
in al,dx
mov dana,al
end;

na necie roji sie od opisów lpt..
Back to top
   
super_sonic
Poziom 16
Poziom 16


Joined: 10 Apr 2003
Posts: 320
Location: gliwice

Post#9 Post from the author of the topic 11 Feb 2004 17:51   

Re: WinApi i LPT


a jak to wstawic do c++ zeby sie z nim nie zagryzlo? mozna zrobic to np tak :
#include < iostream.h>

main(){
int dana;
_asm {
mov dx,0378h
mov al,dana
out dx,al
}
return(0);
}

??
jestem lewy jesli chodzi o asembler:(
Back to top
   
h-doc
Poziom 21
Poziom 21


Joined: 02 Feb 2003
Posts: 1219

Post#10 12 Feb 2004 11:31   

WinApi i LPT


w VC++ dyrektywa asm musi miec podwojne podkreslenie (czyli __asm)
Back to top
   
super_sonic
Poziom 16
Poziom 16


Joined: 10 Apr 2003
Posts: 320
Location: gliwice

Post#11 Post from the author of the topic 12 Feb 2004 12:28   

Re: WinApi i LPT


zrobilem tak:

__asm{
mov dx,0378h
mov al,dana
out dx,al
}

i przy "out dx,al " dostalem komunikat : " error C2443 : operand size conflict"
co jest nie tak??

jakiego typu musi byc zmienna dana? za kazdym razem gdy daje int wyskakuje mi powyzszy kominkat:(
Back to top
   
Google

Google Adsense


Post# Post from the author of the topic 12 Feb 2004 12:28   





Back to top
   
Gavian
Poziom 12
Poziom 12


Joined: 28 Oct 2002
Posts: 85
Location: Bielsko

Post#12 12 Feb 2004 13:29   

Re: WinApi i LPT


Dana musi byc 8 bitowa, a więc typ char.

Pozdrawiam
Back to top
   
super_sonic
Poziom 16
Poziom 16


Joined: 10 Apr 2003
Posts: 320
Location: gliwice

Post#13 Post from the author of the topic 12 Feb 2004 13:41   

Re: WinApi i LPT


#include <iostream.h>
#include <stdlib.h>

void zapisz(char dana);

main(){
char liczba;
cout<<"Wpisz wartosc do wystawienia na porcie...";
cin>>liczba;
zapisz(liczba);
return(0);
}

void zapisz(char dana){
__asm{
mov dx,0378h
mov al,dana
out dx,al
}
system("pause");
}

czy to bedzie dzialac pod 98? ja mam xp i za bardzo nei dziala:(
Back to top
   
praw
Poziom 14
Poziom 14


Joined: 16 Oct 2003
Posts: 183
Location: Gdań¶k

Post#14 12 Feb 2004 14:33   

Re: WinApi i LPT


Powinno chodzic pod 98, a zeby chodzilo pod XP nalezy doinstalowac driver odblokowujacy porty (chodzi o te wstawki asemblerowe) - gdzies na elektrodzie sie paletal, ale jak na zlosc nie pamietam nazwy (chyba cos w rodzaju userport) - poszukaj na forum programowania mikrokontrolerow - tam powinno byc

pozdro
Back to top
   
super_sonic
Poziom 16
Poziom 16


Joined: 10 Apr 2003
Posts: 320
Location: gliwice

Post#15 Post from the author of the topic 18 Feb 2004 11:07   

Re: WinApi i LPT


dzieki wam wszystkim, chodzi jak marzenie:)
Back to top
   
Post new topic  This topic is locked      Main Page -> Forum Index -> Programming Generally -> [C++] Sterowanie portem LPT pod Windows 98
Page 1 of 1
Similar topics
[Free Pascal] Sterowanie portem LPT. (4)
[Visual Basic] Sterowanie portem LPT. (1)
[Delphi] Sterowanie portem LPT. (5)
[C++][Delphi] Sterowanie portem LPT. (22)
Dwustronne sterowanie portem LPT. (5)
[PHP] Sterowanie portem LPT. (5)
c++ sterowanie portem lpt (1)
Sterowanie lpt pod Windows XP (5)
[c++] sterowanie portem lpt w windows 7 (7)
[Visual Basic] Sterowanie portem LPT. (1)

Page generation time: 0.072 seconds


FAQ || Administrator || Moderators || Widgets and banners || Contact
elektroda.pl topic RSS feed