<div dir="ltr"><div><div><div><div><div>OK hans, and tobias, yes the code in my first mail last week was bad, <br>now i understant some problems when i read agains the printert<br>but i need and i want a manual read funtion "also": so i have now:<br></div><br></div>the read event for the port, as documents suggest "is triggered" <br>when data "can be read" so if there's some data to read or available <br>the event will be executed by itselft, but i want also a manual "rp" method <br>that read also the port manually, at this point i dont know <br>if will be sync or async, i have a "sale" class that will be polled into a form, <br>but as Tobias said i used the Scom_Read <br>but still need a manual read funtion due the inherits  so i have :<br><br></div>1) the read event:<br><br>' this event will be triggered in read operations by the stream when data its available<br>Public Sub SComm_Read()<br>   dim buffers as string = ''<br>  Read #SComm, buffers, Lof(SComm)<br></div><div>   dataread &= buffers<br></div><div>End<br><br></div>2) here, how can i code a read manual operation do not conflict if there's already an operation triggered by teh read event?<br><br></div><div>i used some code proposed by Tobias but:<br></div><div><br>'' generic read port buffer data<br>Public Sub rp()<br>   dim  start as date = Now<br></div>   dim buffers as string = ''<div>
  Do<br>
    Wait 0.1<br>
    Read #SComm, buffers, Lof(SComm)<br>
    dataread &= buffers<br>
  Loop Until DateDiff(start, Now, gb.Millisecond) > 500<br>End<br><div><div><br><div><div>now i have the problem of locking, as Tobias said I not even sure how Read <br>behaves when Lof is zero or if the read are just triggered at same time the rp was invoqued!<br>so then reading would block.<br><br>i dont know how to use the SComm.Blocking = False to make manual polling, <br><br><br clear="all"><div><div><div dir="ltr" class="gmail-m_-3458761507496970693gmail_signature"><font color="#888888">Lenz McKAY Gerardo (PICCORO)</font><div><font color="#888888"><a href="http://qgqlochekone.blogspot.com" target="_blank">http://qgqlochekone.blogspot.com</a></font></div></div></div><br></div></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr">El lun., 6 de ago. de 2018 a la(s) 09:59, PICCORO McKAY Lenz (<a href="mailto:mckaygerhard@gmail.com" target="_blank">mckaygerhard@gmail.com</a>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">El lun., 6 de ago. de 2018 a la(s) 09:52, Hans Lehmann (<a href="mailto:hans@gambas-buch.de" target="_blank">hans@gambas-buch.de</a>) escribió:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <font size="+1"><font face="DejaVu Sans Mono">have a look at the chapters and the projects... under
        <a class="m_-3458761507496970693m_105015701730977304m_8528759798358242718moz-txt-link-freetext" href="https://www.gambas-buch.de/doku.php?id=k24:k24.1:k24.1.5:start" target="_blank">https://www.gambas-buch.de/doku.php?id=k24:k24.1:k24.1.5:start</a>!<br></font></font></div></blockquote><div>THANKS HANS! now reading...<br></div><div> isend this mail to the list.. maybe you send too quickly and forgett to do!</div><br><br></div></div>
</blockquote></div>