Git Product home page Git Product logo

vectorxlpythonwrapper's Introduction

pyxldrv

Vector XL Driver Library Wrapper for Python.

What

  • Vector XL Driver Library inlclude dlls for C/C++, C# but not for Python.
  • pyxldrv makes the dll for C/C++ an importable library(vxlapi).
    • To wrap C/C++ dll, pyxldrv uses Cython.
    • Cython generates a library for Python("vxlapi.xxxxxx.pyd") from Cython codes(vxlapi.pxd and vxlapi.pyx).
import vxlapi as xl

ret = xl.OpenDriver()
....
msgs = []
msgs.append({"flags":0, "id":0x321, "dlc":8, "data":bytearray([0x12,0x34,0x56,0x78,0x9A,0xBC,0xDE,0xF0])})
message_count = [len(msgs)]
status = xl.CanTransmit(portHandle[0], accessMask, message_count, msgs)
...
ret = xl.CloseDriver()
  • and there is an additional wrapper class for CAN(can.py).

Installation

CANoe

xldriver

VectorDriverSetup

Cython and build tool

Support APIs

Common Commands

name support remark
xlOpenDriver yes
xlCloseDriver yes
xlGetApplConfig yes
xlSetApplConfig yes
xlGetDriverConfig yes
xlGetRemoteDriverConfig yes not tested.
xlGetChannelIndex yes not tested.
xlGetChannelMask yes
xlOpenPort yes
xlClosePort yes
xlSetTimerRate yes not tested.
xlSetTimerRateAndChannel yes not tested.
xlResetClock yes not tested.
xlSetNotification yes
xlFlushReceiveQueue yes not tested.
xlGetReceiveQueueLevel yes not tested.
xlActivateChannel yes
xlReceive yes
xlGetEventString yes xlReceive and xlGetEventString are intergrated into vxlapi.Receive.
xlGetErrorString yes
xlGetSyncTime yes not tested.
xlGetChannelTime yes not tested.
xlGenerateSyncPulse yes not tested.
xlPopupHwConfig yes
xlDeactivateChannel yes
xlGetLicenseInfo yes not tested.
xlSetGlobalTimeSync yes not tested.
xlGetKeymanBoxes yes not tested.
xlGetKeymanInfo yes not tested.

CAN Commands

name support remark
xlCanSetChannelMode yes not tested.
xlCanSetChannelOutput yes not tested.
xlCanSetReceiveMode yes not tested.
xlCanSetChannelTransceiver yes not tested.
xlCanSetChannelParams yes not tested.
xlCanSetChannelParamsC200 yes not tested.
xlCanSetChannelBitrate yes
xlCanSetChannelAcceptance yes not tested.
xlCanAddAcceptanceRange yes not tested.
xlCanRemoveAcceptanceRange yes not tested.
xlCanResetAcceptance yes not tested.
xlCanRequestChipState yes not tested.
xlCanTransmit yes
xlCanFlushTransmitQueue yes not tested.

CAN FD Commands

name support remark
xlCanFdSetConfiguration yes not tested.
xlCanTransmitEx yes not tested.
xlCanReceive no
xlCanGetEventString no

LIN Commands

to be suported. 3rd

Ethernet Commands

to be suported. 4th

Other Commands(MOST, FlexRay, AR429, ...)

not to be supported at this moment.

DebugView for Windows

For debugging vxlapi.pyx, DebugView for Windows can be used. Because DebugView for Windows shows native side(vxlapi.dll) function's status, "debug print" can be reduced.

See XL Driver Library - Description.pdf

2.5 Additional Information

The XL Driver Library supports debug prints which can be enabled in the Vector Hardware Configuration tool. In section General information, select Settings and double-click on Configuration flags. Enter the required flag (see table below). To activate the flags, restart the PC.

Flags Supported Bus Type
0x400000 CAN, LIN, DAIO
0x002000 MOST
0x010000 FlexRay

configuration

Debug_View

build command

python setup.py build_ext -i --compiler=msvc

setup.py supports only for 64bit version but you can use

basic test

python -m unittest tests.test_basic

License

ref

vectorxlpythonwrapper's People

Contributors

tdrk1980 avatar hobby-dev-c-vbs-rb-py avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.