<?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[Serielle Schnittstelle]]></title><description><![CDATA[<p>Guten Abend Allerseits</p>
<p>Ich habe da eine Frage an euch:<br />
Wie kann ich von einem Microcontorller via serielle Schnittstlle einen Wert abfragen?</p>
<p>Der Microcontoller berechnet laufend 4 Werte, welche ich Holen muss und das ganze dann abspeichern sollt.</p>
<p>Ich hoffe, ihr könnt mir da helfen.<br />
Bin kurz vor dem Verzweifeln, da ich das für meine Abschlussarbeit benötige!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/174665/serielle-schnittstelle</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 14:28:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/174665.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Mar 2007 18:50:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Serielle Schnittstelle on Thu, 01 Mar 2007 18:50:19 GMT]]></title><description><![CDATA[<p>Guten Abend Allerseits</p>
<p>Ich habe da eine Frage an euch:<br />
Wie kann ich von einem Microcontorller via serielle Schnittstlle einen Wert abfragen?</p>
<p>Der Microcontoller berechnet laufend 4 Werte, welche ich Holen muss und das ganze dann abspeichern sollt.</p>
<p>Ich hoffe, ihr könnt mir da helfen.<br />
Bin kurz vor dem Verzweifeln, da ich das für meine Abschlussarbeit benötige!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1237675</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237675</guid><dc:creator><![CDATA[juergschweizer]]></dc:creator><pubDate>Thu, 01 Mar 2007 18:50:19 GMT</pubDate></item><item><title><![CDATA[Reply to Serielle Schnittstelle on Thu, 01 Mar 2007 19:03:09 GMT]]></title><description><![CDATA[<p><a href="http://www.google.com/codesearch?q=microcontroller" rel="nofollow">microcontroller</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1237679</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1237679</guid><dc:creator><![CDATA[lucki lucki]]></dc:creator><pubDate>Thu, 01 Mar 2007 19:03:09 GMT</pubDate></item><item><title><![CDATA[Reply to Serielle Schnittstelle on Sun, 04 Mar 2007 13:47:11 GMT]]></title><description><![CDATA[<p>Danke für die Amtwort.<br />
Hat aber niemand so etwas schon mal gemacht und könnte mir einfach den Quelltext einstellen. Das wäre natürlich sehr hilfsreich.</p>
<p>Danke an alle</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1238950</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1238950</guid><dc:creator><![CDATA[juergschweizer]]></dc:creator><pubDate>Sun, 04 Mar 2007 13:47:11 GMT</pubDate></item><item><title><![CDATA[Reply to Serielle Schnittstelle on Sun, 04 Mar 2007 14:01:32 GMT]]></title><description><![CDATA[<p>juergschweizer schrieb:</p>
<blockquote>
<p>Hat aber niemand so etwas schon mal gemacht und könnte mir einfach den Quelltext einstellen. Das wäre natürlich sehr hilfsreich.</p>
</blockquote>
<p>Ist das Thema der Abschlussarbeit &quot;Wie lasse ich andere meine Arbeit machen, wenn ich nicht willens oder in der Lage bin, mein Problem hinreiched genau zu beschreiben, und außerdem zu faul zum Suchen&quot;?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1238962</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1238962</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Sun, 04 Mar 2007 14:01:32 GMT</pubDate></item><item><title><![CDATA[Reply to Serielle Schnittstelle on Sun, 04 Mar 2007 14:14:10 GMT]]></title><description><![CDATA[<p>hmm, ich bin nicht zu fausl, um das zu lernen, ich wurde einfach schlicht weg mit meiner Aufgabe überrannt. Zudem bin ich mit meiner Gesundheit nicht mehr wirlich auf Fordemann (Nervenschwäche).</p>
<p>Ich wäre auch Hilfsbereit, wenn ich es könnte, aber ich muss für meine Aufgabe extra in 4 Wochen à 3 Tage C++ lernen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1238973</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1238973</guid><dc:creator><![CDATA[juergschweizer]]></dc:creator><pubDate>Sun, 04 Mar 2007 14:14:10 GMT</pubDate></item><item><title><![CDATA[Reply to Serielle Schnittstelle on Sun, 04 Mar 2007 15:36:32 GMT]]></title><description><![CDATA[<p>Falls Du auf Deinem PC Windows benutzt, so findest Du <a href="http://www.codeproject.com/system/serial.asp" rel="nofollow">hier</a> eine ganz gute Lösung.</p>
<p>Gruß<br />
Werner</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1239032</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1239032</guid><dc:creator><![CDATA[Werner Salomon]]></dc:creator><pubDate>Sun, 04 Mar 2007 15:36:32 GMT</pubDate></item><item><title><![CDATA[Reply to Serielle Schnittstelle on Sun, 04 Mar 2007 15:42:14 GMT]]></title><description><![CDATA[<p>im faq dos/win32 konsole ist unter dem beitrag ströme auch ein guter artikel.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1239035</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1239035</guid><dc:creator><![CDATA[elise]]></dc:creator><pubDate>Sun, 04 Mar 2007 15:42:14 GMT</pubDate></item><item><title><![CDATA[Reply to Serielle Schnittstelle on Mon, 05 Mar 2007 14:00:29 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-403.html" rel="nofollow">HumeSikkins</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-4.html" rel="nofollow">WinAPI</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" 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/1239550</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1239550</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 05 Mar 2007 14:00:29 GMT</pubDate></item><item><title><![CDATA[Reply to Serielle Schnittstelle on Tue, 06 Mar 2007 08:20:30 GMT]]></title><description><![CDATA[<p>Hallo<br />
Danke für die Antworten.<br />
Ich habe dazu auch noch ein Buch gefunden, welches mir viel geholfen hat.<br />
Leider habe ich da aber auch noch ein Problem.<br />
Ich weiss nicht, an was dass es liegt, aber auch die Lösungen zu den AUfgaben vom Buch gehen nicht! (genau den gleichen Fehler wie ich).</p>
<p>So nun genug, jetzt kommt mal mein Code:</p>
<pre><code class="language-cpp">//---------------------------------------------------------------------------

#include &lt;vcl.h&gt;
#include &lt;windows.h&gt;
#pragma hdrstop

#include &quot;Unit1.h&quot;
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource &quot;*.dfm&quot;
TForm1 *Form1;
HANDLE hComSend, hComRecive;
int j;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void ShowLastError(AnsiString where)
{
MessageBox(NULL,SysErrorMessage(GetLastError()).c_str(),where.c_str(),MB_OK|MB_ICONERROR);
}
//----------------------------------------------------------------------------

HANDLE OpenComm(char* Port)
       {
       HANDLE hCom = CreateFile(Port, GENERIC_READ|GENERIC_WRITE,0,0,OPEN_EXISTING,0,0);
       if(hCom == INVALID_HANDLE_VALUE)
          ShowLastError(&quot;CreateFile: &quot;+AnsiString(&quot;Port&quot;));
       return hCom;
       }
//----------------------------------------------------------------------------

void SetDCB(HANDLE hCom)
{
DCB dcb;
BOOL fSuccess = GetCommState(hCom, &amp;dcb);
dcb.BaudRate = 4800;
dcb.ByteSize = 7;
dcb.Parity = NOPARITY;
dcb.StopBits = ONESTOPBIT;
fSuccess = SetCommState(hCom, &amp;dcb);
if(!fSuccess) ShowLastError(&quot;SetCommState&quot;);
}
//----------------------------------------------------------------------------

void SetReadTimeouts(HANDLE hCom)
{
 COMMTIMEOUTS t;
 t.ReadIntervalTimeout = 100;
 t.ReadTotalTimeoutMultiplier=0;
 t.ReadTotalTimeoutConstant = 1;

 t.WriteTotalTimeoutMultiplier=0;
 t.WriteTotalTimeoutConstant=0;
 if(!SetCommTimeouts(hCom,&amp;t))
    ShowLastError(&quot;SetCommTimeouts&quot;);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
hComSend = OpenComm(&quot;COM1&quot;);
hComRecive=OpenComm(&quot;COM1&quot;);
SetDCB(hComSend);
SetDCB(hComRecive);
SetReadTimeouts(hComRecive);        
}

//----------------------------------------------------------------------------
int SendData(Char Data[], int n)
{
DWORD NumberOfBytesWritten;
bool b=WriteFile(hComSend,Data,n,&amp;NumberOfBytesWritten,0);
if(!b)
   ShowLastError(&quot;WriteFile&quot;);
return NumberOfBytesWritten;
}
//----------------------------------------------------------------------------
DWORD ReciveData(char*Data, int n)
{
DWORD NumberOfBytesRead;
bool b=ReadFile(hComRecive,Data,n,&amp;NumberOfBytesRead,0);
if(!b)
   ShowLastError(&quot;ReadFile&quot;);
return NumberOfBytesRead;
}

//---------------------------------------------------------------------------

void __fastcall TForm1::sendenClick(TObject *Sender)
{
int n=SendData(&quot;Hallo&quot;,5);
Memo1-&gt;Lines-&gt;Add(&quot;Written: &quot;+IntToStr(n));
}
//---------------------------------------------------------------------------

void __fastcall TForm1::empfangenClick(TObject *Sender)
{
        for(j=0; j&lt;10; j++)
        {
        Sleep(100);
        const int BufSize = 4;
        char Buffer[BufSize];
        DWORD NumberOfBytesRead = ReciveData(Buffer,BufSize);
        if(NumberOfBytesRead&gt;0)
                {
                AnsiString s;
                for (DWORD i=0; i&lt;NumberOfBytesRead; i++)
                        s=s+Buffer[i];
                Memo1-&gt;Lines-&gt;Add(&quot;Gelesen n=&quot;+IntToStr(NumberOfBytesRead)+&quot; ch=&quot;+s);
                }
                else
                  Memo1-&gt;Lines-&gt;Add(&quot;Nichts empfangen&quot;);
        }
}
//---------------------------------------------------------------------------
</code></pre>
<p>Evt. muss ich ja noch etwas im Header-File machen, habe aber keine Ahnung was.<br />
Ach ja, das ganze mache ich im Borland C++ Builder 5.</p>
<p>Also die Meldung sind Folgende:<br />
Beim starten: Zugriff verweigert!<br />
Handle ist unglültig für jede Schnittstelle.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1240014</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1240014</guid><dc:creator><![CDATA[juergschweizer]]></dc:creator><pubDate>Tue, 06 Mar 2007 08:20:30 GMT</pubDate></item><item><title><![CDATA[Reply to Serielle Schnittstelle on Wed, 07 Mar 2007 08:25:52 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>was mir beim schnellen drüberlesen aufgefallen ist!<br />
In deiner Funktion:</p>
<pre><code class="language-cpp">void __fastcall TForm1::FormCreate(TObject *Sender)
</code></pre>
<p>Versuchts du <strong>2 mal</strong> deine COM1 zuöffnen. Dies ist aber bei der exclusiven Nutzung der SeriellenCom unzulässig. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f4a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--light_bulb"
      title=":bulb:"
      alt="💡"
    /> Deshalb die Fehlermeldung</p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/26a0.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--warning"
      title=":warning:"
      alt="⚠"
    /> Außerdem: Zum Lesen und Schreiben reicht ein Handel aus. Welches du beim Öffnen über deine Funktion CreateFile zurück bekommst.<br />
Also statt hComReceive -&gt; hComSend benützen</p>
<p>Sonnige Grüsse</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1240745</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1240745</guid><dc:creator><![CDATA[TheFatal]]></dc:creator><pubDate>Wed, 07 Mar 2007 08:25:52 GMT</pubDate></item><item><title><![CDATA[Reply to Serielle Schnittstelle on Tue, 13 Mar 2007 09:19:24 GMT]]></title><description><![CDATA[<p>Hallo<br />
Vielen Dank für deine Antwort.<br />
Ich habe es nun geschafft!</p>
<p>Nur schreiben kann ich noch nicht. Da bin ich momentan noch beschäftigt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1244532</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1244532</guid><dc:creator><![CDATA[juergschweizer]]></dc:creator><pubDate>Tue, 13 Mar 2007 09:19:24 GMT</pubDate></item></channel></rss>