Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
297 views
in Technique[技术] by (71.8m points)

python - I would like to know why the following occur. xlOpenPort failed (XL_ERR_INVALID_CHANNEL_MASK)

This is the code I am trying:

import can
bus = can.interface.Bus(channel=0,bustype = 'vector')

This is the error error receive when I run the script as is.

Traceback (most recent call last):
  File "C:/Users/xyz/Desktop/cantest2.py", line 2, in <module>
    bus = can.interface.Bus(channel=0,bustype = 'vector')
  File "C:UsersxyzAppDataLocalProgramsPythonPython37libsite-packagescaninterface.py", line 127, in __new__
    return cls(channel, *args, **kwargs)
  File "C:UsersxyzAppDataLocalProgramsPythonPython37libsite-packagescaninterfacesvectorcanlib.py", line 156, in __init__
    vxlapi.XL_INTERFACE_VERSION, vxlapi.XL_BUS_TYPE_CAN)
  File "C:UsersxyzAppDataLocalProgramsPythonPython37libsite-packagescaninterfacesvectorvxlapi.py", line 207, in check_status
    raise VectorError(result, xlGetErrorString(result).decode(), function.__name__)
can.interfaces.vector.exceptions.VectorError: xlOpenPort failed (XL_ERR_INVALID_CHANNEL_MASK)
question from:https://stackoverflow.com/questions/66057582/i-would-like-to-know-why-the-following-occur-xlopenport-failed-xl-err-invalid

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...