RS485 communication between Arduino and VFD

Im working on my university of controlling a VFD through Arduino. I have been trying to communicate to my VFD via RS485 ASCII protocol but have not been able to successfully establish communication between VFD and Arduino. Whenever i try to start the my Delta VFD-S1 from arduino, only response i get from the VFD is 'CE11' which means there is a communication error. I have attached the schematic, code and Delta VFD-S1 manual (you can refer page 62 chapter 5). Need help from you guys...
e52bdf23eedd2193944ac86324df1a685ab6578e

Manual Link: https://epa.de/download/en/04_Manuals/04.02_Drives/04.02.01_Inverters/04.02.01.03_Delta/DELTA_VFD-S_manual.pdf

Code:

#include <SoftwareSerial.h>
 
const char start_vfd []= {':','0','1','0','6','2','0','0','0','0','0','0','2','D','7','\r','\n'};
 
SoftwareSerial myserial(11,8); // RX, TX

void setup() {
 Serial.begin(9600);
 pinMode(9,OUTPUT);
 myserial.begin(9600);
 digitalWrite(9,LOW);
}

void loop() {
Serial.println("VFD START");
  Serial.print(start_vfd);
}

You're trying to print something that is not a C string as though it were.

start_vfd lacks a very important something (or a nothing!) at the end.

You're also not sending it to the VFD

Please remember to use code tags when posting code

Why not call it "VFD"?

Sorry for not using code tags, i have edited it.
Im confused, how am i not sending it to a VFD? When im serial printing and have connected the VFD to the arduino via MAX485, will the VFD not receive it?

The 8 and 11 pins are the digital pins of the arduino UNO

Because it appears that you're sending it to the serial monitor.

And, indirectly, connected to the VFD.

Yes, it appears on the Serial monitor when i open the Serial Monitor. Does that means it is not being sent to the VFD via RS485? Im sorry im new to modbus communication.

Ok i will change it to SoftwareSerial VFD(11,8);

You have two serial devices, a hardware-backed one called Serial, and a software one called mySerial (or "VFD")
They are not connected in any way, unless you explicitly make them

I have reviewed different codes for Arduino and VFD communication and then developed my own for Delta VFD-S1. They all follow the same pattern. But due to my limited knowledge i may have missed something, can you please guide me on how can i send data via MAX485 to my VFD?

I haven't used a VFD in fifteen years, and I don't have one, so you're going to have to do the leg-work.

If you fix the problem with vfd_start I mentioned in my first reply, and then VFD.print (vfd_start), what happens?

Hint:

const char start_vfd []={":010620000002D7\r\n"}; 

Hi, @dtoxic
Welcome to the forum.

Are you using Modbus in the VSD?
If so what protocol?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Do not forget the 0 at the end of the line.
And do call the member function print of your myserial object and not the one of Serial.
And if you want to receive RS485 trafic as well, be carefull with the control of pin 9.

#include <SoftwareSerial.h>
 
const char start_vfd []= {':','0','1','0','6','2','0','0','0','0','0','0','2','D','7','\r','\n',0};
 
SoftwareSerial myserial(11,8); // RX, TX

void setup() {
 Serial.begin(9600);
 pinMode(9,OUTPUT);
 myserial.begin(9600);
 digitalWrite(9,LOW);
}

void loop() {
Serial.println("VFD START");
  myserial.print(start_vfd);
}

Best Regards,
Johi.

I appreciate your effort. But still no response from the VFD. Also im not getting the CE11 error on the VFD

#include <SoftwareSerial.h>
 
const char start_vfd []={":010620000002D7\r\n"};
 
SoftwareSerial VFD(11,8); // RX, TX

void setup() {
 Serial.begin(9600);
 pinMode(9,OUTPUT);
 VFD.begin(9600);
 digitalWrite(9,LOW);
}

void loop() {
Serial.println("VFD START");
  VFD.print(start_vfd);
}

Im using 7N2 ASCII protocol, i have developed the ASCII code for the START operation of the VFD by the method given in the manual. 'D7' in 010620000002D7 is the 2's complement, the method of calculating 2's complement is described in page 5-69 of the manual.

Nope. Still no response. Baud rate of VFD is 9600, Communication protocol is 7N2 ASCII.

You need to tell SoftwareSerial.

I can tell Software Serial by changing the code to,
SoftwareSerial VFD(11,8); // RX, TX
and then in setup(),
VFD.begin(9600, SERIAL_7N2);
but this gives me an error during compilation.

Did you forget to tell us something?

Im sorry what did i forget?

Read back reply #16 to yourself
Get back to us.

That im using digital pins for serial communication?

You told us you'd got an error.
I can guess what it is, but you could make it certain.
(I already knew you were using digital pins)