11-04-2012 05:58 AM
Hey,
I’m using Qextserialport 1.2 alpha in my project. (QT C++ programing)
I got invalid data when I use other windows application while I’m recording the data at hight rate of 400hz.
BUT, when I first open the port via HyperTerminal or LabView and then I connect throw my SW, the problem is vanished.
The problem doesn happend in low rate (1h,10h)
Any Idea?!?
port = new QextSerialPort(portName,QextSerialPort::EventDriven); if(!port->open(QIODevice::ReadOnly )) { qDebug("Cannot open serial port: %s Error: %s", portName.toAscii().constData(), port->errorString().toAscii().constData()); return -1; } connect( port, SIGNAL(readyRead()), this, SLOT(onReadyRead())); port->setBaudRate(BAUD921600); port->setDataBits(DATA_8); port->setParity(PAR_NONE); port->setStopBits(STOP_2); port->setFlowControl (FLOW_OFF); port->setRts( true ); port->setDtr( true );
My setup:
Win XP sp3
QT 4.7.0
Thanx!
11-05-2012 06:45 PM
Hello Simon,
It is a little unclear what your end goal is in this situation. Is it necessary to use the other windows applications if they are not returning valid data? Moreover, if you are able to utilize LabVIEW to get the results you need do you need to even consider the other applications?
11-06-2012 01:31 AM
Thanks for your replay.
I'll try to be more clear about what I mean in "windows application".
While I'm recording data with my SW, each change that happened i.e. maximize or minimize the SW window or opening other document can damage the recording data.
This doesn't happened when I first open the LabView SW then connect and disconnect from the serial comport.
And then open my SW, connect the serial port start recording data and I can maximize or minimize the SW while recording and it won't damage the record.
P.S. I need to record the data with my SW and not with LabView.
11-07-2012 02:23 PM
So, essentially, when you are working with the com port connections with the software as a standalone environment you have issues but if there are other software environments open then there isn't an issue?
11-08-2012 01:42 AM
I need to open/close the serial port with an external terminal (LabView / RealTerm) before my program starts work.
11-09-2012 11:05 AM
Are you sure that the baud rate you are using is best suited for your application? That baud rate is only supported by certain serial devices/interfaces and its possible that when you open Hyperterminal or LabVIEW the baud rate you set in your code is being overwritten by default baud rate settings that the other programs use.
11-11-2012 05:51 AM
Yes, I need to work with 691200 baud rate.
It's works well when I'm using LabView / RealTerm.
The procedure to get my software work is.
1. Reset the PC
2. Open / Close port from the RealTerm / LabView.
3. Open the port from my software.
11-12-2012 02:29 PM
The following line says:
port->setBaudRate(BAUD921600);
Is this a typo? Because this isn't the rate you said you needed to work with (Baud rate: 691200).
11-13-2012 01:44 AM
The correct baud rate is 691200
port->setBaudRate(BAUD691200);
I accidentally copied from other part of the code that work with 921600 baud rate.
Sorry.
11-13-2012 05:50 PM
At this point, because this is not actually a LabVIEW issue I'm not sure what can be done for you at this point.