Categories
ModBus master, GUI code?
How to organize the algorithm for the master (ModBus ASCii)? for example, I form a request ":....." and send it to the slave device, how can I wait for a response then? using QtSerialPort
Answer the question
In order to leave comments, you need to log in
You need to read response with timeout. Something like:
serial->write(msg, len); if (serial->waitForReadyRead(timeout_ms)) { serial->read(buffer, 1); .... } else //timeout error
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question