Autor Beitrag
Grolle Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 95

Win XP, Win 7
Delphi 2010 Pro
BeitragVerfasst: Mi 04.05.05 10:22 
Hi!
Funktioniert leider auch so nicht!
Sollte ich mich nach einer komplett
anderen Lösung umsehen?
chrisw
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 439
Erhaltene Danke: 3

W2K
D7
BeitragVerfasst: Mi 04.05.05 10:49 
Probier mal das hier !
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
//globale variable    
RS232Active : Boolean;  
tempBuffer     : String;   //als temporärer Buffer  
//im OnCreate der Form    
RS232Active := False;    
//Einen Timer einfügen in dem nach 2 Sekunden (2000 im Interval eintragen)     
procedure TForm1.Timer1Timer(Sender: TObject);    
begin    
  RS232Active := False;      //RS232 nicht mehr aktiv
  with TStringList.Create do //Abspeichern
  try
    Text := tempBuffer;
    SaveToFile('c:\test.txt'); 
  finally
    Free;
  end;
   tempBuffer := ''// Buffer Löschen   
end;    

procedure TForm1.ApdComPort1TriggerAvail(CP: TObject; Count: Word);      
  {Event OnTriggerAvail - Example how OnTriggerAvail works}      
var      
  I : Word;      
begin      
  RS232Active := True;    //RS232 ist aktiv
  Timer1.enabled := False; // Timer neustarten !!    
  Timer1.enabled := True;    
  for I := 1 to Count do tempBuffer := tempBuffer + ApdComPort1.GetChar;      //Empfangene Zeichen nach tempBuffer
 end;

_________________
Man sollte keine Dummheit zweimal begehen, die Auswahl ist schließlich groß genug.