CANAL Driver for Lawicel CANUSB

Back to: Drivers for different equipment and technologies using the CANAL interface.

CANAL Driver: canusbdrv.dll(win32)
Include library for msvc: canusbdrv.lib

Also try Lawiel's beta driver with built in CANAL support http://www.canusb.com/beta/

This is a device driver for the Lawicel CANUSB adapter (http://www.canusb.com/). It is the propery of Lawicel AB and source is therefore not available. The driver can be downloaded from the above site or requested from Lawicel AB (http://www.lawicel.se)

Important!

Note that before you use this driver the ftdi dxx libraries must be installed. Information about how to install them is available on the canusb site or on the ftdi site (http://www.ftdichip.com). We recommend using the combined VCI + DXX driver which also is available on the CANUSB site in the download section.

DriverString

The driver string has the following format (note that all values can be entered in either decimal or hexadecimal form (for hex precede with 0x).

 adapter-code;bus-speed;filter;mask

To use default values just skip parameters. adapter-code is the only mandatory but can be set as “NULL” to use the first found adapter on the system. To find the adapter-code use the adaptercheck.exe program that is part of the CANUSB installation. A typical looking adapter code is “LWNQ06ES”.

bus_speed

This is the speed for the CAN bus. It can be given as

  • 5 for 5 Kbps
  • 10 for 10 Kbps
  • 20 for 20 Kbps
  • 50 for 50 Kbps
  • 100 for 100 Kbps
  • 125 for 125 Kbps
  • 250 for 250 Kbps
  • 500 for 500 Kbps
  • 800 for 800 Kbps
  • 1000 for 1000 Mobs

filter

Is the hardware dependent filter for this board hardware. Note that this filter work in a different way than the CANAL filter. Check the CANUSB documentation.

0x00000000 is the default. Let all messages true.

mask

Is the hardware dependent mask for this board hardware. Note that this filter work in a different way than the CANAL filter. Check the CANUSB documentation.

0xffffffff is the default. Let all messages true.


example

For the CANUSB adapter use

 LWNQ06ES;500

which says to use the CANUSB adapter with adaper-od LWNQ06ES and 500 kbps. You get the same result with

   LWNQ06ES

which will use 500 kbps as default.

Flags:

bit 0

CANUSB_FLAG_TIMESTAMP - Timestamp will be set by adapter. If not set timestamp will be set by the driver.


bit 1

CANUSB_FLAG_QUEUE_REPLACE Normally when the input queue is full new messages received are disregarded by setting this flag the first message is the queue is removed to make room for the new message.


bit 2

CANUSB_FLAG_BLOCK Can be set to make Read and Writes blocking.

:!:Important
This bit must be set if the CANAL blocking methods should be used.


bit 3

CANUSB_FLAG_SLOW This flag can be used at slower transmission speeds where the data stream still can be high. Every effort is made to transfer the frame even if the adapter reports that the internal buffer is full. Normally a frame is trashed if the hardware buffer becomes full to promote speed.


Status return:

The CanalGetStatus call returns the status structure with the channel_status member having the following meaning:

  • Bit 0-15 CANUSB Adapter specific.
  • Bit 16-31 CANAL specified.

Platforms

WIN32

Special Notes

This driver is proprietary and is not included in the VSCP & Friends distribution. It can be gotten from Lawicel AB, http://www.canusb.com. CANAL support is only available from version 0.1.7 of the driver and is missing from earlier releases.

Download driver

The driver is included in the installation of the VSCP and friends. Source for the driver is available in the source distribution or from CANAL/VSCP CVS VSCP CVS

Download area is http://www.vscp.org/downloads.html or http://sourceforge.net/project/showfiles.php?group_id=53560

Driver FAQ

How is 0.0.2 driver configuration done

    <canaldriver>  <!-- Information about CANAL drivers -->

        <driver> <!-- Lawicel driver -->
            <name>Lawicel USB adapter</name>
            <parameter>LWNQ06ES;500</parameter>
            <path>c:\winnt\system32\canusbdrv.dll</path>
            <flags>4</flags>
        </driver>

        <driver> <!-- Logger driver -->
           <name>logger</name>
           <parameter>c:\canallog.txt</parameter>
           <path>c:\winnt\system32\canallogger.dll</path>
           <flags>1</flags>
        </driver>



    </canaldriver>
canal_driver_for_lawicel_canusb.txt · Last modified: 2014/03/27 06:22 (external edit)
Public Domain
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0