ERLEDIGT
NEIN
NEIN
ANTWORTEN
0
0
ZUGRIFFE
2744
2744
EMPFEHLEN
-
Hallo,
ich versuche ein Byte auf die RS232 Schnittstelle auszugeben,
funktioniert aber nicht, was mache ich falsch?
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//INITIALISIEREN DER RS232 MIT BUTTOMCLICK//
void __fastcall TTIMERTICK::Button3Click(TObject *Sender)
{
chandle = CreateFile ("COM1",GENERIC_READ | GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);
if (chandle == INVALID_HANDLE_VALUE)
{
Application->MessageBox("RS232 IS INT","RS232",MB_OK | MB_ICONINFORMATION);
}
else
{
wsprintf(error,"RS232 INIT ERROR WITH %d ERRORS", GetLastError());
Application->MessageBox(error,"RS232",MB_OK | MB_ICONINFORMATION);
}
dcb.BaudRate = CBR_57600; // set the baud rate
dcb.ByteSize = 8; // data size, xmit, and rcv
dcb.Parity = NOPARITY; // no parity bit
dcb.StopBits = ONESTOPBIT; // one stop bit
SetCommState(chandle, &dcb);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//RS232 SENDEN MIT BUTTOMCLICK//
//---------------------------------------------------------------------------
void __fastcall TTIMERTICK::Button2Click(TObject *Sender)
{
x = 0;
WriteFile(chandle,&x,1,0,0);
Application->MessageBox("WRITE TO RS232","RS232",MB_OK | MB_ICONINFORMATION);
}
Ähnliche Themen
-
RS232 Schnittstelle
Von MedRamBO im Forum CGI, Perl, Python, Ruby, Power ShellAntworten: 1Letzter Beitrag: 13.08.09, 19:31 -
rs232 ansteuer
Von mork im Forum Delphi, Kylix, PascalAntworten: 1Letzter Beitrag: 15.07.06, 06:29 -
Übertragung mit RS232
Von Ilona85 im Forum Visual Basic 6.0Antworten: 5Letzter Beitrag: 01.06.05, 15:13 -
Rs232 Lcd
Von gross_friedrich im Forum Delphi, Kylix, PascalAntworten: 0Letzter Beitrag: 18.03.05, 15:38 -
rs232 in C#
Von SoundEngineer im Forum C/C++Antworten: 2Letzter Beitrag: 04.06.02, 11:15





Zitieren
Login






