RKS+CAN Adapter für CAN-Bus Sniffing
CAN-Interface
CAN Hardware, CAN Software, CAN Protokolle - CAN-Bus Forum für Dein CAN-Bus Projekt. CAN-Bus und Elektronik.

Working example on Visual Studio


 
Neues Thema beginnen Auf Beitrag antworten Weitergeben, Thema teilen Lesezeichen setzen Druckansicht CANhack.de - Übersicht » CANhack.de CAN-USB System: RKS+CAN
Autor Nachricht
evgidijas
Gast




 


Kostenloser Account, kein CAN Entwicklungs-Support

Beitrag09-07-2015, 9:14    Titel: Working example on Visual Studio Antworten mit Zitat

Hi, I have received RKS+CAN cable and found, that KCANMonitor is not very comfortable in my situation. Is it possible to get a working example on Visaul Studio 2010 or 2012? The existing project is not compatible and after trying to port it I am getting project error.
One more question, is it possible to use RKS-USB.DLL in visual C#? Maybe it is possible to get example?

thanks
Nach oben
evgidijas
Gast




 


Kostenloser Account, kein CAN Entwicklungs-Support

Beitrag09-07-2015, 11:42    Titel: Working example on Visual Studio Antworten mit Zitat

And what version of software should I use, to make it possible to build that example.
1>c:\users\hp\desktop\example\example\stdafx.h(23) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory

I get this error at the moment.
Nach oben
CAN-Diagnose
Administrator
Administrator
Avatar-CAN-Diagnose

CAN Hacker seit: 07.06.2011
Beiträge: 550
Karma: +27 / -0   Danke, gefällt mir!
Wohnort: Ländle



Beitrag09-07-2015, 18:12    Titel: Working example on Visual Studio Antworten mit Zitat

Hi,

what exactly is your problem? The project is intentionally in an "old" format (Visual Studio 2008) because every newer Microsoft Visual Studio version could easly migrate it to its version: This allows to use Visual Studio 2008, 2010, 2012 or 2015.

Just install Visual Studio 2015 RC Community Edition plus Multibyte MFC Library for Visual Studio 2015 RC and you can start. For free!

Zitat:
1>c:\users\hp\desktop\example\example\stdafx.h(23) : fatal error C1083: Cannot open include file: 'afxwin.h': No such file or directory

Please don't do nonsense. Just open the project solution, Visual Studio will ask for conversion, say "yes, do it" and compile.

Best, Rainer



Example-with-Visual-Studio-2015.png
 Beschreibung:
 Example project with Visual Studio 2015
 Dateigröße:  82,79 KB
 Angeschaut:  1895 mal

Example-with-Visual-Studio-2015.png


Project-converted-to-Visual-Studio-2015.png
 Beschreibung:
 Example project conversion.
 Dateigröße:  62,85 KB
 Angeschaut:  1302 mal

Project-converted-to-Visual-Studio-2015.png


Example-Visual-Studio-2015.rar
 Beschreibung:
 Converted example demo for Visual Studio 2015. Please use (and convert) the original example project (for VS2008) if you use an older Visual Studio version!
Converted example demo for Visual Studio 2015. Please use (and convert) the original example project (for VS2008) if you use an older Visual Studio version!
Download
 Dateiname:  Example-Visual-Studio-2015.rar
 Dateigröße:  3,07 MB
 Heruntergeladen:  962 mal
Dipl.-Ing. (FH) Rainer Kaufmann - Embedded @ Kaufmann Automotive GmbH
CANhack.de System RKS+CAN: CAN-Bus Interface


Zuletzt bearbeitet am 10-07-2015, 5:52, insgesamt 7-mal bearbeitet.
Nach oben CAN Hacker - Profil anzeigen Private Nachricht senden Website dieses Benutzers besuchen
evgidijas
Gast




 


Kostenloser Account, kein CAN Entwicklungs-Support

Beitrag09-07-2015, 22:50    Titel: Working example on Visual Studio Antworten mit Zitat

Thanks, this information I was looking for. I was trying to compile it using VS express, but it is missing some components. Now it is working.
Nach oben
evgidijas
Gast




 


Kostenloser Account, kein CAN Entwicklungs-Support

Beitrag10-07-2015, 13:26    Titel: Working example on Visual Studio Antworten mit Zitat

I have some more question:

//Set the timeouts for reading / writing data to the RKS+CAN interface.
BOOL RKSSetTimeouts(DWORD dwMsTimeoutRead, DWORD dwMsTimeoutWrite);

1. Do I understand correctly? If I set this value to RKSSetTimeouts(200,200) and fifo is empty, every function RKSCANRx() read will take 200ms? And If I want to read it without delay read timeout should be 0?

2. What are the MIN and MAX values of dwMsTimeoutRead and dwMsTimeoutWrite? DWORD?

3. What is the size of a TX and RX queue? If I read this function periodically, faster than fifo get full, I should be fine on handling all received CAN data?

// Get one CAN message from the receive queue, RKSCANOpen(...) must have
// been called before. Returns TRUE on success.
extern 'C' __declspec(dllexport) BOOL RKSCANRx(can_msg_t* pMsg);
Nach oben
CAN-Diagnose
Administrator
Administrator
Avatar-CAN-Diagnose

CAN Hacker seit: 07.06.2011
Beiträge: 550
Karma: +27 / -0   Danke, gefällt mir!
Wohnort: Ländle



Beitrag10-07-2015, 15:59    Titel: Working example on Visual Studio Antworten mit Zitat

1.) No. If a function is able to deliver data, it returns immediately. If not, it waits the specified timeout value and gives up then (returns).
2.) I don't know the maximum values and it is not really important: These values specify timeouts for read or write access of operations between the Winusb device driver and the device hardware. The minimum value (read+write) is 0ms, which makes no sense. It makes no sense to wait more than some seconds for an answer to the device. Just keep the default values. Why should anyone give the driver e.g. 10minutes to get a reply from the USB hardware? icon_eek.gif
3.) The CAN hardware uses 32 CAN frames FIFO buffers. Writing to the hardware is NOT buffered by the device driver itself. Reading is buffered as list, no message will be lost as long there is enough memory to store it and you do not close the connection.
Practically, you don't need to care about that. Nothing gets lost. icon_smile.gif
Dipl.-Ing. (FH) Rainer Kaufmann - Embedded @ Kaufmann Automotive GmbH
CANhack.de System RKS+CAN: CAN-Bus Interface


Zuletzt bearbeitet am 15-07-2015, 16:26, insgesamt 3-mal bearbeitet.
Nach oben CAN Hacker - Profil anzeigen Private Nachricht senden Website dieses Benutzers besuchen
CAN-Diagnose
Administrator
Administrator
Avatar-CAN-Diagnose

CAN Hacker seit: 07.06.2011
Beiträge: 550
Karma: +27 / -0   Danke, gefällt mir!
Wohnort: Ländle



Beitrag15-07-2015, 16:27    Titel: Working example on Visual Studio Antworten mit Zitat

A C# interface / example for the RKS+CAN hardware is in progress and available on request.
Dipl.-Ing. (FH) Rainer Kaufmann - Embedded @ Kaufmann Automotive GmbH
CANhack.de System RKS+CAN: CAN-Bus Interface


Zuletzt bearbeitet am 15-07-2015, 16:27, insgesamt 1-mal bearbeitet.
Nach oben CAN Hacker - Profil anzeigen Private Nachricht senden Website dieses Benutzers besuchen

Bewertungen - Working example on Visual Studio

Durchschnittsbewertung: 0,00 - schlechteste Bewertung: 0 - beste Bewertung: 0 - Anzahl der Bewertungen: 0 - Bewertungen ansehen

Du bist nicht dazu autorisiert dieses Thema zu bewerten. Danke sagen
Neues Thema beginnen Auf Beitrag antworten Weitergeben, Thema teilen Lesezeichen setzen Druckansicht CANhack.de - Übersicht » CANhack.de CAN-USB System: RKS+CAN
Gehe zu:  
Du kannst keine Beiträge in dieses Forum schreiben.