A PLC and wiring in an industrial control cabinet

The first connection made with Kepware Server (formerly KEPServerEX) is usually easy: a channel, a device, a few tags and values start to flow in OPC Quick Client. The hard part is keeping the structure tidy, fast and easy to maintain when there are hundreds of tags and dozens of devices. This article explains the channel–device–tag model that underlies the configuration and the good practices built on it.

In short

Think about names up front, separate channels by physical connection, set scan and timeout settings to the device’s real behaviour, and keep diagnostics on.

The project hierarchy

The Kepware Server project hierarchyA channel defines the physical connection and driver, a device a specific controller, a tag group the logical grouping and a tag a single data point; the names form the OPC item path.ChannelDriver and physicalconnection (networkadapter, serialport)DeviceController addressor IP, model, timingand scan modeTag groupLogical grouping:equipment or systemTagAddress, datatype, scan rate,access, scalingChannel1.Line2_PLC.Filler.TemperatureOPC item path: clients reference the tag by this path; renaming breaks client references
Names are part of the item path that clients use; they should be permanent and meaningful.
  • Channel: represents a driver and a physical connection (a network adapter or serial port). Communication with devices on the same channel runs in sequence; different channels run in parallel.
  • Device: a specific controller; address or IP, model, timing and scan mode are set here.
  • Tag group: a logical folder that collects tags by equipment or system.
  • Tag: a single data point; it holds address, data type, scan rate, access (read-only or read/write) and scaling.

Naming: the most expensive mistake

Channel, device and tag names form the OPC item path (Channel.Device.Group.Tag). Clients such as SCADA, historians and OPC Router reference tags by this path. Renaming later breaks references in all of those clients. Therefore:

  1. Name the equipment, not the address. Line2_Filler is a good name, PLC_192_168_1_45 is a bad one; the name stays even if the IP changes.
  2. Set a consistent rule. For example Site_Area_Equipment, and a measurement name for tags (temperature, pressure, state). Write down the case and separator rules.
  3. Mind the restrictions. Names cannot contain periods and cannot start with certain characters; follow the naming rules in the product documentation.
  4. Keep naming aligned with the UNS or data model. This name may later become an MQTT topic name (UNS).

Channel and device settings

SettingWhat it doesTip
Scan modeDetermines whether data is read on client demand or at a fixed scan rateModes that respect the client’s rate avoid needless load on the device
Connect and request timeoutHow long to wait for an unanswered requestIncrease on slow links; very long values make other devices wait
Retry countRepeats before counting a failureA small increase helps on unstable networks
Auto-demotionTemporarily disables a non-responding device to protect the speed of the othersTurn on for wireless or intermittently dropping devices
Block sizeReading consecutive addresses in one requestArranging tag addresses consecutively reduces the number of requests

Practices for performance

  1. Split channels by physical connection. On Ethernet, several channels with the same driver can give parallel communication; on a serial line, one line is one channel.
  2. Choose the scan rate by need. Slowly changing values such as temperature should not be read many times a second; separate fast and slow tags.
  3. Think about device CPU. Many simultaneous requests can affect PLC cycle time.
  4. Remove unused tags. Tags no client uses create needless load.
  5. Decide whether scaling happens at the source or the server and document it; scaling in two places causes errors.

Diagnostics and troubleshooting

  • Use OPC Quick Client to verify the tag’s value, quality and timestamp (data quality and timestamps).
  • Use channel diagnostics and the event log to follow errors, timeouts and retry counts.
  • “Bad” quality is usually from communication (network, address, firewall), address (a non-existent data block) or access (permission on the PLC side); eliminate them in turn.
  • Some drivers can generate tags automatically from the device; this saves time, but review the generated names.

Project management

  • Keep the project file under version control or in regular backups (redundancy, buffering and recovery).
  • Record changes: who, when, why.
  • Do not experiment directly on the production server; test in a test project first.
  • Add plug-ins (IoT Gateway, DataLogger, Advanced Tags) when needed and in a documented way.

You can check which driver a device needs in the driver list, and protocol selection in industrial protocols and driver selection.

Frequently asked questions

Should I create a separate channel for each PLC?

On Ethernet, yes, or a balanced distribution across enough channels, works well because channels run in parallel. On a serial line, the same physical line is one channel. Follow the limits in the driver documentation.

What happens if I rename a tag?

Because the OPC item path changes, references break in every client that calls the tag by name. That is why names should be chosen permanently up front.

Can Kepware Server serve OPC UA and OPC DA at the same time?

Yes; the same tags can be served over both interfaces. This is used as a bridge when moving from DA to UA.