English
Forum

LED and switch off

 

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
 


OS: Win XP/Debian
XProfan 10
07/26/08  
 



are here correctly. or should I move?

Mainpage » IDE, aide, Tools and Precompiler » Profan2Cpp-Support, Profansource to C++
 
07/26/08  
 




Penguin
Tux
Oh, my Error. does me sorrow, naturally should You move.
 


OS: Win XP/Debian
XProfan 10
07/26/08  
 



Fühl you shoved...
 
07/26/08  
 




GDL
Hi,

here's of many Communityautoren and me Zusammengetragenes.
Perhaps helps it to you what.
CompileMarkSeparation
Def 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
 
Windows7 Xprofan 8,9,10 [...]  [...] 
07/26/08  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

4.104 Views

Untitledvor 0 min.
Peter Max Müller11/13/17
Ludwig Albien01/04/13
Heiko Dix11/13/12
Pedro Miguel09/17/12

Themeninformationen

this Topic has 3 subscriber:

Penguin Tux (2x)
iF (2x)
GDL (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie