Welcome!

This community is for professionals and enthusiasts of our products and services. Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.

0

RS485 malfunction on my M-Duino PLUS. I don't receive anything!

By
Guest
on 7/13/18, 11:18 AM 139 views

Hello,

I want to implement the RS485 protocol communication (Half Duplex) using you equipments. I have already connected my inverter with RS485 to the PLC but it is not showing anything.

What can I do wrong? How can I know that the hardware is working correctly?

Thanks!


0

Alejandro Jabalquinto

--Alejandro Jabalquinto--

1000000016
| 0 0 0
--Alejandro Jabalquinto--
Alejandro Jabalquinto
On 7/13/18, 11:38 AM

Hello,

the best option to verify if the RS485 Half Duplex (A & B) is working correctly is using the Full Duplex mode. With the Full Duplex you will be able to generate an RS485 signal with the (Y & Z) and receive it to the A & B. This way you will be able to see if  the RS485 is receiving correctly. For doing this test you need to configure the following:


Hardware:

- connect the PLC to the 12 to 24Vdc. This supply must be always connected to work with Industrial Shields PLCs.

- Switch configuration: On the left Zone of the bottom shield you will see a switch that let you choose between Half and Full Duplex. As the test requires the full Duplex you will need to set this switch to OFF.

- Connection: A+ connected to Y+, B- connected to Z-


Software:

Usage of our boards: http://blog.industrialshields.com/en/how-to-use-the-mapping-pins-of-industrial-shields-boards/

With our boards installed, upload this sketch:


#include <RS485.h>

#define RATE        4800UL

#define PERIOD      1000

#define DUPLEX      FULLDUPLEX

#define TX_DATA     'a'

unsigned long lastSent = 0;


////////////////////////////////////////////////////////////////////////////////////////////////////

void setup() {

    Serial.begin(9600L);

    Serial.println("rs485-periodic-sender started");

    RS485.begin(RATE, DUPLEX);

}


////////////////////////////////////////////////////////////////////////////////////////////////////

void loop() {

    if (millis() - lastSent > PERIOD) {

        tx();

    }

    rx();

}


//////////////////////////////////////////////////////////////////////////////////////////////////

void tx() {

  RS485.write(TX_DATA);

  lastSent = millis();

  RS485.flush();

}


////////////////////////////////////////////////////////////////////////////////////////////////////

void rx() {

    if (RS485.available()) {

        byte in = RS485.read();

        Serial.print("RX: ");

        Serial.println(in, HEX);

    }

}



  • Flag

I have been able to receive data, I had an external missconfiguration. Everything is working now!

Many Thanks!

Guest
on 7/13/18, 11:41 AM

Keep Informed

About This Community

This community is for professionals and enthusiasts of our products and services. Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together. Read Guidelines

Question tools

3 follower(s)

Stats

Asked: 7/13/18, 11:18 AM
Seen: 139 times
Last updated: 12/5/18, 1:52 PM