<?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[CAN - BUS über CancardX ansprechen]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich habe folgendes Problem:</p>
<p>Ich möchte mit der &quot;CanCardX&quot; von &quot;Vector&quot; auf einen CanBus zugreifen. Dafür muss ich aber die VCan32.dll in mein Projekt einbinden.<br />
Um dies zu tun, soll man die &quot;loadlib.cpp&quot; in sein Projekt einfügen.</p>
<p>Ich bekomme aber beim Übersetzen des Programms folgende Fehlermeldung:<br />
.... loadlib.cpp(23):E2141 Fehler in der Deklarationssyntax<br />
.... loadlib.cpp(24):E2141 Fehler in der Deklarationssyntax<br />
(25)...</p>
<p>Hat jemand schon mal mit so einer PCMCIA - Karte von der Firma &quot;Vector&quot; gearbeitet?</p>
<p>Gruss,<br />
lautiba.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/106515/can-bus-über-cancardx-ansprechen</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 08:10:43 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/106515.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 11 Apr 2005 06:10:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CAN - BUS über CancardX ansprechen on Mon, 11 Apr 2005 06:10:09 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich habe folgendes Problem:</p>
<p>Ich möchte mit der &quot;CanCardX&quot; von &quot;Vector&quot; auf einen CanBus zugreifen. Dafür muss ich aber die VCan32.dll in mein Projekt einbinden.<br />
Um dies zu tun, soll man die &quot;loadlib.cpp&quot; in sein Projekt einfügen.</p>
<p>Ich bekomme aber beim Übersetzen des Programms folgende Fehlermeldung:<br />
.... loadlib.cpp(23):E2141 Fehler in der Deklarationssyntax<br />
.... loadlib.cpp(24):E2141 Fehler in der Deklarationssyntax<br />
(25)...</p>
<p>Hat jemand schon mal mit so einer PCMCIA - Karte von der Firma &quot;Vector&quot; gearbeitet?</p>
<p>Gruss,<br />
lautiba.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/763808</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/763808</guid><dc:creator><![CDATA[lautiba]]></dc:creator><pubDate>Mon, 11 Apr 2005 06:10:09 GMT</pubDate></item><item><title><![CDATA[Reply to CAN - BUS über CancardX ansprechen on Mon, 11 Apr 2005 06:25:52 GMT]]></title><description><![CDATA[<p>äh ja, leider wissen wir alle nicht was für Zeilen dennd ie Zeilen 23-25 sind, ne?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/763811</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/763811</guid><dc:creator><![CDATA[junix]]></dc:creator><pubDate>Mon, 11 Apr 2005 06:25:52 GMT</pubDate></item><item><title><![CDATA[Reply to CAN - BUS über CancardX ansprechen on Mon, 11 Apr 2005 06:44:48 GMT]]></title><description><![CDATA[<p>Sorry!</p>
<p>Im Grunde nur Deklarationen:</p>
<p>(Datei: &quot;loadlib.cpp&quot;)</p>
<p>//Glaobale Variablen<br />
NCDGETCHANNELMASK ncdGetChannelMask; //(Zeile 23)<br />
NCDOPENPORT ncdOpenPort; //(Zeile 24)<br />
...</p>
<p>Diese Datei sollte ich in mein Projekt einbinden, um die dll nutzen zu können.<br />
Wenn ich jetzt übersetze, dann erhalte ich diese Fehler in der eingebundenen Datei.</p>
<p>Gruss,<br />
lautiba!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/763823</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/763823</guid><dc:creator><![CDATA[lautiba]]></dc:creator><pubDate>Mon, 11 Apr 2005 06:44:48 GMT</pubDate></item><item><title><![CDATA[Reply to CAN - BUS über CancardX ansprechen on Mon, 11 Apr 2005 07:11:44 GMT]]></title><description><![CDATA[<p>ich arbeite im Geschäft ständig mit der Karte und hatte noch keine grösseren<br />
Probleme. Ich hab für die Karte eine Klasse geschrieben, die darf ich aber<br />
leider nicht weiter geben (war für's Geschäft) Daher mal die ganz einfache<br />
Variante hier:</p>
<p>- Füg mal zum testen die Datei &quot;vcand32.lib&quot; zu einem neuen Projekt hinzu<br />
- include VCanD.h</p>
<pre><code>static Vstatus InitDriver(void)
{
  VportHandle gPortHandle      = INVALID_PORTHANDLE;
  Vaccess gChannelMask         = 0;
  Vaccess gPermissionMask      = 0;
  unsigned long gBitRate       = 500000; // Baudrate
  unsigned int gHwType         = HWTYPE_CANCARDX; // CAN Karte
  int gHwChannel      = 0; // CAN Kanal, der verwendet wird
  int gHwIndex        = 0; // Hardwareindex der CAN Karte

  Vstatus vErr;
  VsetAcceptance acc;
  enableCANCard = true;

  // Open the driver
  vErr = ncdOpenDriver ();
  if (vErr) return vErr;

  // Select the channel
  gChannelMask = ncdGetChannelMask(gHwType,gHwIndex,gHwChannel);
  if (!gChannelMask) {
    ShowMessage(&quot;ERROR: Channel not found !&quot;);
    return VERROR;
  }

  // Open a port
  vErr = ncdOpenPort(&amp;gPortHandle,&quot;CANSoftware&quot;,gChannelMask,gChannelMask,&amp;gPermissionMask,128);
  if (vErr) goto error;

  // If permission to initialize

  // Open the acceptance filter for standard ids
  acc.mask = 0; // relevant=1
  acc.code = 0;
  vErr = ncdSetChannelAcceptance(gPortHandle,gChannelMask,&amp;acc);
  if (vErr) goto error;

  // Reset the clock
  vErr = ncdResetClock(gPortHandle);
  if (vErr) goto error;

  return VSUCCESS;

error:

  ShowMessage(ncdGetErrorString(vErr));

  if (gPortHandle!=INVALID_PORTHANDLE) {
    ncdClosePort(gPortHandle);
    gPortHandle = INVALID_PORTHANDLE;
  }

  return vErr;
}                                                  // end InitDriver ()

// Close the CAN driver interface

static Vstatus CleanUp(void)
{
  if (gPortHandle!=INVALID_PORTHANDLE) {
    ncdClosePort(gPortHandle);
    gPortHandle = INVALID_PORTHANDLE;
  }
  ncdCloseDriver();
  return VSUCCESS; // No error handling
}
</code></pre>
<p>wenn ich nichts vergessen habe dann kannst du nun mit:</p>
<pre><code>// Initialize the CAN driver
    vErr = InitDriver();
    if (vErr) return;

    // Go on bus
    vErr = ncdActivateChannel(gPortHandle,gChannelMask);
    if (vErr) return;
</code></pre>
<p>die Karte starten und mit:</p>
<pre><code>Vevent event;
    Vstatus vErr;
    event.tagData.msg.dlc = 5;
    event.tagData.msg.data[0] = 'h';
    event.tagData.msg.data[1] = 'a';
    event.tagData.msg.data[2] = 'l';
    event.tagData.msg.data[3] = 'l';
    event.tagData.msg.data[4] = 'o';
    event.tagData.msg.flags = 0; // damit nie die Wakeup Messages kommen
    vErr=ncdTransmit(gPortHandle, gChannelMask, &amp;pEvent);

    if (vErr==VERR_WRONG_PARAMETER) {
        // wenn dieser Fehler auftritt, ist die Karte falsch konfiguriert
        // ...
    } else if (vErr == VERR_QUEUE_IS_FULL) {
        // ...
    } else if (vErr == VERR_PORT_IS_OFFLINE) {
        // ...
    }
</code></pre>
<p>eine Botschaft versenden.</p>
<p>Ich würde dir aber raten, dass ganze nochmal zu überarbeiten. Das ist aus einer<br />
ganz alten Testsoftware von mir rauskopiert und soll dir nur die ersten<br />
Schritte zeigen. Um eine robuste Anwendung zu schreiben ist noch mehr<br />
notwendig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/763826</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/763826</guid><dc:creator><![CDATA[Acidmrp]]></dc:creator><pubDate>Mon, 11 Apr 2005 07:11:44 GMT</pubDate></item><item><title><![CDATA[Reply to CAN - BUS über CancardX ansprechen on Mon, 11 Apr 2005 14:07:20 GMT]]></title><description><![CDATA[<p>Was steht auf Zeile 22?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/764078</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/764078</guid><dc:creator><![CDATA[junix]]></dc:creator><pubDate>Mon, 11 Apr 2005 14:07:20 GMT</pubDate></item><item><title><![CDATA[Reply to CAN - BUS über CancardX ansprechen on Tue, 12 Apr 2005 05:38:56 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Habe noch mal von Anfang an nach der Struktur von &quot;Acidmrp angefangen.<br />
Bekomme jetzt ab dem Aufruf &quot;vErr = ncdOpenDriver()&quot; einen neuen Fehler:</p>
<p>[Linker Fehler] Unresolved external 'ncdOpenDriver' referenced from C:\PROGRAMME\BORLAND\CBUILDER6\PROJEKTS\Anwendung\UNIT1.OBJ</p>
<p>Dieser Fehler tritt bei allen Funktionsaufrufen auf, welche mit dem CAN - Bus zu tun haben.</p>
<p>???<br />
(#include &quot;VCanD.h&quot; hat funktioniert)<br />
Kann mir da jemand weiterhelfen?</p>
<p>Gruss,<br />
lautiba</p>
]]></description><link>https://www.c-plusplus.net/forum/post/764484</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/764484</guid><dc:creator><![CDATA[lautiba]]></dc:creator><pubDate>Tue, 12 Apr 2005 05:38:56 GMT</pubDate></item><item><title><![CDATA[Reply to CAN - BUS über CancardX ansprechen on Tue, 12 Apr 2005 07:04:19 GMT]]></title><description><![CDATA[<p>Da gehört doch noch ne LIbrary dazu? (*.lib)</p>
<p>-junix</p>
]]></description><link>https://www.c-plusplus.net/forum/post/764511</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/764511</guid><dc:creator><![CDATA[junix]]></dc:creator><pubDate>Tue, 12 Apr 2005 07:04:19 GMT</pubDate></item><item><title><![CDATA[Reply to CAN - BUS über CancardX ansprechen on Tue, 12 Apr 2005 07:20:54 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Hab das Problem gelöst!<br />
Die Lib - Datei war wohl beschädigt, habe diese neu kopiert.<br />
Nun geht es!</p>
<p>Schönen Dank für eure Mühe!!!</p>
<p>(Gut zu wissen, dass hier Leute Ahnung von CAN - Bus in Verbindung mit Vector - Karten haben!!!)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/764522</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/764522</guid><dc:creator><![CDATA[lautiba]]></dc:creator><pubDate>Tue, 12 Apr 2005 07:20:54 GMT</pubDate></item><item><title><![CDATA[Reply to CAN - BUS über CancardX ansprechen on Thu, 14 Apr 2005 06:46:03 GMT]]></title><description><![CDATA[<p>Hallo Ihr!</p>
<p>Ein Problem habe ich allerdings noch.</p>
<p>Ich möchte eine Information auslesen, welche von einem Gerät geschickt wird.</p>
<p>Nachrichtenname: ACC-&gt;Fusion(Header)<br />
ID(HEX): 300<br />
Länge: 8Byte<br />
Zykluszeit: 60ms<br />
Sender: IDIS-Sensor</p>
<p>Wie kann man denn genau diese Nachricht auslesen?</p>
<p>Gruss,<br />
lautiba</p>
]]></description><link>https://www.c-plusplus.net/forum/post/766262</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/766262</guid><dc:creator><![CDATA[lautiba]]></dc:creator><pubDate>Thu, 14 Apr 2005 06:46:03 GMT</pubDate></item><item><title><![CDATA[Reply to CAN - BUS über CancardX ansprechen on Thu, 14 Apr 2005 12:35:33 GMT]]></title><description><![CDATA[<p>die Nachricht wird ja alle 60ms vom Sensor gesendet. Am besten machst du einen<br />
Timer der alle 30ms aufgerufen wird und pollst die Nachrichten vom Bus.<br />
Dann vergleichst du in einer auswerte Routine ob die Nachricht auf CAN ID 0x300<br />
geschickt wurde.</p>
<p>Zum Aufbau des Timers:</p>
<pre><code class="language-cpp">void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
    Timer1-&gt;Enabled = false;

    // nun die Nachrichten vom Bus lesen
    // ...

    Timer1-&gt;Enabled = true;
}
</code></pre>
<p>wenn du wirklich nur diese eine Nachricht empfangen willst, dann kannst<br />
du mit ncdSetChannelAcceptance auch einen Filter auf diese Nachricht setzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/766550</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/766550</guid><dc:creator><![CDATA[Acidmrp]]></dc:creator><pubDate>Thu, 14 Apr 2005 12:35:33 GMT</pubDate></item><item><title><![CDATA[Reply to CAN - BUS über CancardX ansprechen on Mon, 18 Apr 2005 04:27:21 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich meinte eigendlich, wie ich eine Nachricht nur von der Adresse 0x300 einlesen kann, da an dem CAN - BUS noch sehr viele weitere Sensoren angeschlossen sind.</p>
<p>Habe es aber schon herausgefunden:</p>
<p>vErr = ncdAddAcceptanceRange(gPortHandle, gPermissionMask, 768, 778);</p>
<p>Mit diesem Befehl sage ich, dass nur von den Adressen 768 - 778 (in HEX: 300 - 30A) die Nachrichten in meinen Lesepuffer epuffert werden sollen.</p>
<p>Gruss,<br />
lautiba</p>
]]></description><link>https://www.c-plusplus.net/forum/post/769182</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/769182</guid><dc:creator><![CDATA[lautiba]]></dc:creator><pubDate>Mon, 18 Apr 2005 04:27:21 GMT</pubDate></item></channel></rss>