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. Qt6 receive/send PCAN bus by PCAN library
Forum Updated to NodeBB v4.3 + New Features

Qt6 receive/send PCAN bus by PCAN library

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 3 Posters 579 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.
  • P Offline
    P Offline
    Peter626
    wrote on last edited by
    #1

    I am trying to receive/send CAN-Bus messages via the library (PCANBasic.dll) with USB.
    now I can use a timer to read can-bus message, but I don't know how receive message by event.
    from the Peak CAN example based on C++MFC, it supports Reading use Event and Timer.

    Pl45m4P aha_1980A 2 Replies Last reply
    0
    • P Peter626

      I am trying to receive/send CAN-Bus messages via the library (PCANBasic.dll) with USB.
      now I can use a timer to read can-bus message, but I don't know how receive message by event.
      from the Peak CAN example based on C++MFC, it supports Reading use Event and Timer.

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #3

      @Peter626 How about using Qt's CAN library (which uses PCANBasic in the background)? https://doc.qt.io/qt-6/qtcanbus-backends.html

      Qt has to stay free or it will die.

      P 1 Reply Last reply
      2
      • P Peter626

        I am trying to receive/send CAN-Bus messages via the library (PCANBasic.dll) with USB.
        now I can use a timer to read can-bus message, but I don't know how receive message by event.
        from the Peak CAN example based on C++MFC, it supports Reading use Event and Timer.

        Pl45m4P Offline
        Pl45m4P Offline
        Pl45m4
        wrote on last edited by
        #2

        @Peter626 said in Qt6 receive/send PCAN bus by PCAN library:

        now I can use a timer to read can-bus message, but I don't know how receive message by event.

        What event? There is no Qt event for that.
        You need to wrap the 3rd party lib code yourself, if you want "Qt events"...

        I would use Qt Signals instead.
        Create some kind of worker which receives messages in the background (don't know the library interface... could be async, could be blocking) and then emit signals to update your Qt app.


        If debugging is the process of removing software bugs, then programming must be the process of putting them in.

        ~E. W. Dijkstra

        1 Reply Last reply
        2
        • P Peter626

          I am trying to receive/send CAN-Bus messages via the library (PCANBasic.dll) with USB.
          now I can use a timer to read can-bus message, but I don't know how receive message by event.
          from the Peak CAN example based on C++MFC, it supports Reading use Event and Timer.

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #3

          @Peter626 How about using Qt's CAN library (which uses PCANBasic in the background)? https://doc.qt.io/qt-6/qtcanbus-backends.html

          Qt has to stay free or it will die.

          P 1 Reply Last reply
          2
          • aha_1980A aha_1980

            @Peter626 How about using Qt's CAN library (which uses PCANBasic in the background)? https://doc.qt.io/qt-6/qtcanbus-backends.html

            P Offline
            P Offline
            Peter626
            wrote on last edited by
            #4

            @aha_1980 Thank you. great help. yes Qt's CAN Library can work fine.

            1 Reply Last reply
            1
            • P Peter626 has marked this topic as solved on

            • Login

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