[Development] modbus over serial port on windows 7 ?

Ralf Nolden nolden at kde.org
Tue May 31 11:43:37 CEST 2016


Am Dienstag, 31. Mai 2016, 14:23:42 schrieb Dmitry Shapovalov:
> Thanks for reply Ralf. Email more preferable for me.
> 
> Can you tell me what type of adapter you are using? Which version of
> qtserialport are you using? Maybe my problem is related to the type of
> serial port adapter. I tried use arduino with different usb-uart
> chips(ch430 and pl2303), but unsuccessfully.
> 
> Here is output of qt modbus master example
> 
> Запускается
> C:\Qt\Examples\Qt-5.6\qtserialbus\serialbus\modbus\build-master-Desktop_Qt_5
> _6_0_MinGW_32bit-Debug\debug\modbusmaster.exe... qt.modbus: (RTU client)
> Sent Serial PDU: 0x0400000001
> qt.modbus.lowlevel: (RTU client) Sent Serial ADU: 0x01040000000131ca
> qt.modbus: (RTU client) Send failed: 0x0400000001
> qt.modbus: (RTU server) QSerialPort error:
> QSerialPort::SerialPortError(ResourceError) "Операция ввода/вывода была
> прервана из-за завершения потока команд или по запросу приложения."
> qt.modbus.lowlevel: (RTU client) Response buffer: "01"
> qt.modbus: (RTU client) Modbus ADU not complete
> qt.modbus.lowlevel: (RTU client) Response buffer: "0104024c494c06"
> qt.modbus: (RTU client) Received ADU: "0104024c494c06"
> qt.modbus: (RTU client) Cannot match response with open request, ignoring
> 
> Look like it actually sends request, but qtserialport reports error, so
> qtserialbus(modbus) ignores response.
The sending failed due to your log, then there is no open request that the 
response which you seem to get can be matched.

You could also use a serial port sniffer to log the data transfer in parallel 
and check what is sent and received on the port.

Anyway, from your output of the response buffer, you seem to get the requested 
value back:
- slave id 1
- function code 4
- 2 bytes data to follow
- value 4c49
- crc 4c06 (correct)

Can you confirm the same string with your other tools and maybe try more than 
one value ? Your problem seems to be related to your error message above which 
I can't interpret due to missing language skills :)




> 
> 2016-05-31 11:59 GMT+05:00 Ralf Nolden <nolden at kde.org>:
> > Am Dienstag, 31. Mai 2016, 09:34:19 schrieb Dmitry Shapovalov:
> > > Hello,
> > > can someone confirm that modbus over serial port is working on windows ?
> > 
> > I have tested modbus over serial port on windows with two Schneider
> > Electric
> > PLCs, a Twido and a Premium, both with TCP and RS485. We could evaluate
> > your
> > problems on IRC if you want.
> > 
> > > all my experiments led me to the thought that it is absolutely broken.
> > > i am using arduno as a modbus device. i tested it with qmodbus and
> > > modbus
> > > poll. works great. but when i try to use modbus examples from
> > > qt(qtserialbus/examples/serialbus/modbus/master), look like it can not
> > 
> > send
> > 
> > > request.
> > > i tried release(5.6) and git version of qtserialbus and qtserialport
> > > modules with no luck.
> > > 
> > > i am using windows 7 on virtualbox.
> > > arduino modbus library from here
> > > https://github.com/smarmengol/Modbus-Master-Slave-for-Arduino
> > > arduino sketch http://pastebin.com/FHW3B7TX
> > > 
> > > it's me or it's really broken ?
> > 
> > --
> > Kind regards,
> > 
> > Ralf Nolden
> > 
> > _______________________________________________
> > Development mailing list
> > Development at qt-project.org
> > http://lists.qt-project.org/mailman/listinfo/development

-- 
Kind regards,

Ralf Nolden




More information about the Development mailing list