Network Topology: Two PLCs Behind a Switch

Tutorial that builds the smallest useful network picture: two Modbus TCP devices connected to one switch, drawn live by the Network Topology object.

Updated 3 min read
On this page (6 sections)
  1. Goal
  2. Step 1: Create the two PLCs
  3. Step 2: Add the switch as a node
  4. Step 3: Connect the PLCs to the switch
  5. Step 4: Place the Network Topology object
  6. Variations

Goal

This tutorial builds a network picture with three nodes: a central switch and two PLCs connected to it. At the end, a page shows the switch on top, the two PLCs below it, and every PLC coloured from its live connection state.

It uses the rule behind the Network Topology feature: every configured device is a node by itself. Only equipment that is not a device (the switch) and the connections between nodes (the links) are entered by hand. The tutorial takes about ten minutes and needs no hardware, because the PLCs run in Simulation mode.

Step 1: Create the two PLCs

Open the Configuration menu, expand Devices and open Modbus TCP Devices. Press Add device and create the first PLC with the values below. Repeat for the second one.

FieldPLC1PLC2
Enablecheckedchecked
NamePLC1PLC2
IP Address10.10.0.1110.10.0.12
Port502502
UnitId11
Simulationcheckedchecked
DescriptionLine 1 PLCLine 2 PLC

Simulation is switched on so the device does not open a real connection and still reports as online. On a real plant, leave Simulation off and enter the address of the PLC. Nothing else in this tutorial changes.

Step 2: Add the switch as a node

Expand Network Topology in the Configuration menu and open Network Nodes. The two PLCs are not listed here: a device is a node automatically and needs no row. The switch is not a device, so it is added as a row. Press Add and fill in the dialog.

FieldValue
NameSW_Core
TypeSwitch
LabelCore switch
IpAddress10.10.0.2
Status Variable(empty)
Group(empty)
DescriptionCentral switch

Type decides the icon and the legend entry. Status Variable stays empty in this tutorial, so the switch is drawn with the Unknown state. Section Variations below shows how to give it a live state as well.

Step 3: Connect the PLCs to the switch

Open Network Links and press Add. A link names two nodes; the From Node and To Node fields suggest every device name and every Network Nodes name. Create the two links below.

From NodeTo NodeLabel
SW_CorePLC1port 1
SW_CorePLC2port 2

A link without a Status Variable follows its two endpoints: it is drawn as up while both nodes are online, and as down as soon as one of them is offline.

Step 4: Place the Network Topology object

Open a page in the designer, drag the Network Topology object from the Standard Objects onto the page and set the following in the decorator.

SectionSettingValue
GeneralTitlePlant network
LayoutLayoutHierarchical
LayoutOrientationTop To Bottom

Save the page and switch to runtime. The object draws SW_Core on top and PLC1 and PLC2 below it, both green because their simulated connection is online. The header counts 2 Online and 1 Unknown (the switch). Click a node to see its details in the panel on the right.

Disable PLC2 on the Modbus TCP Devices page to see the picture react: the node changes to the Disabled state and its link is no longer drawn as up. Enable it again and both return to green on the next refresh.

Variations

The same three rows cover most small networks. Common changes:

  • Live state for the switch: create SW_Core as an ICMP device instead of a Network Nodes row. It is then a node automatically with a ping status, and only the two links remain to be entered. Add a Network Nodes row with the same name afterwards only to change its Type to Switch, because an ICMP device is drawn as a host by default.
  • Refine a PLC: a Network Nodes row with Name equal to the device name changes only the Label, Type, Group, Hidden flag or manual position of that PLC. The node itself, its address and its state keep coming from the device.
  • More PLCs: add the device and one link to the switch. A device without any link is not lost: it is drawn under a virtual node for its /24 subnet, or in the Unlinked lane, until it gets a link.
  • Renames and deletes: renaming a device renames its node row and links with it. Deleting a device removes its node row and every link connected to it.
Something missing or wrong in this article? Contact us