Communication Fail using ModBus (serial communications)

Hello,

I want to test a Modbus Slave, using RFW.
I m using a Windows Machine, VSCode, Python 3.11, RFW 7.xx.
I m also using a USB-RS485-WE converter.

So, using python Lib ‘pymodbus’ I wrote a class driver.
I wrote Wrapper in python, that calls the Driver Class, instanciates the Driver Class Object, and provide Keywords to RFW Resource file, using ‘@keyword’ decorator.

I also wrote a Modbus.resorce, that uses the Wrapper , and extends Modbus Keywords.

Then, I Have my TestSuite file, with specific keywords and Test Cases …
All good, as a first approach.

But Now I need some feedback.

I m experiencing some Communication Issues when running the testCases. I dont have consistent comunications, I have a lot of erros stating like ‘Modbus Error: [Invalid Message] Incomplete message received, expected at least 4 bytes (3 received)’

Its worth to note that, ‘pymodbus’ Lib, is already being used in a GUI without problems, and also HW Slave as passes several tests without Communication Issues.

This kind of communication problems are only found when using RFW.

Any of you have experience such kind of problems?
There are any king of recomendations when dealing with Serial Communications & RFW?
Ther are any tweak I can work with?

any tip?

thank in advance

Hi There,

I did descrive the problem, but luckly I also found the solution.

So, I m using pymodbus Lib, (# pip install --upgrade pymodbus==3.6.8), and I did notice the ‘:param strict: Strict timing, 1.5 character between requests.’ Using it as False, you will get a more reable coomunication.

It is ok, for functional tests…

br

1 Like