How to Configure your IP Address for PC to PLC Ethernet Configuration
This is a simple guide how to configure your PC to communicate with your PLC or any Ethernet device for that matter. It is not meant to be a guide to understanding Ethernet configurations but is the steps to configuring your PC to communicate with your PLC in the bulk of applications.
Determine the IP Address of the device you want to connect to
The first step is to determine the current IP address of your PLC. The easiest way to determine it is to look at an offline copy of your program or if your controller has an LCD display, many times it can be found on it. The second easiest way is to use our SIM-IPE Ethernet IP Address Explorer DHCP and Bootp Server which can read the IP address of most devices. And the third way is to guess. As shocking as the third method may be, it works in a good amount of applications. When guessing, the most popular IP addresses I run into are 192.168.1.XXX, 192.168.0.XXX, and 169.254.XXX.XXX. For the guessing method, simply try the first one with the following step, then the next one, then the next one, and if none of those work, you probably need to look closer at how you could use method one or two. The last one, 169.254.XXX.XXX, is unique in that it means a permanent IP address has not been assigned to the device. See our article How to Set an IP Address of a DHCP Device without a DHCP Server for more information on this situation.
Once we know the IP address of our PLC, then we must configure the IP address of our PC to communicate with it. For these steps, we will say that our PLC IP address is 192.168.1.10. There are two additional pieces of information that make up the basic IP configuration. The subnet mask and the default gateway.
Subnet mask - This determines what IP addresses the device will respond to. For 192.168.1.10 it will almost always be 255.255.255.0. This number is broke into four octets or sections, just like the IP address. Think of these numbers as an adjustable blinder. “0” means the device can talk to anything and the higher the number goes, the less devices it can talk to up to 255, which means it can talk to no devices. Again, I’m trying to put this in real basic terms, if you want to know the technical details then google class A, B, and C IP addresses. If you would like us to write an article on that, then tell us in the comment section below. But for now let’s work a few examples.
192.168.1.11 with a subnet of 255.255.255.0. This means the device will talk to other devices with IP addresses that are 192.168.1.1 through 192.168.1.9 and 192.168.1.11 through 192.168.1.254. Let’s break this into the four octets to give us a basic understanding.
192 with a subnet of 255. It will not look outside of 192. IP addresses of 0.XXX.XXX.XXX through 191.XXX.XXX.XXX will be ignored and so will 193.XXX.XXX.XXX through 255.XXX.XXX.XXX.
168 with a subnet of 255. It will not look outside of 168. IP addresses of XXX.0.XXX.XXX through XXX.167.XXX.XXX will be ignored and so will XXX.169.XXX.XXX through XXX.255.XXX.XXX.
1 with a subnet of 255. It will not look outside of 1. IP addresses of XXX.XXX.0.XXX will be ignored and so will XXX.XXX.2.XXX through XXX.XXX.255.XXX.
10 with a subnet of 0. With a 0, it can see anything in this octets range of XXX.XXX.XXX.0 through XXX.XXX.XXX.255 EXCEPT itself, see below for further discussion of duplicate IPs.
Default gateway - Don’t worry about this for our basic example of connecting. You can leave it blank or if you know the PLC’s default gateway, you can make it the same.
We now know the IP configuration of the PLC and can use it to determine the IP address configuration we should put into our PC. For the IP address, make the first three octets the same, and the last on unique to the network. So we are going to choose 192.168.1.123 with a subnet of 255.255.255.0. Again this choice is based off of us having a simple network of just a PC and a PLC.
Also now is a good time to note an error we see a lot. You discover your PLC’s IP address is 192.168.1.10 and you make your IP address 192.168.1.10. This is called a duplicate IP address and will not work.
Set your PCs IP configuration
We are actually on the home stretch now, there is only one more major hurdle to overcome. With new PCs having multiple network adapters including wired, wireless, bluetooth, VPNs, etc, it can be tough to figure out which adapter to change the network settings of.
1. Go to the Start Menu, type “Control Panel”, and click on Control Panel.
2. In the top right of the Control Panel, type “Network and Sharing Center” in the search box and click Network and Sharing Center.
3. Find the basic network information. This list your active networks. By plugging and unplugging your network cable from your PC that you are trying to connect to the PLC with, you will see either that network disappear or show a status of unplugged. This tells you which network you need to change the IP configuration of.
4. Click on the connection name and the network that needs configured which will bring up the Status dialog. Click the Properties button.
5. In the “This connection uses the following items” section, find “Internet Protocol Version 4 (TCP/IPv4)". Highlight it and click the Properties button.
6. Most PCs will be set to DHCP by default.
7. Select the “Use the following IP address:” radio button and enter an IP address of “192.168.1.123”, then press the TAB button on your keyboard and you should see the generic subnet of 255.255.255.0 be automatically entered. If it doesn’t, manually enter it, leave the subnet blank, don't worry about the DNS entries, and click OK.
8. Now it is time to see if our configuration is correct. To do this go to the Start Menu, type “CMD”, and click on “Command Prompt”.
9. Type “ping 192.168.1.10” and carefully view the response. If it says “Reply from 192.168.1.10:...” then you are ready to communicate with your PLC. If it says anything else including “Request timed out” or Destination host unreachable” then your configuration is not correct. Do not try to continue further.