| |
|
|
Penguin Tux | Moin XProfan,
after my Netzwerktool is done, asks me one friend whether I in the site be, it one Tool To write, which LED´s on and off can. I thought naturally immediate on whom COM-Port, but the are missing on the Eee-PC Yes completely. means coming me The idea the whole with a USB-COM-Adapter To make. The surface for the Tool is already ready, I must tappt im dunkeln hold only yet with life fill. mere from the E-engineering white I How the runs, but programmiermäßig siehts again mau from. self-evident have I The XProfan-Help question and I weder under COM yet under EIA-232 as well as under RS-232 something brauchbares found. now count I time again on you...
MfG Tony |
|
|
| |
|
|
|
| are here correctly. or should I move?
Mainpage » IDE, aide, Tools and Precompiler » Profan2Cpp-Support, Profansource to C++ |
|
|
| |
|
|
|
Penguin Tux | Oh, my Error. does me sorrow, naturally should You move. |
|
|
| |
|
|
|
| Fühl you shoved... |
|
|
| |
|
|
|
GDL | Hi,
here's of many Communityautoren and me Zusammengetragenes. Perhaps helps it to you what. CompileMarkSeparationDef Createfile(7) !"kernel32.dll","CreateFileA"
Def Getlasterror(0) !"kernel32.dll","GetLastError"
Def Formatmessage(7) !"Kernel32.dll","FormatMessageA"
Def Escapecommfunction(2) !"kernel32.dll","EscapeCommFunction"
Def Getcommmodemstatus(2) !"kernel32.dll","GetCommModemStatus"
Def &Clrbreak 0
Def &Clrdtr 6
Def &Clrrts 4
Def &Setbreak 8
Def &Setdtr 5
Def &Setrts 3
Def &Setxoff 1
Def &Setxon 2
Def &Cts_on $10
Def &Dsr_on $20
Def &Ring_on $40
Def &Rlsd_on $80
Declare Hport& porthandle
Declare Modemstatus& Modemstatus
Declare Ret&, Message#
Proc Lasterrorstring nur um den Text des letzten Fehlers von GetLastError zu bekommen
Dim Message#,1029
Declare Buffer&, Flags&,Source&,Language&,Arguments&, Errorstring$
Buffer& = 1024
Flags& = $1000
Language& = 0~lang_neutral
Clear Message#
Formatmessage((Flags&),Addr(Source&),Getlasterror(),(Language&),Message#,Addr(Buffer&),Addr(Arguments&))
Errorstring$ = Trim$(String$(Message#,0))
Dispose Message#
Return Errorstring$
Endproc
Hport& = Createfile("COM2",0,0,0,3,0,0)opencom("COM2",1024,1024)
Print "Porthandle :",Hport&
Print
Ret& = Escapecommfunction(Hport&,&Setdtr)
Print "DTR setzen"
Case Ret& = 0 : Print "Fehler"
Print Lasterrorstring()
Ret& = Escapecommfunction(Hport&,&clrdtr)
Print "DTR rücksetzen"
Case Ret& = 0 : Print "Fehler"
Print Lasterrorstring()
waitinput
-----am besten einen Schalter zwischen DTR und z.B. CTS setzen
Ret& = Getcommmodemstatus(Hport&,Addr(Modemstatus&))
Print
Print "Status der Eingänge ermitteln"
Case Ret& = 0 : Print "Fehler"
Print Lasterrorstring()
-----Maskierung um an die einzelnen Bits zu kommen
If Ret&
Casenot Modemstatus& & $Ff : Print "alles auf LOW"
Case Modemstatus& & &Cts_on : Print "CTS ON"
Case Modemstatus& & &Dsr_on : Print "DSR ON"
Case Modemstatus& & &Ring_on : Print "Ring ON"
Case Modemstatus& & &Rlsd_on : Print "RLSD ON"
Endif
Waitinput
Print "Start"
Declare Zeit&,Stop&,Count&
Zeit& = &Gettickcount
Whilenot Stop&
Whileloop 10
Ret& = Getcommmodemstatus(Hport&,Addr(Modemstatus&))
print modemstatus&,"";
Inc Count&
Endwhile
Sleep 1
Case &Gettickcount - Zeit& > 50 : Stop& = 1
Endwhile
Print ""
Print &Gettickcount - Zeit&
Print "durchläufe :",Count&
Closecom(Hport&pan>
Waitinput
deference : The USB COM Adapter created a virtual COM Port.You must The address from the in the program then take.
all Steuerleitungen give +12 V or. volume from.The Schreibleitung +/- 12 To max. 20 Volt. No pipeline can a LED directly drive.You need a Transistortreiberstufe. Machste on the USB "Mist" is guaranteeing your Mainboard there.means beautiful with Optokoppler works. the very best is naturally one MAX232 Spannungspegelwandler.
here becomes too The Computeranbindung well described : [...]
here GEHTS too circa USB - Seriell [...]
Hello Georg |
|
|
| |
|
|