RxBuff_E0 ?

  • 1
  • 2
  • 3
  • Page 1 of 3
TheBeginner
Schreiberling
Avatar
Gender: n/a
Location: Wunsiedel Bayern
Age: 67
Posts: 755
Registered: 06 / 2013
Subject:

RxBuff_E0 ?

 · 
Posted: 16.04.2022 - 13:02  ·  #1
Hallo zusammen und Frohe Ostern

Woher weiß ich wieviele Zeichen jetzt im RxBuff_E0 sind ?

Code

Process Read_E0($150 , $150 : iData);
Begin
  WaitPipe(RxBufferE0);                          
  SerInpBlockP_TO(UsartE0, @RxBuff_E0, 254, 10); 





Gruß Frank
pvs-deck
PowerUser
Avatar
Gender:
Age: 53
Homepage: pvs-deck.de
Posts: 1340
Registered: 02 / 2009
Subject:

Re: RxBuff_E0 ?

 · 
Posted: 16.04.2022 - 13:49  ·  #2
Hallo Frank,

das mache ich mit einer While Schleife in Verbindung mit einer SerStat_xx Funktion, aber es gibt mehrere Wege.

Einer meiner Codes als Beispiel:
Code

  if WaitPipe( RxBufferC0, 30 ) then
     inZKS[79]:=0; // lösche EingangsBuffer Zähler auf 0
         rxCnt:= 0;

       while SerStatC0  do  //Daten vorhanden dann abarbeiten
       
         if not SerInpBlock_TO( UsartC0, inByte, 1) then
          // in TimeOut gelaufen, keine Daten verwerten!!!
           zksClearIn();
             return(0);
         endif;
         
          inZKS[rxCnt]:= inByte; // lege Daten im Empfangsspeicher ab und zähle
           inc(rxCnt);

          // Bereits Telegramm vorhanden? Dann raus, rest im nächsten Aufruf abholen
          if    (inByte1=$10) AND  (inByte=$06)  then break;
          elsif (inByte1=$10) AND  (inByte=$15)  then break;
          elsif (inByte3=$10) AND  (inByte2=$03) then break;
          Endif;
           // Versatz für Auswertung...
           inByte3:=inByte2; inByte2:=inByte1; inByte1:=inByte;      // hier evtl Prüfen!!!
       endwhile;

       inZKS[79]:= rxCnt; // setze Datenmenge in den Empfangsbuffer

        return(rxCnt);

  else // Waitpipe
   inZKS[79]:=0; // lösche EingangsBuffer Zähler auf 0
    return(0);  // TimeOut WaitPipe
   
  endif; // Waitpipe


Gruß
Thorsten
TheBeginner
Schreiberling
Avatar
Gender: n/a
Location: Wunsiedel Bayern
Age: 67
Posts: 755
Registered: 06 / 2013
Subject:

Re: RxBuff_E0 ?

 · 
Posted: 16.04.2022 - 17:14  ·  #3
Hallo Thorsten, ich habe es jetzt so gemacht und
es geht 100%

Danke für deine Hilfe.

Code

//==============================================================================
Process Read_E0($150 , $150 : iData);
Begin
  if WaitPipe( RxBufferE0 ) then
    rxCnt:= 0;
    while SerStatE0  do
      RxBuff_E0[rxCnt]:= byte(SerInpE0);
      rxCnt:= rxCnt + 1;
    endwhile;
    rxCnt:= rxCnt - 1;
    SerOutBlock_P(UsartCDC, @RxBuff_E0, rxCnt);
  endif;
end;


Gruß Frank
pvs-deck
PowerUser
Avatar
Gender:
Age: 53
Homepage: pvs-deck.de
Posts: 1340
Registered: 02 / 2009
Subject:

Re: RxBuff_E0 ?

 · 
Posted: 16.04.2022 - 17:36  ·  #4
Hallo Frank,

freut mich.

Gruß
Thorsten
Harry
Moderator
Avatar
Gender:
Location: zwischen Augsburg und Ulm
Age: 59
Posts: 2090
Registered: 03 / 2003
Subject:

Re: RxBuff_E0 ?

 · 
Posted: 16.04.2022 - 19:20  ·  #5
Es gibt eine interne Variable, die das beinhaltet.

Harry
TheBeginner
Schreiberling
Avatar
Gender: n/a
Location: Wunsiedel Bayern
Age: 67
Posts: 755
Registered: 06 / 2013
Subject:

Re: RxBuff_E0 ?

 · 
Posted: 16.04.2022 - 20:21  ·  #6
Ja Harry die hätte ich gerne gewusst, dann wäre es doch einfacher.


Gruß Frank
pvs-deck
PowerUser
Avatar
Gender:
Age: 53
Homepage: pvs-deck.de
Posts: 1340
Registered: 02 / 2009
Subject:

Re: RxBuff_E0 ?

 · 
Posted: 16.04.2022 - 22:48  ·  #7
Quote by Harry

Es gibt eine interne Variable, die das beinhaltet.

Harry


Hallo Harry,

wo ist das dokumentiert?

Gruß
Thorsten
Gunter
Administrator
Avatar
Gender:
Location: Frankfurt Main / Germany
Posts: 1697
Registered: 02 / 2003
Subject:

Re: RxBuff_E0 ?

 · 
Posted: 16.04.2022 - 23:59  ·  #8
INTERNE Variablen sind nicht dokumentiert.
Im .asm sollte der Name leicht erkennbar sein
Gunter
  • 1
  • 2
  • 3
  • Page 1 of 3
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 15 · Cache Hits: 14   140   154 · Page-Gen-Time: 0.022426s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI