I have an ancient serial spectrometer which only runs on win9x. I want to convert to a Linux system, but the existing software is proprietary and wont work. I was able to access a console internally on the spectrometer. The console takes keyboard character commands, and sends the output to the serial port.
in vb6 I can write to the com port with char values using ComPort.Write(Chr(34))
I am interested in using Qt for the interface, how can I send something to the same effect as ComPort.Write(Chr(34)) using qt?
1 Answer
Here an example from Qt official site (C++)
If Visual Basic is your background you may prefer Gambas3
Gambas have similar syntax of Visual Basic(VB), and support Qt as GUI tool kit.
See
In Linux/BSD, Serial port is more accessible then windows. So you can even write to it from shell/terminal, or use system call from most programming languages.
Example in shell with an Android phone as modem, it may help for debugging:
Reading serial port (need to be root):
sudo su cat /dev/ttyACM0As you can read just few lines as needed:
head -n2 /dev/ttyACM0Writing serial, Open other terminal tab or window:
sudo su echo -e "AT" > /dev/ttyACM0It shows
OKon reading port window, Also you can sent hexadecimal data (use -n option to avoid sending new line at the end)echo -e -n "\x41\x54\x0a" > /dev/ttyACM0same as:
echo -e "\x41\x54" > /dev/ttyACM0Shell will show undisplayed hex as small square with its value written inside it. Try this.
echo -e "\x13"