Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QCanBus: Device Interface for peakcan and systeccan not available?
Forum Updated to NodeBB v4.3 + New Features

QCanBus: Device Interface for peakcan and systeccan not available?

Scheduled Pinned Locked Moved Solved General and Desktop
canqcanbusqcanbusdeviceqt5.9
4 Posts 3 Posters 3.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MrBrightSide8
    wrote on last edited by MrBrightSide8
    #1

    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

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kuzulis
      Qt Champions 2020
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      3
      • aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @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

        Qt has to stay free or it will die.

        1 Reply Last reply
        2
        • M Offline
          M Offline
          MrBrightSide8
          wrote on last edited by
          #4

          Yes, you're right. Thanks.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved