How to Set the IP Address of Your Computer

Efficiently set up a static IP on your computer for PLC communication.
Listen to this article

Hello and welcome back to another article from RealPars, the world’s largest online learning platform for cutting-edge industrial technologies.

In this article, you will learn how to set a static IP address on your PC so that it can communicate with another device on a local Ethernet network.

When programming PLCs, you will need to configure the IP address of your laptop so that you can download and test the PLC application.

If you are interested in learning more about writing, downloading, and testing PLC programs, we cover the process in detail in our course CODESYS 1: Introduction to PLC Programming.

Before we dive in, let’s do a quick recap on networking basics by talking about what an IP address is, how an IP address is assigned, and why we use static IP addresses in industrial automation.

What is an IP address?

Any device that communicates on an Ethernet network using a TCP/IP-based communication protocol must have an IP address.

This IP address is a unique identifier for the device that other devices can use to communicate with it.

In case you aren’t familiar with it, TCP/IP stands for Transmission Control Protocol/Internet Protocol.

This is the communication protocol that powers the internet and is used as the basis for many industrial communication protocols like EtherNet/IP, the communication protocol used by Allen Bradley PLCs.

What is an IP address

Now that we know what an IP address is, let’s look at how IP addresses are structured.

How is an IP address structured?

An IP address is made up of four octets, which are numbers in the range of 0 to 255, separated by period characters. An example of an IP address is 192.168.1.10.

The IP address of a device contains a subnet address and a node address.

A subnet mask defines which portion of the IP address is the subnet address. The most commonly used subnet mask is 255.255.255.0. When using this subnet mask, the first three octets of the IP address are the subnet address.

In the example above, the subnet address is 192.168.1 and the node address is 10.

Structure of an IP address

This is important because two devices can only communicate with each other if they are on the same subnet or a router routes packets between the devices over different subnets.

Networking and routing are complex topics. To keep things simple, you will generally configure your computer and the device you want to communicate with to be on the same subnet so that they can communicate directly with each other.

Communication on the same subnet

Now that we know how an IP address is structured, let’s see how you can configure a static IP address for your laptop.

Configure an IP address

On my computer, I can open the Network and Internet settings by right-clicking on my WiFi icon and clicking on Open Network & Internet settings.

Configure an IP address - network & internet settings

In the Network and Internet Settings window, I can configure my computer’s network adapter by clicking on the Change adapter options button under Advanced network settings.

Configure an IP address - Change Adapter Options

The Network Connections window opens.

This window contains a list of all the network adapters that are available on your computer. Your list may have a different number of entries than mine with different names.

You should see one network adapter called Ethernet.

This is the adapter for the physical Network Interface Card, or NIC, that is installed on your computer and allows your computer to communicate with other devices over an Ethernet network.

To configure this adapter, right-click on the adapter and select Properties. Notice that you need administration rights on your computer to configure the network adapter.

Configure an IP address - Ethernet

The Ethernet properties dialog box opens.

In this dialog box, we can configure many different settings for our Ethernet network adapter. In this case, we only need to configure the IP address and subnet mask of the network adapter.

TCP/IP protocol

To configure the IP address, select the Internet Protocol Version 4 (TCP/IPv4) object and click on Properties. Version 4 is the main version of the TCP/IP protocol that is in use today.

Further down the list, there is an object that can be used to configure the TCP/IPv6 settings for your machine, but this version of the TCP/IP protocol is not commonly used in automation and is not interesting for us.

Ethernet properties

The Internet Protocol Version 4 Properties dialog opens. This dialog allows you to configure the properties of your Ethernet network adapter such as the IP address and the subnet mask.

By default, the options Obtain an IP address automatically and Obtain DNS server address automatically are selected.

These options allow your computer to connect to the internet automatically when an Ethernet cable is connected to the computer.

Let’s modify these settings to use a static IP address that is on the same network as the device that we will communicate with.

Select Use the following IP address and enter a unique IP address that is on the same network as the device and the standard subnet mask. In this case, I am using the IP address 192.168.1.20 and subnet mask 255.255.255.0.

I do not configure the other settings. These are advanced settings that are required for your computer to communicate on larger networks. Since we will connect an Ethernet cable directly to the device, we don’t need to configure these settings.

Click OK to finalize the configuration of the IP address for your computer’s Ethernet network adapter.

Internet Protocol Version 4 (TCPIPv4)

Now, your computer can communicate with other devices that are on the same subnet. Let’s test the connection to confirm that everything is working.

Test the connection

You can test that the communication is working between your computer and the target device by pinging the target device from your computer.

To do that, I can open a Command Prompt window by opening the Start menu, typing CMD, and opening the Command Prompt application.

Test the connection - Command Prompt

In the Command Prompt application, I type the command ping 192.168.1.10 which is the IP address of the target device and press Enter.

This command tells my computer to send a packet of data to the device and verifies that a reply is received from the device.

In this case, I see that the device sends a reply so I know that there is communication between my laptop and the device.

Pinging the target device from the computer

If you don’t see a successful reply from the device, go back and check that:

– The IP address of the device is set correctly,

– The IP address of your computer is set correctly,

– The Ethernet cable connecting your computer and PLC is plugged in and working correctly.

Wrap-Up

In this article, you learned what an IP address is and how to configure a static IP address for your computer. This is the first step you take to communicate with other devices on a network.

As well as configuring the communication, you saw how to test the connection between your computer and a device on the network as well as some common steps for troubleshooting communication that doesn’t work.

The ability to connect to devices like PLCs is essential for PLC programmers since it enables them to download and test PLC applications.

CODESYS 1: Introduction to PLC Programming

If you are interested in learning more about how to download and test PLC applications, I highly recommend that you check out our course CODESYS 1: Introduction to PLC Programming. This course teaches you everything you need to know about programming PLCs with CODESYS including writing, downloading, and testing your first PLC application.

Join the Top 1% of Automation Engineers

Try for Free

Learn from
industry experts

Start your learning journey today!

with a free 7-day trial, then $25/month
Start Free Trial Now