Modbus communication, don't understand the response I'm getting

I have a variable frequency drive attached to an Arduino via an RS485 module. I've got communication working between the two, but I'm clearly sending the wrong command address or words as I'm getting a reply I don't understand, and not seeing the actions I'd expect.

At the moment I'm just trying to verify that I understand what's going on, and that I can activate the VFD, so I'm sending:

0x01 0x06 0x00 0x20 0x01 0x00 0x89 0x90

Which is addressing device 0x01 with command 0x06 (write), address 0x2000, command 0x0001 and then a two byte CRC. Note that low bites are sent before high bytes as per the manual of this device.

The response I'm getting is:

0x01 0x06 0x80 0x01 0x00 0x04 0xF0 0x09 0x00

I'm 0x01 and 0x06 are the repeat of the address and command I sent, which makes sense, and the final two bytes are a correct CRC for this message. But the 0x80 and other bytes don't seem to be an error I can find in the manual, or anything that makes sense to me...

The manual is here: https://www.dropbox.com/s/j1zbez2j69bc2fx/KOC100%20Series%20User%20Manual--20150119(V1.1).pdf?dl=0
The description of the modbus interface begins on page 162, and the command I'm trying to use is at the top of page 167.

Hopefully somebody out there knows what's going on here!

Thanks in advance.

My Hayward Max-FLo controller just stopped working, I gave up on diagnosing it but was able to run it with the above VFD, I am trying to do the same thing to bring it back to life as you are tried 4 years ago! have you had any success ? how did you connect power on the VFD side to the RS-485 module mine says TTL but KOC100 can provide only 10V!!!

It's been a long time, but I did get it working. Since then I've got more experience with RS495 too. So I'll tell you what I remember.

I'm not sure what you mean about connecting power on the VFD side to the RS485 module? You only need to connect the RS485 A and B lines. You should also connect a common ground.

Your RS485 module or driver will have one or two enable/disable lines. Typically these can be tied together and pulling in one direction sets the module as a transmitter and the other configures as a receiver (this does all depend on the module you're using).

So you set your module to transmit, send some data, set it to receive, receive some data. There are some problems. You need to make sure your serial port has finished sending data before changing from transmit to receive mode. You can use Serial.flush() for this, but you may also need to add some small delays.

Do you have a scope? Use it to verify what's going on.

Hopefully some of this helps! Good luck :slight_smile: