Communication between Delta plc DVP12SA2 and Arduino using MAX 485 module.

yawin

Member
Join Date
Apr 2024
Location
tamil nadu
Posts
3
I'm trying to write a data in Arduino using MODWR function block .I used the code I got from online for both PLC and Arduino. I made the wiring between the MAX485 by referring online which I think may be I did some thing incorrect. But I think the PLC is communicating properly (COM 2 led is blinking) and Arduino code is printing '0' in serial monitor despite I'm sending data as I mentioned in Images I attached(---->Images for the connection program in plc<---link). The connection is as following

PLC to MAX 485:

+TO A
- TO B
SG TO GND

VCC NOT CONNECTED


MAX 485 TO Arduino:

DI TO RX

RO TO TX

DE,RE TO GND(Arduino GND)


PROBLEM: I'm not getting the value that I give to Arduino. pls help me.


Arduino code:-

include <LiquidCrystal.h>​

include <ModbusRtu.h>//Dołaczam biblioteke MODBUS​

define ID 1 // ID Slave (Slave number 1)​

Modbus slave(ID, 0, 0); //Node ID. 0 for the master, 1-247 for slave
//Serial Port (0 = TX: 1 - RX: 0)
int8_t state = 0; //Status variable for the Modbus input buffer
unsigned long tempus; //Variable to store the current time
uint16_t au16data[2]; //The table of records to be shared by Modbus
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

//----------------------Program configuration-------------------------//
void setup() {

slave.begin(19200); //Open communication as a slave to 115200 baud
tempus = millis() + 100; //Save the current time + 100ms
digitalWrite(13, HIGH ); //Turn on the led of pin 13 (the one on the board)

lcd.setCursor(0, 1);
lcd.print("ValModbus=");
}
void loop() {
//Check the input buffer
state = slave.poll( au16data, 2 ); //Parameters: Table of records for the exchange of information
Serial.print(au16data[0]);
if (state > 4) { //If it is greater than 4 = the order was correct
tempus = millis() + 50; //Current time + 50ms
digitalWrite(13, HIGH);//Turn on the led (on the board)
}
if (millis() > tempus) digitalWrite(13, LOW );//Turn off the led 50ms after (on the board)

lcd.setCursor(10, 1);
lcd.print(au16data[0]);
lcd.print(" ");
}
 
I've worked with many people having issues with the MAX485 board.

First, you need to have 5V connected to the VCC terminal block. That's how the board is powered, and it needs to be powered to work.

Next, you may need to remove the built-in 120 ohm termination resistor (R7) on the MAX485 (and remove or disable any termination on the PLC). Alternatively, you can apply idle biasing to the + and - lines by adding resistors (e.g. 470, 560, or 680 ohms) from + to 5V and from - to GND.

Here are some discussions on another forum.
 
I've worked with many people having issues with the MAX485 board.

First, you need to have 5V connected to the VCC terminal block. That's how the board is powered, and it needs to be powered to work.

Next, you may need to remove the built-in 120 ohm termination resistor (R7) on the MAX485 (and remove or disable any termination on the PLC). Alternatively, you can apply idle biasing to the + and - lines by adding resistors (e.g. 470, 560, or 680 ohms) from + to 5V and from - to GND.

Here are some discussions on another forum.
I think I'm doing something wrong in basic connection.Can you share relative documentation or step by step guide for this I looked over online as much as possible.I'm a beginner so, it will be helpful
 
Assuming this is the MAX485 board you're using, here are some references:

There are several issues with your connections (green is correct, red is wrong, orange should be reviewed):

PLC to MAX 485:

+TO A
- TO B
SG TO GND


VCC NOT CONNECTED
VCC should be connected to a 5VDC supply

In addition, you should have 2 wires connected to the MAX485's GND: SG from your PLC and 0VDC (negative leg) from your 5VDC power supply.



MAX 485 TO Arduino:


DI TO RX
RO TO TX

RO To RX
DI TO TX

DE,RE TO GND(Arduino GND)
This is OK if the Arduino is only ever going to receive (transmitting is disabled). But if you need two-way communication (Arduino needs to transmit), DE and RE should be tied together and connected to a GPIO pin on the Arduino. Your Arduino code must set the GPIO pin (RS-485 data enable) high while transmitting.
 
Assuming this is the MAX485 board you're using, here are some references:

There are several issues with your connections (green is correct, red is wrong, orange should be reviewed):

PLC to MAX 485:

+TO A
- TO B
SG TO GND


VCC NOT CONNECTED
VCC should be connected to a 5VDC supply

In addition, you should have 2 wires connected to the MAX485's GND: SG from your PLC and 0VDC (negative leg) from your 5VDC power supply.



MAX 485 TO Arduino:

DI TO RX
RO TO TX

RO To RX
DI TO TX

DE,RE TO GND(Arduino GND)
This is OK if the Arduino is only ever going to receive (transmitting is disabled). But if you need two-way communication (Arduino needs to transmit), DE and RE should be tied together and connected to a GPIO pin on the Arduino. Your Arduino code must set the GPIO pin (RS-485 data enable) high while transmitting.
Thank you.It really helped.I will try it and let you know
 

Similar Topics

To execute MODWR and MODRD instruction of Delta PLC, I need address of register in VLT 2800 but I cannot figure out. Can any body help me? I want...
Replies
7
Views
7,072
Dear friends i am new with prosoft i have a project transfer data from allen bradley to DCS throw MVI56-MCM .please can you help me and explain to...
Replies
3
Views
3,413
hello dear we have a problem with communicate with delta dop hmi and siemens s7-300 cpu . we use ISO ON TCP connection and AG-SEND and AG-RECV...
Replies
2
Views
3,500
Hi, Is it possible to communicate with delta HMI via a PC? I need to monitor the some internal memory of the HMI during operation. thanks
Replies
2
Views
5,049
I have Woodward Controller EASYGEN-3500XT and Phoenixcontact make IO CAN-CUPLER part no: 2702230, Analog Input card: 2861412, Analog Output Card ...
Replies
0
Views
42
Back
Top Bottom