1
\$\begingroup\$

I am new to PLC technology and I am doing the following step, listed below:

  • Connect from PLC to retrieve data through Ethernet using Modbus TCP/IP.

I found that PLC didn't have its IP address listed on it (do PLCs usually have their IP address on it?) but I do have a MAC address: xxxxxx. Then I read some documentation:

The default IP address is based on the device’s MAC address. The first two bytes are 10 and 10. The last two bytes are the last two bytes of the device’s MAC address.

The default subnet mask is 255.0.0.0.

NOTE: A MAC address is always written in hexadecimal format, and an IP address in decimal format. You must convert the MAC address to decimal format.

Example: If the MAC address is xx.xx.xx.xx.xx.xx, the default IP address is 10.10.128.242,

So I tried to convert the last two MAC address. Here I got 10.10.161.157, and when I try to ping it it doesn't work.

Any suggestion would be nice, thank you.

\$\endgroup\$

closed as off-topic by duskwuff, RoyC, Dave Tweed May 28 at 14:46

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on the use of electronic devices are off-topic as this site is intended specifically for questions on electronics design." – duskwuff, RoyC, Dave Tweed
If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ Please edit your question and capitalise and punctuate properly to make it more readable. The title too. Welcome to EE.SE. \$\endgroup\$ – Transistor Jan 11 at 10:08
  • 1
    \$\begingroup\$ See my answer below. I fixed your question. Click on the "edited xx minutes ago" link to see the difference. Pay attention to writing style. It will make a big difference to your career. \$\endgroup\$ – Transistor Jan 11 at 10:38
  • \$\begingroup\$ Is this a new unit or used unit? \$\endgroup\$ – Jeroen3 Jan 11 at 10:43
  • \$\begingroup\$ @Jeroen3 it is a new unit \$\endgroup\$ – tony chen Jan 11 at 11:05
  • \$\begingroup\$ I think it's good practice not to broadcast MAC addresses. Perhaps you should edit/obfuscate it. \$\endgroup\$ – K H Jan 12 at 6:04
0
\$\begingroup\$

Your MAC (note capitals) address to IP (note capitals) address conversion is correct.

Check your IP configuration settings:

  • CMD window, ipconfig.

If you don't see an IP address starting with 10.x.x.x and subnet mask 255.0.0.0 then that's at least part of your problem.

To ping the PLC do the following:

  • Set PC IP address to another address in the same subnet. Since the PLC's subnet is 255.0.0.0 this can be any valid address in the 10.x.x.x range other than the PLC's. Try 10.1.1.1.
  • Set the PC's subnet mask to 255.0.0.0.
  • Gateway settings do not matter.
  • Connect the PC to the PLC. Check the Ethernet port LEDs light up.
  • ping 10.10.161.157.

There is a small chance that you don't have automatic cross-over on your network interface card. In that case you have two options:

  1. Use a cross-over Ethernet patch cord.
  2. Use a router, set it's LAN IP address to 10.1.1.2, subnet to 255.0.0.0 and plug both devices into LAN ports. Try to ping again.
\$\endgroup\$
  • \$\begingroup\$ im using ubuntu, i do ifconfig and i dont see any ip address starting with 10.x.x.x, whats the problem ? its starting to confuse me \$\endgroup\$ – tony chen Jan 11 at 11:33
  • 1
    \$\begingroup\$ Tony, please write properly. If you code as sloppily as you write you're going to be in trouble. You need to set the IP address of your computer. This article may help. \$\endgroup\$ – Transistor Jan 11 at 11:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.