PCAN-USB Light MatLab Extension
(c) 2004 by PEAK-System Technik GmbH Darmstadt

Filename: readme.txt
Date: 24.11.2004
Autotr: U.Wilhelm


Files:

Build_DLL.m              -> Project mex file to build DLLs
CANUSB_INIT.c            -> CAN_Init Mex file
CANUSB_INIT.dll          -> CAN_Init DLL file
CANUSB_VERSION.c         -> CAN_Version Mex file
CANUSB_VERSION.dll       -> CAN_Version DLL file
CANUSB_RESETCLIENT.c     -> CAN_ResetClient Mex file
CANUSB_RESETCLIENT.dll   -> CAN_ResetClient DLL file
CANUSB_WRITE.c           -> CAN_Write Mex file
CANUSB_WRITE.dll         -> CAN_Write DLL file
CANUSB_READ.c            -> CAN_Read Mex file
CANUSB_READ.dll          -> CAN_Read DLL file
CANUSB_STATUS.c          -> CAN_Satus Mex file
CANUSB_STATUS.dll        -> CAN_Status DLL file
CANUSB_CLOSE.c           -> CAN_Close Mex file
CANUSB_CLOSE.dll         -> CAN_Close DLL file
PCAN_USB.dll             -> PEAK CAN-USB Interface DLL
PCAN_USB.lib             -> PEAK CAN-USB VC6 LIB 
pcan_usb.h               -> PEAK CAN-USB C-Header File
PCAN_USB_Test2.m         -> Example M File for MatLab Tested with R12
readme.txt               -> This file


The PCAN_USB Light MatLab Interface makes it possible to use
a PEAK CAN to USB Interface with MatLab. 

The PCAN_Light Driver Interface for the PCAN-USB have 7 main
functions to use the Adapter

1. CANUSB_INIT(Baudrate, MsgType) 
   On first time use this function in a MatLab session the pcanusb.dll is loaded.
   Requirements are: Installed PCAN-USB Divece Driver and attached PCAN-USB Hardware
   CAN Controller urns to a Reset ! - to delete in/out queue of driver use CANUSB_RESETCLIENT function (6)

2. CANUSB_STATUS
   Get Staus of USB Interface (see can_usb.h)

3. CANUSB_READ
   Read a CAN Msg from the USB Interface (see can_usb.h)
   The MatLab implementation return a Matrix with 11 entrys:
   1-the Return Value of the CAN Read function 
     If eq. CAN_ERR_OK or CAN_ERR_QRCVEMPTY a real Msg was received
   2-If Msg was received the second value is the ID
   3-If Msg was received the third value is the MSGType
   4-If Msg was received the fourth value is the DLC (Data Lenght Coe / LEN)
   5to12-If Msg was received theses valuesstore the Data bytes

4. CANUSB_WRITE(ID,MSGTYPE,DLC,D1..D8)
   Write a CAN Dataframe to the bus
   Parameter: CANUSB_WRITE(ID,MSGTYPE,LEN,D1,D2,D3,D4,D5,D6,D7,D8)
   CAUTION: Always use all DataBytes also if 8>DLC>0

5. CANUSB_VERSION
   Return a Driver Information String (only if Driver is loaded !)

6. CANUSB_RESETCLIENT
   Reset all in and out queues of the Device Driver - The Controller will NOT run a Reset

7. CANUSB_CLOSE
   Close onnection

#############################################################################################################

NEW since 01.08.2005


 CANUSB_MSGFILTER.c     -> CAN_MSGFilter Mex file
 CANUSB_MSGFILTER.dll   -> CAN_MSGFilter DLL file
 CANUSB_RESETCLIENT.dll -> CAN_ResetFilter Mex file
 CANUSB_RESETFILTER.c   -> CAN_ResetFilter DLL file


Set MsgFilter:

8. CANUSB_RESETFILTER
   Close comlete CAN Filter system in driver.. no received message will placed into the Driver Buffer

9. CANUSB_MSGFILTER(FromID,ToID,MsgType)
   Set the CAN Filter System. You could also called this unction more than once to add seperate filter holes.
   To open the filter completly use FromID=0 and ToID=0. The MsgType is 0 for STD and 1 for EXT


------------------------------------------------------------------------------------------------------------------------------
SOFTWARE LICENSE AGREEMENT OF PCAN Light MatLab Interface
(C)2004 PEAK-System Technik GmbH

PEAK-SYSTEM ("LICENSOR") IS WILLING TO LICENSE THE ACCOMPANYING SOFTWARE TO YOU ONLY IF YOU ACCEPT ALL OF THE TERMS IN THIS LICENSE AGREEMENT. PLEASE READ THE TERMS CAREFULLY BEFORE YOU INSTALL THE SOFTWARE, BECAUSE BY INSTALLING THE SOFTWARE YOU ARE AGREEING TO BE BOUND BY THE TERMS OF THIS AGREEMENT. IF YOU DO NOT AGREE TO THESE TERMS, LICENSOR WILL NOT LICENSE THIS SOFTWARE TO YOU, AND IN THAT CASE YOU SHOULD IMMEDIATELY DELETE ALL COPIES OF THIS SOFTWARE YOU HAVE IN ANY FORM.


1. The enclosed Licensor software program ("Software") and the accompanying written materials are protected by German copyright laws, by laws of other nations, and by international treaties.

2. The Licensor grants to you the right to use one copy of the Software on a single computer. If the Software consists of multiple executable programs then individually each of those executable programs can be used only on a single computer, but there is no requirement that all executables must be used on the same single computer.

3. You may not rent or lease the Software or otherwise transfer or assign the right to use the Software.

4. You may not reverse engineer, decompile, or disassemble the Software.

5. THIS SOFTWARE AND ITS ACCOMPANYING WRITTEN MATERIALS ARE PROVIDED BY LICENSOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT, ARE DISCLAIMED.

6. IN NO EVENT SHALL LICENSOR OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, SAVINGS, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
