All Forums
 Microsoft Windows CE
 CE Sample Applications and Utilities
 eVC - CAN Sample Application
 Forum Locked  Topic Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ctacke

877 Posts

Posted - 24 Nov 2004 :  13:50:09  Show Profile  Email Poster
CAN Sample Application

The following C++ application demonstrates use of the ADS PeliCAN driver driver.

The application is intended to be run on two devices connected on a CAN bus. One device becomes the 'sender' and the other the 'receiver'. CAN messages are cycled from the sender to the receiver and then back to the sender. The sender checks that the messages returned to it contain valid data. The sender also tracks throughput statistics, which it displays when the transmission is complete.

See below for app, source code and information about using CAN with managed code.

Requirements

Requires ADS PeliCAN v1.1 compliant CAN driver (or later)


Usage

Instructions:
  • Compile and run SampleCAN on two devices that are connected on a CAN bus.
  • Select the same baudrate for both devices.
  • Designate the first device as the 'receiver'.
  • Designate the second device as the 'sender'.
  • On the 'sender' device, select the number of message cycles to run.
    When all cycles have completed, throughput statistics will be displayed.
  • Press 'q' to quit the application at any time.

Key APIs Used


CreateFile
ReadFile
WriteFile
DeviceIoControl

Lines of Code: ~500


Source Download
Rev 2 - 11/30/04 (12k zip).

Further Reading
CAN topic index

Creating a managed code wrapper (C#) for stream driver interfaces
Microsoft article and sample app written by Chris Tacke of ADS


Edited by ctacke 3-Dec-2004: Updated app to Rev 2
Edited by akidder 7-Jun-2006: Add link for C# stream driver wrapper

ctacke

877 Posts

Posted - 03 Dec 2004 :  14:02:41  Show Profile  Email Poster
Update
We've updated the application to use the 1.2 version of the PeliCAN driver. The sample will continue to work with version 1.1 of the driver, but the call new IOCTL to query the driver version will fail.
Go to Top of Page
  Topic  
 Forum Locked  Topic Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.03 seconds. Snitz Forums 2000