Yaskawa V1000 Modbus via MAX485

Hello all. Im trying to connect Yaskawa v1000 to arduino via rs485 ...I have 2 pcb MAX485..

Текстов блок

#define SerialControlPin 44
#define SerialControlPin2 46
#define RS485Transmit HIGH
#define RS485Receive LOW

void setup()   
{
  Serial.begin(9600);
  
  pinMode(SerialControlPin, OUTPUT);
  pinMode(SerialControlPin2, OUTPUT);
  digitalWrite(SerialControlPin, RS485Receive);
  digitalWrite(SerialControlPin2, RS485Transmit);
  Serial1.begin(9600);
  delay(2000);
}
void loop()   
{
 

 // byte msg[] = {0x01,  0x08 , 0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48};
//  uint16_t CRC = ModRTU_CRC(msg, 10);
 
  
 byte request[] = {0x01, 0x08, 0, 0, 0xA5, 0x37, 0xDA, 0x8D};   // Test loop code
//  byte request[] = {0x01, 0x10, 0x00, 0x01, 0x00, 0x02, 0x04, 0x00, 0x01, 0x02, 0x58, 0x63, 0x39};    // Change to 60Hz and turn on
  //byte request[] = {0x01, 0x10, 0x00, 0x01, 0x00, 0x02, 0x04, 0x00, 0x00, 0x02, 0x58, 0x32, 0xF9};    // Change to 60Hz and turn off

 // Serial1.write(msg, 10);
//  Serial1.write((byte) CRC);

  Serial1.write(request, 8);

  Serial1.flush();
  delay(10);

  
  while(Serial1.available())
  {
    Serial.print(Serial1.read(), HEX);
    Serial.print(" ");
  }

  Serial.println();
  
  
  delay(5000);
}

uint16_t ModRTU_CRC(byte buf[], int len)
{
  uint16_t crc = 0xFFFF;
 
  for (int pos = 0; pos < len; pos++) {
    crc ^= (uint16_t)buf[pos];        // XOR byte into least sig. byte of crc
 
    for (int i = 8; i != 0; i--) {    // Loop over each bit
      if ((crc & 0x0001) != 0) {      // If the LSB is set
        crc >>= 1;                    // Shift right and XOR 0xA001
        crc ^= 0xA001;
      }
      else                            // Else LSB is not set
        crc >>= 1;                    // Just shift right
    }
  }
  // Note, this number has low and high bytes swapped, so use it accordingly (or swap bytes)
  return crc;  
}

what happens ? are you receiving any information?
a useful tool is a USB-RS485 dongle which you can plug into a PC to aid debugging the network
have you the terminating resistors?

I have only receve 0 zeros.. or ?????? i dont know

have you the baudrate correct - try 115200?
the protocol is modbus - try a web search for arduino modbus
have a look thru the V1000 documentation for details

Not sure if this will be of interest, but I found a PDF of the technical user manual here.

Section C4 (Connecting to a Network) says in the note to step 1:

When using RS-485 communications, connect S+ to R+, and S- to R- as shown in the diagram below.

The wiring diagram on the following page shows how to wire up for RS-485.

I tried evrything in v1000 manual. I have USB-RS232 connector thats conecct with no problem with device but with yaskawa's software.I think to buy signal analysator to observate the signal of max485


do you think its matter half or full duplex?

can this dondge help me out with debugging the rs485 comunication to see my mistake?

The way the manual shows the wiring with R+ connected to S+, and R- to S-, then I'd say that was half duplex.

1 Like



The VFD is in CALL mode . Can rs485 work in half duplex with the vfd. The led of max485 nof flash.stay solid.

You probably don't need to buy any more RS-485 equipment. Use your Mega as an RS-485 receiver and create a simple sketch to echo the received bytes back out on the USB serial port direct to your IDE. I think the manual said it was Modbus RTU, so you probably want to output the received bytes as ASCII hex. If you can do that, then you've just got yourself a basic RS-485 packet sniffer that you can use to see what the PC software is saying.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.