Troubleshooting Communication Issue: Connecting Delta PLC DVP12SA2 with Arduino Using MAX 485 Module

Question:

When attempting to transmit data to an Arduino using the MODWR function block, I encountered an issue. I utilized code found online for both the PLC and Arduino, as well as the wiring instructions for the MAX485 module. Despite indications that the PLC is communicating correctly (with the COM 2 LED blinking) and the Arduino code printing '0' in the serial monitor, the data I am sending does not appear to be received by the Arduino as expected. The connection setup is as follows: - PLC to MAX485: + to A - to B SG to GND VCC not connected - MAX485 to Arduino: DI to RX RO to TX DE, RE to GND (Arduino GND) The issue I am facing is that the Arduino is not receiving the input values correctly. Any assistance would be greatly appreciated. Arduino code snippet is as below: #include #include #define ID 1 Modbus slave(ID, 0, 0); int8_t state = 0; unsigned long tempus; uint16_t au16data[2]; const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup() { slave.begin(19200); tempus = millis() + 100; digitalWrite(13, HIGH); lcd.setCursor(0, 1); lcd.print("ValModbus="); } void loop() { state = slave.poll(au16data, 2); Serial.print(au16data[0]); if (state > 4) { tempus = millis() + 50; digitalWrite(13, HIGH); } if (millis() > tempus) digitalWrite(13, LOW); lcd.setCursor(10, 1); lcd.print(au16data[0]); lcd.print(" "); }

Top Replies

Having dealt with numerous individuals encountering difficulties with the MAX485 board, the initial step is to ensure a 5V connection to the VCC terminal block for power supply. Additionally, it may be necessary to eliminate the internal 120 ohm termination resistor (R7) on the MAX485 and disable any termination on the Programmable Logic Controller (PLC). Another option is to implement idle biasing by incorporating resistors (e.g. 470, 560, or 680 ohms) from the + line to 5V and from the - line to GND. For more insights and solutions, you can refer to discussions on various forums such as the following: - Troubleshooting low voltage issue on the MAX485 module - Integrating an ABB inverter (slave) with MAX485 and Arduino (master) These forums provide valuable information and troubleshooting tips for individuals encountering similar challenges with their MAX485 boards and related applications.

In my experience, I have encountered numerous individuals facing challenges with the MAX485 board. To ensure proper functionality, it is essential to connect a 5V power source to the VCC terminal block. Additionally, it may be necessary to eliminate the built-in 120 ohm termination resistor (R7) on the MAX485 and disable any termination on the PLC. Alternatively, you can implement idle biasing by adding resistors (e.g. 470, 560, or 680 ohms) from + to 5V and from - to GND. For further insights and troubleshooting, I recommend exploring discussions on various forums, such as the following: - Troubleshooting the MAX485 module RO pin voltage discrepancies when collecting data from an energy meter via modbus RTU. - Addressing the "ModbusMaster invalid response slave ID exception" while working on an ABB inverter (PRO-33) with MAX485 and Arduino. If you are new to this field and seeking comprehensive guidance on establishing connections and configurations, I suggest seeking relevant documentation or a step-by-step guide available online. Your willingness to learn and seek assistance as a beginner will significantly benefit your understanding and progress.

If you are using the MAX485 board, here are some helpful resources for you: The MAX485 TTL to RS-485 Interface Module available at ProtoSupplies enables microcontrollers to utilize robust long-distance serial communications using RS-485 differential signaling. It is important to ensure correct connections when setting up your MAX485 board. Make sure to connect PLC to MAX485 as follows: + to A-, - to B, SG to GND, and connect VCC to a 5VDC power supply. Additionally, connect SG from your PLC and the negative leg of your 5VDC power supply to the MAX485's GND. When connecting the MAX485 to an Arduino, follow the connections: DI to RX, RO to TX, DE and RE to GND (Arduino GND). For two-way communication, tie DE and RE together and connect them to a GPIO pin on the Arduino. Remember to set the GPIO pin (RS-485 data enable) high in your Arduino code while transmitting. Make sure to review and verify your connections to ensure proper functionality.

In case you are using the MAX485 board, here are some essential resources to refer to for better understanding: The MAX485 TTL to RS-485 Interface Module by ProtoSupplies allows microcontrollers to utilize RS-485 differential signaling for reliable long-distance serial communications. When connecting your PLC to the MAX 485 module, make sure to follow the correct wiring instructions as indicated by the colors green (correct), red (incorrect), and orange (requires review). Additionally, ensure that the VCC is connected to a 5VDC power supply for proper functionality. For connecting the MAX 485 to an Arduino, follow the outlined connections for data input (DI), data output (RO), driver enable (DE), and receiver enable (RE). It is important to tie together DE and RE if two-way communication is needed, with both connected to a GPIO pin on the Arduino. Remember to set the GPIO pin high during transmission in your Arduino code. Don't forget to test these connections and functionalities, and feel free to reach out for further assistance. Your feedback is greatly appreciated.

From your description, it appears your MAX485 VCC line is not connected. The VCC line powers the MAX485 so it should be connected to a 5V power source. Moreover, the DE and RE pins should not be connected directly to GND. They control the direction of data flow in RS485 communication - connect DE to a digital pin on your Arduino and set it HIGH (and RE LOW) for sending data, and DE LOW (and RE HIGH) for receiving data. Try making these adjustments and see if it resolves your issue.

More Replies →

Streamline Your Asset Management
See How Oxmaint Works!!

✅   Work Order Management

✅   Asset Tracking

✅   Preventive Maintenance

✅   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

To add a comment, please sign in or register if you haven't already..   

Frequently Asked Questions (FAQ)

FAQ: FAQs:

Answer: 1. Why is the Arduino not receiving the input values correctly when connecting to a Delta PLC DVP12SA2 using a MAX485 module? - The issue may stem from the wiring connections or the code implementation. Double-check the connections and ensure they match the provided setup. Additionally, review the Modbus communication settings in both the PLC and Arduino code for any discrepancies.

FAQ: 2. What could be causing the data transmission issue between the Delta PLC and Arduino via the MAX485 module?

Answer: - Possible reasons for the data transmission problem could include incorrect wiring, mismatched communication protocols, or errors in the code configuration. Verify that the wiring connections are accurate and that the Modbus settings in both devices are correctly configured.

FAQ: 3. How can I troubleshoot communication problems between the Delta PLC and Arduino when using the MODWR function block?

Answer: - To troubleshoot communication problems, start by verifying the physical connections between the PLC, MAX485 module, and Arduino. Then, check the Modbus configuration settings in the PLC and Arduino code. Testing each component individually can help isolate the source of the issue.

FAQ: 4. What steps can I take to ensure successful data transmission between the Delta PLC DVP12SA2 and Arduino via the MAX485 module?

Answer: - To ensure successful data transmission, carefully follow the wiring instructions provided, confirm the Modbus communication settings match between the devices, and thoroughly test the code implementation. Debugging by monitoring the communication indicators and output values can aid in identifying and resolving any issues.

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  â†’