I am using a Arduino nano to control a constant pressure system. A PID controller is on the nano and I am trying to get the output sent to my VFD via RS485 Modbus. I keep getting an error on the VFD that the data value received in the message is incorrect.
This is the VFD manual GS2 Series Drives User Manual
I am using the ModbusMaster.h library
I copied my modbus code from this website: RS-485 MODBUS Serial Communication with Arduino as Master
as I thought I just need to send a simple 4 digit number representing the frequency. Example 1255 - the drive adds an implied decimal point, 125.5HZ.
my code
node.writeSingleRegister(0x91A,550); //Writes the frequency to the drive
0x91a being the address on the VFD and 550 being 55.0Hz
I also tried changing the 550 to hexadecimal, but that didn't work either.
Before I was using 42331 as the address, which is the Modbus decimal address, but then I got the error "incorrect address" so I switched to "0x91a", now I get the error incorrect data value.
I am thinking I need to processes the "550" before sending it but I am not sure how.
In the future I also want to read data from the drive, once I get this modbus thing figured out.
I am new to programing, I can do basic code for the arduino, this is getting a little deeper and I need some help.