hardbyte / python-can

The can package provides controller area network support for Python developers
https://python-can.readthedocs.io
GNU Lesser General Public License v3.0
1.26k stars 599 forks source link

vector interface raise exception: XL_ERR_WRONG_PARAMETER #208

Closed daily2008 closed 6 years ago

daily2008 commented 6 years ago

Hi, when I use the vector inferface, it raise execption as: File "D:\SVN\linux_svn\trunk\brilliance_m8x\robot\src\lib\TACommonLib\Python_CAN_Library\can\interfaces\vector\canlib.py", line 85, in init vxlapi.XL_INTERFACE_VERSION, vxlapi.XL_BUS_TYPE_CAN) File "D:\SVN\linux_svn\trunk\brilliance_m8x\robot\src\lib\TACommonLib\Python_CAN_Library\can\interfaces\vector\vxlapi.py", line 74, in check_status raise VectorError(result, xlGetErrorString(result).decode()) VectorError: XL_ERR_WRONG_PARAMETER

I have already use PCAN interface and it works ok. So I just change following settings for my scripts: 1) change parameter interface="vector", channel="0,1,2,3" 2) connect Vector CAN/LIN interface VN1640A hardware to PC. So are there any else problems for my settings? I have read the "XL Driver Library - Description.pdf", it mentioned need do some configuration with "Vector hardware config tool", I'm not sure these configurations must be done manually before running scripts? thank you very much!

christiansandberg commented 6 years ago

You should run Vector hardware config tool and check the configuration for CANalyzer, if it exists. Otherwise you must create an application, assign your channels, then specify app_name="Your application" to your Bus constructor.

daily2008 commented 6 years ago

it works ok now. thanks!