Reading Ports (uart) in windows

Joined
Jan 27, 2023
Messages
2
Reaction score
0
Hello guys I want to write a program in qt6 with C++ which I will be able to read from ports (uart COM's ) in windows, I know C and C++ and python and I mostly write embeded system programs I dont know much how things work inside the windows itself, I tried to add a library that I found on the internet and add it to my GUI but it didnt work .
Can anyone help ?? (Is it better to learn C# and do it with C#) does anyone have C++ library that work for sure so I can add it to my program ?? Or can you help me to write one and show me the way ??
 
Joined
Jan 30, 2023
Messages
107
Reaction score
13
Yes, I can help you write a C++ program in Qt that reads data from serial ports (UART COMs) in Windows. To communicate with the serial port in Windows, you can use the Windows API functions provided in the Windows Driver Kit (WDK) or you can use a third-party library such as QtSerialPort, which is a cross-platform serial port library for the Qt framework. To get started with QtSerialPort, you can refer to the official documentation and examples at https://doc.qt.io/qt-6/qtserialport-index.html. You can add the library to your project by adding the following lines in your .pro file:

Code:
QT += serialport

As for whether it's better to learn C# and do it with C#, it depends on your personal preference and background. If you're familiar with C++ and Qt, it might be easier for you to continue using these tools. On the other hand, if you're interested in learning a new language and framework, C# and .NET can be a good option.
 
Joined
Jan 27, 2023
Messages
2
Reaction score
0
Yes, I can help you write a C++ program in Qt that reads data from serial ports (UART COMs) in Windows. To communicate with the serial port in Windows, you can use the Windows API functions provided in the Windows Driver Kit (WDK) or you can use a third-party library such as QtSerialPort, which is a cross-platform serial port library for the Qt framework. To get started with QtSerialPort, you can refer to the official documentation and examples at https://doc.qt.io/qt-6/qtserialport-index.html. You can add the library to your project by adding the following lines in your .pro file:

Code:
QT += serialport

As for whether it's better to learn C# and do it with C#, it depends on your personal preference and background. If you're familiar with C++ and Qt, it might be easier for you to continue using these tools. On the other hand, if you're interested in learning a new language and framework, C# and .NET can be a good option.
hi tnx for info I found a library that work fine but still I may need to make that myself ,tnx a lot , I have another question if you can help that would be great , I want to make a osiloscope out of my program so I can see the reciving data as signal I think I need REAL TIME PLOTING if im not wrong any suggestions ??
 
Joined
Jan 30, 2023
Messages
107
Reaction score
13
hi tnx for info I found a library that work fine but still I may need to make that myself ,tnx a lot , I have another question if you can help that would be great , I want to make a osiloscope out of my program so I can see the reciving data as signal I think I need REAL TIME PLOTING if im not wrong any suggestions ??
For real-time plotting in C++, you can use the Qt Charts library which is a set of easy-to-use chart components that can be added to a Qt application. The library provides a number of chart types, including line charts, spline charts, area charts, bar charts, pie charts, and more. You can refer to the official documentation and examples at https://doc.qt.io/qt-6/qtcharts-index.html. To add the library to your project, you can add the following line in your .pro file:

Code: QT += charts

Another option for real-time plotting is the QCustomPlot library, which is a Qt C++ widget for plotting. The library is easy to use and provides a number of features for real-time plotting. You can refer to the official documentation and examples at https://www.qcustomplot.com/. To use the library, you will need to download and include the header files in your project.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top