QtSerialBus: Using Modbus and CAN bus with Qt - Video On-Demand

 
Download example code
 

Q&A from Live Webinar
 

Q - Does QtSerialBus work with the ELM327 CAN dongle?
A - Unfortunately, no. That would be a useful project if someone was to write a plugin. There might be some limitations on what could be done but the commands for the EML327 are documented so it should be possible.

Q - What is the best way to make QtSerialBus available to QML so that we can send and receive messages between a serial device and QML?
A - I don't think you would want to do the low-level message creation and parsing in QML and JavaScript as it would tedious and potentially slow. You could write higher level routines in C++ and expose them to QML using the standard Qt approaches for doing this.

Q - Where do you think the most likely bottle neck would be when reading and processing a large amount of messages from a CAN bus: Network layer, application layer or physical layer?
A - It would really depend on your hardware, how many devices are on the bus, etc.

Q - How often does QtSerialBus check for messages on a CAN bus? Is there a way to set how frequently messages are received or polled?
A - It will typically be interrupt driven by the hardware and not polled at a specific rate.

Q - I believe Devicenet is a variation of Canbus. Can it be used for these types of protocol variations?
A - It looks like Devicenet is a higher level protocol over CAN, so you should be able to implement it on top of QtSerialBus.

Q - Is there a CAN simulator for Windows?
A - I am not aware of any, but a Google search found some matches that may or may not be relevant to what you are looking for.

Q - Do you think Qt could ever be used on a microcontroller as an OS without the heavy stuff needed for GUIs?
A - There is some effort to get Qt running on lower end hardware (Qt-Lite, coming in Qt 5.8.0) but this is mostly aimed at SOC type devices that still run an RTOS or embedded OS and not microcontrollers without an OS.

Q - Is there an OBDII example?
A - No, see the question earlier about the ELM327.

Q - Do the classes address big endian vs little endian issues?
A - I assume so, since that is standard Qt practice. Some methods, like QModbusPdu::decodeData() mention supporting this. I imagine you could have endian issues in code you write that works with the raw data if you don't account for it.

Q - I have an OBD-II dongle on my car. Can I use QtSerialBus to connect and interact with the dongle using CAN protocol?
A - No, see the question earlier about the ELM327.

Q - Could we use int/long converting in Modbus Library for some special device require in order to read device value from client/master (depend on system)?
A - I'm not sure exactly what you are asking, but the documentation for some methods like QModbusPdu::encodeData() mention some limitations on the size of data.

Q - Also what's limit of sending data at the same time without error, (approx number like 100+,1000+,etc) ?
A - It will depend on your hardware and how much of the bandwidth the devices are using. Modbus has a limit to the number of devices.

Q - Actually single master is limited mainly for serial comunication. It is possible to use multiple clients (masters) across multiple servers (slaves) when using TCP/IP for Modbus.
A - That is correct. I may not have made that clear during the presentation.