<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[eingehende Daten abfangen(Rs232)]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich hätte da mal ne farge gibts ne möglichkeit unter windows eingehende Daten auf der Rs232 abzufangen ohne in einer schleife die ganze zeit abzufragen ob Daten im Eingangspuffer Daten enthalten sind.</p>
<p>Dachte da an eine Lösung wie Signals oder so..</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/158270/eingehende-daten-abfangen-rs232</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 01:12:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/158270.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 03 Sep 2006 18:03:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to eingehende Daten abfangen(Rs232) on Sun, 03 Sep 2006 18:03:26 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich hätte da mal ne farge gibts ne möglichkeit unter windows eingehende Daten auf der Rs232 abzufangen ohne in einer schleife die ganze zeit abzufragen ob Daten im Eingangspuffer Daten enthalten sind.</p>
<p>Dachte da an eine Lösung wie Signals oder so..</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1130333</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1130333</guid><dc:creator><![CDATA[Neo120484]]></dc:creator><pubDate>Sun, 03 Sep 2006 18:03:26 GMT</pubDate></item><item><title><![CDATA[Reply to eingehende Daten abfangen(Rs232) on Mon, 04 Sep 2006 02:57:49 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=403" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=4" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1130507</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1130507</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 04 Sep 2006 02:57:49 GMT</pubDate></item><item><title><![CDATA[Reply to eingehende Daten abfangen(Rs232) on Mon, 04 Sep 2006 06:01:43 GMT]]></title><description><![CDATA[<p>Du kannst z.B. mit Events arbeiten und alles ganz selber machen, oder Du verwendest einfach eine fertige Klasse:<br />
<a href="http://www.codeproject.com/system/serial.asp" rel="nofollow">http://www.codeproject.com/system/serial.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1130524</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1130524</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 04 Sep 2006 06:01:43 GMT</pubDate></item><item><title><![CDATA[Reply to eingehende Daten abfangen(Rs232) on Mon, 04 Sep 2006 08:08:35 GMT]]></title><description><![CDATA[<p>danke ich hätte das ganze wieder selber gemacht aber jetzt versuch ich erstmal die fertige Klasse</p>
<p>gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1130558</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1130558</guid><dc:creator><![CDATA[Neo120484]]></dc:creator><pubDate>Mon, 04 Sep 2006 08:08:35 GMT</pubDate></item><item><title><![CDATA[Reply to eingehende Daten abfangen(Rs232) on Fri, 08 Sep 2006 05:45:11 GMT]]></title><description><![CDATA[<p>Edit: Ich sehe gerade das das viel zu umständlich ist das mit den WinAPI Threads zu machen da ja Qt (worauf mein main Programm hauptsächlich basiert) eine eigene Klasse für Threads implementiert..</p>
<p>-------------------------------------------------------------------------------</p>
<p>tag hätte da kurz mal ne frage noch irgendwie haut das bei mir noch nicht so hin...</p>
<p>hier mal mein Code vielleicht findet ja jemand von euch den fehler oder kann mir sagen wo ich falsch gedacht hab..</p>
<pre><code class="language-cpp">DCB dcb;
       unsigned long threadId;
    struct setting
    {
    char baud[10];
    char data[2];
    char stop[2];
    char port[5];
    char con[40];
    };

    setting settingdat;

    strncpy(settingdat.con,&quot;&quot;,39);

    ifstream quelle(&quot;connection.dat&quot;,ios::in);
    quelle.getline(settingdat.baud,sizeof(settingdat.baud));
    quelle.getline(settingdat.data,sizeof(settingdat.data));
    quelle.getline(settingdat.stop,sizeof(settingdat.stop));
    quelle.getline(settingdat.port,sizeof(settingdat.port));

    quelle.close();

    hComm = CreateFile(settingdat.port,GENERIC_READ | GENERIC_WRITE,0,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);

    if (hComm == INVALID_HANDLE_VALUE)
        {
            Error err(&quot;error opening port.&quot;);
            err.exec();
        }

    FillMemory(&amp;dcb, sizeof(dcb), 0);
    dcb.DCBlength = sizeof(dcb);

    strncat(settingdat.con,settingdat.baud,sizeof(settingdat.baud)-1);
    strncat(settingdat.con,&quot;,&quot;,1);
    strncat(settingdat.con,&quot;n&quot;,1);
    strncat(settingdat.con,&quot;,&quot;,1);
    strncat(settingdat.con,settingdat.data,sizeof(settingdat.baud)-1);
    strncat(settingdat.con,&quot;,&quot;,1);
    strncat(settingdat.con,settingdat.stop,sizeof(settingdat.baud)-1);

    if (!BuildCommDCB(settingdat.con, &amp;dcb))
    {
        Error err(&quot;Couldn't build the DCB. Usually a problem with the communications specification string.&quot;);
        err.exec();
        return FALSE;
    }
    else
    {
        dcb.fRtsControl = RTS_CONTROL_DISABLE;
        dcb.fDtrControl = DTR_CONTROL_DISABLE;

        // Set new state.
        if (!SetCommState(hComm, &amp;dcb))
            {
            Error err(&quot;Error in SetCommState. Possibly a problem with the communications port handle or a problem with the DCB structure itself.&quot;);
            err.exec();
            }
    }

    threading = true;
    HANDLE hThread = CreateThread(NULL,0,this-&gt;pi_read,1,0, &amp;threadId);

return TRUE;
</code></pre>
<pre><code class="language-cpp">void *Port_Interface::pi_read(LPVOID lpvoid)
{
    while(threading)
    {
        ReadFile(hComm,&amp;lpBuf,1, &amp;dwBytesRead,&amp;ov);
        WaitForSingleObject(hComm,INFINITE);
        GetOverlappedResult(hComm,NULL,&amp;dwBytesRead,FALSE);
    }

}
</code></pre>
<p>Leider bekomme ich bein Compelieren beim initialisieren des Threads einen Fehler mit der Funktion und ich weiß leider nicht wieso</p>
<p>Kann mir da von euch jemand sagen was ich falsch mach?</p>
<p>wäre nett<br />
gruß</p>
<p>Dominik</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1133086</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1133086</guid><dc:creator><![CDATA[Neo120484]]></dc:creator><pubDate>Fri, 08 Sep 2006 05:45:11 GMT</pubDate></item></channel></rss>