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

Problems with sending UDP using the Ethernet Shield

By
Guest
on 7/11/18, 1:24 PM 257 views

Hello,

No matter what I try, the M-Duino PLUS PLC is not sending anything via UDP. I have tested with a RPi and python scripts and they work but with your PLCs I can't.



0

Alejandro Jabalquinto

--Alejandro Jabalquinto--

1000000016
| 0 0 0
--Alejandro Jabalquinto--
Alejandro Jabalquinto
On 7/11/18, 1:29 PM

Hello,

Unfortunately with this information it cannot be seen where could be the problem. We let you the steps of working with the Ethernet Shield.

Hardware: 
- PLC connected to 24V
- Verify that when you connect the RJ-45 wire the lights of the RJ-45 are lit. If they are not lit it means is not working. It won't lit if you don't have the 24V connected or if you haven't connected it the other side of the RJ-45

Software:
Library: Ethernet2.h and EthernetUdp.h

See an example here: https://www.arduino.cc/en/Reference/EthernetUDPWrite "IMPORTANT TO CHANGE Ethernet.h for Ethernet2.h"
About the Ethernet2, this is because our shields use the W5500 Ethernet Chip for the PLUS version. For V7 we were using the W5100.

If you want to verify by software aswell that the Ethernet Chip is "working" you can try also this from this post: http://blog.industrialshields.com/en/ethernet-test-on-m-duinos-plus-version/

The idea is to put the first part of the sketch:

#include <Ethernet2.h> 
#include <SPI.h>

byte _mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xEA };
byte _ip[] = {10, 20, 30, 15}; byte _server[] = {216, 58, 201, 132};

void setup() {
Serial.begin(9600L);
Serial.println("mduino-plus Ethernet test started");
Ethernet.begin(_mac, _ip);
Serial.print("IP: ");
Serial.println(Ethernet.localIP());


void loop() {}

The idea is that when it Serial.println(Ethernet.localIP()) it should show you the IP you have set in the Ethernet.begin(mac, ip). If it shows you the IP 0.0.0.0 it means is not working either.

Try these things and you comment me!
  • Flag

I wasn't using the 24V and I was using the Ethernet.h library instead of the Ethernet2.h. Now everything works as expected!

Thank you very much!

Guest
on 7/11/18, 1:32 PM

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/11/18, 1:24 PM
Seen: 257 times
Last updated: 12/5/18, 1:52 PM