QCanBus: Device Interface for peakcan and systeccan not available?
-
I tried retrieving the device interface names for all the supported CANs using:-
QList<QCanBusDeviceInfo> availableDevicesList = QCanBus::instance()->availableDevices(QString("vectorcan"))
(for vectorcan, systeccan, peakcan, tinycan.)
While I was able to obtaine the device interface names for tinycan and vectorcan, there was no device available for peakcan and systeccan.
How do I create the devices for peakcan and systeccan if there's none available?
p/s: Using QT5.9.0
-
Most likelly, you need in a *.dll's of peakcan and systeccan (e.g. pcanbasic.dll and so on). Please be convinced that its are present, e.g. in same directory with the your executable file, or a path to libraries are added to the PATH env.
-
@kuzulis said in QCanBus: Device Interface for peakcan and systeccan not available?:
Most likelly, you need in a *.dll's of peakcan and systeccan (e.g. pcanbasic.dll and so on). Please be convinced that its are present, e.g. in same directory with the your executable file, or a path to libraries are added to the PATH env.
Correct, you always need the device drivers and for most plugins also a DLL. That's all documented in the plugin pages available from https://doc.qt.io/qt-5/qtcanbus-backends.html#can-bus-plugins
I've tried the following code on my system (with Peak drivers installed and a PCAN-USB Pro connected, no Systec and no Vector drivers installed):
#include <QCanBus> #include <QCoreApplication> #include <QDebug> int main(int argc, char *argv[]) { const QStringList plugins = QCanBus::instance()->plugins(); for (auto plugin : plugins) { QString errorString; const QList<QCanBusDeviceInfo> devices = QCanBus::instance()->availableDevices( plugin, &errorString); if (!errorString.isEmpty()) qDebug() << plugin << errorString; for (auto device : devices) qDebug() << plugin << device.name(); } }
which gives me the following output:
Starting F:\build-canenum-Desktop_Qt_5_9_1_MinGW_32bit-Debug\debug\canenum.exe... "peakcan" "usb0" "peakcan" "usb1" "systeccan" "Cannot load library usbcan32: Das angegebene Modul wurde nicht gefunden." "tinycan" "can0.0" "tinycan" "can0.1" "vectorcan" "Cannot load library vxlapi: Das angegebene Modul wurde nicht gefunden." F:\build-canenum-Desktop_Qt_5_9_1_MinGW_32bit-Debug\debug\canenum.exe exited with code 0
From the error messages you see that the DLLs for Systec and Vector are missing. I guess that's the same for you, @MrBrightSide8.
PS: The two devices for TinyCAN are really a bug, which is tracked as https://bugreports.qt.io/browse/QTBUG-62958 -
Yes, you're right. Thanks.