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 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…