char data[4]={12,13,14,15}; char a_data[60]; ABaseModbus bus; bus.setPort(new QextSerialPort("COM1")); bus.port()->setBaudRate(BAUD9600); bus.port()->setDataBits(DATA_8); bus.port()->setFlowControl(FLOW_OFF); bus.port()->setParity(PAR_NONE); bus.port()->setStopBits(STOP_1); bus.port()->setTimeout(1,0); bus.port()->open(QIODevice::ReadWrite); if(!bus.port()->isOpen()){ printf("Error open port.\n"); qDebug()<<bus.port()->errorString(); } char a_frame[]={0x01, 0x11, 0x0c, 0x55, 0x2c}; qDebug()<<bus.port()->write(a_frame,5); // выводит 5 qDebug()<<"Data "<<bus.port()->readData(a_data,2); // выводит 0