• 大小: 6.81MB
    文件类型: .zip
    金币: 2
    下载: 2 次
    发布日期: 2023-11-01
  • 语言: Java
  • 标签: PCAN  API  ECAN  

资源简介

基于PCAN(ECAN)的API函数库,有说明文档,C#、C++、JAVA、Python、VB等语言例程,对于开发上位机有参考意义,本人硬件使用ECAN,基于该函数库,已成功开发CAN通讯上位机程序。亲测可用,非常有意义的资料。

资源截图

代码片段和文件信息

//  PCANBasic.cs
//
//  ~~~~~~~~~~~~
//
//  PCAN-Basic API
//
//  ~~~~~~~~~~~~
//
//  ------------------------------------------------------------------
//  Author : Keneth Wagner
// Last change: 13.11.2017 Wagner
//
//  Language: C# 1.0
//  ------------------------------------------------------------------
//
//  Copyright (C) 1999-2017  PEAK-System Technik GmbH Darmstadt
//  more Info at http://www.peak-system.com 
//
using System;
using System.Text;
using System.Runtime.InteropServices;

namespace Peak.Can.Basic
{    
    using TPCANHandle = System.UInt16;    
    using TPCANBitrateFD = System.String;
using TPCANTimestampFD = System.UInt64;

    #region Enumerations
    /// 
    /// Represents a PCAN status/error code
    /// 

    [Flags]
    public enum TPCANStatus : uint
    {
        /// 
        /// No error
        /// 

        PCAN_ERROR_OK           = 0x00000
        /// 
        /// Transmit buffer in CAN controller is full
        /// 

        PCAN_ERROR_XMTFULL      = 0x00001
        /// 
        /// CAN controller was read too late        
        /// 

        PCAN_ERROR_OVERRUN      = 0x00002  
        /// 
        /// Bus error: an error counter reached the ‘light‘ limit
        /// 

        PCAN_ERROR_BUSLIGHT     = 0x00004  
        /// 
        /// Bus error: an error counter reached the ‘heavy‘ limit
        /// 

        PCAN_ERROR_BUSHEAVY     = 0x00008  
        /// 
        /// Bus error: an error counter reached the ‘warning‘ limit
        /// 

        PCAN_ERROR_BUSWARNING   = PCAN_ERROR_BUSHEAVY
        /// 
        /// Bus error: the CAN controller is error passive
        /// 

        PCAN_ERROR_BUSPASSIVE   = 0x40000
        /// 
        /// Bus error: the CAN controller is in bus-off state
        /// 

        PCAN_ERROR_BUSOFF       = 0x00010  
        /// 
        /// Mask for all bus errors
        /// 

        PCAN_ERROR_ANYBUSERR = (PCAN_ERROR_BUSWARNING | PCAN_ERROR_BUSLIGHT | PCAN_ERROR_BUSHEAVY | PCAN_ERROR_BUSOFF | PCAN_ERROR_BUSPASSIVE)
        /// 
        /// Receive queue is empty
        /// 

        PCAN_ERROR_QRCVEMPTY    = 0x00020  
        /// 
        /// Receive queue was read too late
        /// 

        PCAN_ERROR_QOVERRUN     = 0x00040  
        /// 
        /// Transmit queue is full
        /// 

        PCAN_ERROR_QXMTFULL     = 0x00080  
        /// 
        /// Test of the CAN controller hardware registers failed (no hardware found)
        /// 

        PCAN_ERROR_REGTEST      = 0x00100
        /// 
        /// Driver not loaded
        /// 

        PCAN_ERROR_NODRIVER     = 0x00200
        /// 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-12-07 13:25  PCAN-Basic API\
     文件     2526476  2017-11-20 09:46  PCAN-Basic API\PCAN-Parameter_Documentation.pdf
     文件      910897  2017-11-20 09:46  PCAN-Basic API\PCANBasic_deu.chm
     目录           0  2017-11-22 16:47  PCAN-Basic API\Samples\
     目录           0  2017-11-22 16:47  PCAN-Basic API\Samples\Delphi\
     文件        3766  2017-11-20 09:46  PCAN-Basic API\Samples\Delphi\PCANBasicExample.dproj
     文件       75975  2017-11-20 09:46  PCAN-Basic API\Samples\Delphi\Unit1.pas
     文件       34875  2017-11-20 09:46  PCAN-Basic API\Samples\Delphi\Unit1.dfm
     文件       56568  2017-11-20 09:46  PCAN-Basic API\Samples\Delphi\PCANBasic.pas
     文件         271  2017-11-20 09:46  PCAN-Basic API\Samples\Delphi\PCANBasicExample.dpr
     文件        6196  2017-11-20 09:46  PCAN-Basic API\Samples\Delphi\PCANBasicExample.res
     目录           0  2017-11-22 16:47  PCAN-Basic API\Samples\C++_Builder\
     文件       10385  2017-11-20 09:46  PCAN-Basic API\Samples\C++_Builder\PCANBasicClass.h
     文件       34813  2017-11-20 09:46  PCAN-Basic API\Samples\C++_Builder\Unit1.dfm
     文件       63491  2017-11-20 09:46  PCAN-Basic API\Samples\C++_Builder\Unit1.cpp
     文件        9527  2017-11-20 09:46  PCAN-Basic API\Samples\C++_Builder\Unit1.h
     文件       10864  2017-11-20 09:46  PCAN-Basic API\Samples\C++_Builder\PCANBasicExample.cbproj
     文件       30095  2017-11-20 09:46  PCAN-Basic API\Samples\C++_Builder\PCANBasic.h
     文件         860  2017-11-20 09:46  PCAN-Basic API\Samples\C++_Builder\PCANBasicExample.cpp
     文件        6164  2017-11-20 09:46  PCAN-Basic API\Samples\C++_Builder\PCANBasicExample.res
     文件        6057  2017-11-20 09:46  PCAN-Basic API\Samples\C++_Builder\PCANBasicClass.cpp
     目录           0  2017-11-22 16:47  PCAN-Basic API\Samples\C#\
     文件         481  2017-11-20 09:46  PCAN-Basic API\Samples\C#\Program.cs
     文件        4973  2017-11-20 09:46  PCAN-Basic API\Samples\C#\PCANBasicExample.csproj
     文件       52056  2017-11-20 09:46  PCAN-Basic API\Samples\C#\PCANBasic.cs
     文件        6208  2017-11-20 09:46  PCAN-Basic API\Samples\C#\Form1.resx
     文件        1624  2017-11-20 09:46  PCAN-Basic API\Samples\C#\PCANBasicExample.sln
     目录           0  2017-11-22 16:47  PCAN-Basic API\Samples\C#\Properties\
     文件        2860  2017-11-20 09:46  PCAN-Basic API\Samples\C#\Properties\Resources.Designer.cs
     文件        1489  2017-11-20 09:46  PCAN-Basic API\Samples\C#\Properties\AssemblyInfo.cs
     文件        5612  2017-11-20 09:46  PCAN-Basic API\Samples\C#\Properties\Resources.resx
............此处省略272个文件信息

评论

共有 条评论