HomeArtikelDownloadsForum
PCFreunde.deForumEntwicklungC#, .NET
Besucher online: 796
Schnellsuche

Anzeigen

Community

Foren
C#, .NET Seite 1/1
C# RS 232 Schnittstelle ansteuern?
AntwortenNeues ThemaZur Themenliste
Seiten:
1
Nachricht
SHADOWBEAST
Titel: C# RS 232 Schnittstelle ansteuern? 29.01.2010 17:41
874 Punkte (?)
Anmeldungsdatum: 10.07.2008
Beiträge: 188
Tutorial Autor (?)
Hi Leute!
Ich habe gerade auf einer kleinen Platine von einem Experimentier Kasten einen "Versuch" aufgebaut, der wie folgt aussieht:

Ich habe ein LED (GND und RTS) und noch eine LED (GND und DTR) angehängt.

Jetzt möchte ich die LED´s bzw. die Stromzufuhr ändern, und so die LEE´s schalten. Bei diesem Kasten ist war ein Programm dafür dabei, allerdings in Visual Basic 3. Kann mir wer sagen wie das geht? Hier ist der VB3 Code vllt. hilft der ja...

Zitat:
Declare Function OPENCOM Lib "RSLINE.DLL" (ByVal A As Integer) As Integer
Declare Sub Delay Lib "RSLINE.DLL" (ByVal Zeit As Integer)
Declare Sub DTR Lib "RSLINE.DLL" (ByVal An As Integer)
Declare Sub RTS Lib "RSLINE.DLL" (ByVal An As Integer)
Declare Sub TXD Lib "RSLINE.DLL" (ByVal An As Integer)
Declare Function CTS Lib "RSLINE.DLL" () As Integer
Declare Function DCD Lib "RSLINE.DLL" () As Integer
Declare Function DSR Lib "RSLINE.DLL" () As Integer
Declare Function RI Lib "RSLINE.DLL" () As Integer
Declare Sub TimeINIT Lib "RSLINE.DLL" ()
Declare Function TIMEREAD Lib "RSLINE.DLL" () As Integer

Sub Command1_Click ()
RTS 1
Picture1.BackColor = &HFF00&
End Sub

Sub Command2_Click ()
RTS 0
Picture1.BackColor = &HC0C0C0
End Sub

Sub Command3_Click ()
DTR 1
Picture2.BackColor = &HFF00&
End Sub

Sub Command4_Click ()
DTR 0
Picture2.BackColor = &HC0C0C0
End Sub

Sub Command5_Click ()
TXD 1
Picture3.BackColor = &HFF00&
End Sub

Sub Command6_Click ()
TXD 0
Picture3.BackColor = &HC0C0C0
End Sub

Sub Form_Load ()
If App.PrevInstance Then
msg$ = App.EXEName & " wurde bereits gestartet "
MsgBox msg$, 48
End
End If
i = OPENCOM(2)
If i = 0 Then
i = OPENCOM(1)
Option1.Value = True
End If
If i = 0 Then MsgBox ("Schnittstelle nicht verfügbar")
TXD 0
Picture1.BackColor = &HC0C0C0
RTS 0
Picture2.BackColor = &HC0C0C0
DTR 0
Picture3.BackColor = &HC0C0C0
End Sub

Sub Option1_Click ()
i = OPENCOM(1)
If i = 0 Then MsgBox ("COM1 nicht verfügbar")
TXD 0
Picture1.BackColor = &HC0C0C0
RTS 0
Picture2.BackColor = &HC0C0C0
DTR 0
Picture3.BackColor = &HC0C0C0
End Sub

Sub Option2_Click ()
i = OPENCOM(2)
If i = 0 Then MsgBox ("COM2 nicht verfügbar")
TXD 0
Picture1.BackColor = &HC0C0C0
RTS 0
Picture2.BackColor = &HC0C0C0
DTR 0
Picture3.BackColor = &HC0C0C0
End Sub


Vielen Dank Maximilian

________________________________________
MfG. Maximilian :)
Private Nachricht senden  
 
SHADOWBEAST
Titel: C# RS 232 Schnittstelle ansteuern? 29.01.2010 19:31
874 Punkte (?)
Anmeldungsdatum: 10.07.2008
Beiträge: 188
Tutorial Autor (?)
DANKE habs gelöst, bin auf Visual Basic umgestiegen!

________________________________________
MfG. Maximilian :)
Private Nachricht senden  
 
AntwortenNeues ThemaZur Themenliste
Seiten:
1
Community Login
eMail:
Passwort:
Auto-Login