Click PLC System Hardware

Many people ask me what I do when looking at a new PLC model or system. My approach is very straight forward and we will view this in action with this Click PLC series. This series will go from examining the hardware to programming and communicating to the PLC in several ways. If you have questions along the way, please let me know. Keep on Reading!

What Everybody Ought to Know About IP Addressing

Communication using Ethernet usually evolves around the Open Systems Interconnection model (OSI model). This model was made for computing systems to communicate without regard for the underlying internal structure and technology.

Think of it like sending a letter:
You write the message on paper – This is like the protocol that the system will be using. The protocol is like the language that the two devices will be communicating.

Sign it at the bottom of the paper – This signature is like a MAC address for the system. It will uniquely identify you.

Put it into an envelope and address it (Also return address) – This address is like the IP address for the system. It lets everyone know the location that the letter is going and returning.

Stamp, and put it in the mail – This is like the physical cable that we will be using. The schedule pickup, sorting, routing etc. to get you letter to the sender is now out of your hands.
This is similar to the OSI model. The layers within the model will communicate with each other to ensure that the information will get to the designation without error.

IP Address:
An IP (Internet Protocol) Address is a user defined numeric label assigned to a device on an Ethernet network that identifies the network and node. An IP address is a 32 bit address that is normally grouped into 4 bytes for ease of communication and understanding. Example: 192.168.1.1
You can look up your current address by going to the following url:
http://whatismyipaddress.com/

MAC Address:
The MAC (Media Access Control) Address is also called the physical address. This is part of the unique identification on an Ethernet network. The MAC address is a 48 bit address that is normally grouped into 6 bytes for ease of communication and understanding. Example: 00:02:A1:BC:72:33
Here is a URL link to find your MAC address on your computer:
http://www.wikihow.com/Find-the-MAC-Address-of-Your-Computer
Devices use their hardware addresses to communicate with each other within the OSI model.

Ethernet networks support many different types of protocols, including TCP/IP. In the industrial environment you will often here of EtherNet/IP , Modbus TCP, Profinet etc. are all part of TCP/IP.

There are a defined number of IP addresses that have been defined as private IP addresses. These addresses are not allocated to any specific organization and anyone can use these without approval. Choose the one with the range that will fit your application.

Class Private IP Addresses
A 10.0.0.0 – 10.255.255.255
B 172.16.0.0 – 172.31.255.255
C 192.168.0.0 – 192.168.255.255

Subnet Mask:
A subnet mask is an address that enables distinction between networks. It is used to divide the network into smaller units called Subnets. This is beneficial when the office communications are separate from the plant floor communications. It adds level of security and enhances maintenance and upgrade options.
A subnet mask is a 32 bit address that is normally grouped into 4 bytes. This is the same as the IP address, because we compare the IP addresses with the subnet mask to determine if they can communicate directly with one another. If not then the communication must happen through a router to get to the destination. The subnet mask must match for communications to happen.

Example:
Compare the following Modbus TCP addresses and see if they are on the same subnet:
Modbus TCP Address 1: 192.168.1.3
Modbus TCP Address 2: 192.168.0.10
Subnet Mask: 255.255.255.0

Convert these decimal values to their binary equivalent:
(You can do this by using your windows calculator in programmer mode. View | Programmer or Alt + 3)

Modbus TCP Address 1:
11000000.10101000.00000001.00000011
Modbus TCP Address 2:
11000000.10101000.00000000.00001010
Subnet Mask:
11111111.11111111.11111111.00000000
Same Subnet Compare:
11111111.11111111.1111111x.00000000
If the subnet mask has a ‘1’ then compare the two addresses and see if they are similar. In our example there is a difference, so the two devices will not communicate. You must change the subnet mask on the entire system or IP address.

Let’s now change the IP address on Address 2.
Modbus TCP Address 1: 192.168.1.3
Modbus TCP Address 2: 192.168.1.10
Subnet Mask: 255.255.255.0

Convert these decimal values to their binary equivalent:
Modbus TCP Address 1:
11000000.10101000.00000001.00000011
Modbus TCP Address 2:
11000000.10101000.00000001.00001010
Subnet Mask:
11111111.11111111.11111111.00000000
Same Subnet Compare:
11111111.11111111.11111111.00000000
We can now communicate successfully.

Troubleshooting your Ethernet network is easy by using a free product called Wireshark. https://www.wireshark.org/
This software will monitor and display your Ethernet traffic. Highlighting different communication protocols, you can quickly see your communication in action. Introduction to Wireshark Video gives a good overview of what is possible and shows what to look for on your network.

IP Address selection on your network must be unique. You cannot have two addresses the same. As a general rule only those addresses within the same subnet will communicate to each other without the need for a router.

Watch on YouTube : What Everybody Ought to Know About IP Addressing
If you have any questions or need further information please contact me.
Thank you,
Garry



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.