Skip to content
You Start with one site
Amounts in Start with one site
Engineering · Control, Measurement & Energy

Industrial Communication

Get the numbers out of the meters, drives and engines a site already has, correctly and without gaps. Ten lessons on one site: a meter and a drive on RS-485, a generator on CAN, and a gateway.

Found this useful?
The RS-485 bus of the course: lines B and A run 180 m from the gateway end to the last meter, with a 120 Ω termination at each end, a 680 Ω bias resistor from 5 V to line B and another from line A to common, and meter 5, drive 10 and two more meters along the line.

An energy meter answers every request on the bench, and on site, at the end of 180 m of cable, nine requests in ten. A report says a compressor used 16 million kilowatt-hours in seven months: two register words in the wrong order. A generator stops on low oil pressure that had been falling for three weeks, sent on its network twice a second, and nobody was listening.

In this course you wire and check the bus, build and read frames byte by byte, decode the register map and time the poll cycle. Then you carry the readings upward, keep the record honest when the link fails, and find the fault on a silent bus in the fastest order.

From the wire to the record
  1. 1Wire the busOne line, a termination at each end, and bias at one place.
  2. 2Read the bytesWho was asked, what was asked, and a check that it arrived intact.
  3. 3Time the cycleOne dead meter at 1 s and 3 retries: 4,263 ms a cycle, against 286.
  4. 4Keep the record honestA gap shown as a gap, never a last value drawn across it.
You will be able to
  1. Wire, terminate and bias an RS-485 bus, and prove it with a multimeter
  2. Build and decode Modbus and J1939 frames, and design a poll cycle that one dead meter cannot slow
  3. Carry readings upward with MQTT or OPC UA, keep the record honest through an outage, and find the fault on a silent bus

New to this? New to field buses? Start with lesson 1: why a bus that works on the bench fails on site.

You need A computer with Python, numpy, scipy and matplotlib. On a real site: a multimeter, and the site's permission.

The engineering behind it

Most equipment already measures what you need. Learn to get those numbers out of it, correctly and without gaps.

Lessons
Lesson 1 · 24 minRS-485: Wiring, Termination and BiasingWhy a bus that works on the bench fails on 180 m of cable, and the three resistors that decide it.Differential pairTerminationBiasUnit loads Lesson 2 · 26 minModbus RTU: Frames, Function Codes and the CRCA request to an energy meter byte by byte, its CRC, the reply, and the short frame of a refusal.FramesFunction codesCRC-16Exceptions Lesson 3 · 25 minRegister Maps, Data Types and ScalingRaw words into volts, amps and kilowatt-hours, in the right word order, tested before anyone trusts them.Register mapSigned and unsignedFloat32Word order Lesson 4 · 25 minModbus TCP and GatewaysThe same request over Ethernet, what a gateway does with it, and why a second client makes healthy meters time out.MBAP headerPort 502Unit identifierGateway queue Lesson 5 · 26 minPolling Design: Timing, Timeouts and RetriesHow long a poll cycle takes, and how to stop one dead meter from slowing all the others.Transaction timeTimeoutsRetriesBack-off Lesson 6 · 24 minCAN and J1939 on Engines and GeneratorsEngine speed, temperature and oil pressure from a generator, read without disturbing it.CANJ1939PGNListen-only Lesson 7 · 26 minMQTT and Sparkplug BPublish through a broker, and the rules that tell a host when a value is still alive.BrokerQoSBirth and deathSequence Lesson 8 · 26 minOPC UA: Data With MeaningA server that sends the meaning with the value, and when that is worth its weight.Address spaceStatus codesSubscriptionsCertificates Lesson 9 · 24 minTimestamps, Buffering and GapsThe time of each reading, a buffer for the outage, and gaps shown as gaps.UTCStore and forwardQuality flagsCounters Lesson 10 · 25 minDiagnosing a Silent BusFind the fault on a silent bus from the bottom up, with a multimeter and a capture of the bytes.Resistance checkIdle voltageError patternsCommissioning record
More about this course

Every number has a reason

A bus does not work because the software is right. Each number comes from the cable, the protocol or the time the record must survive.

  • 120 Ωat each end of the bus and nowhere else; with the power off, about 60 Ω between the linesRS-485
  • 357 mVthe idle voltage with 390 Ω bias; 680 Ω gave 211 mV, under the 300 mV it should haveBiasing
  • 4.01 ms3.5 character times of silence at 9600 baud, which mark where one frame endsModbus RTU
  • 3 × the longest answerthe timeout, with one retry; a dead node costs its timeout times its attempts in every cyclePolling
  • 32 MB72 hours of the cold store bus need 15.8 MB, so the record survives a long outageBuffering

The meaning in the message, or a map beside it.

Modbus and Sparkplug B
Light and simple
  • Bare 16-bit words, meaning from the register map
  • Sparkplug B adds birth, death and sequence on the uplink
  • Often the better tool for a small or remote site

The test: is the map written down and kept?

OPC UA
Data with meaning
  • Type, units, status and time with each value
  • Subscriptions in place of polling
  • Costs memory, certificates and modelling work

The test: must many systems find the data by themselves?

The tools

PythonEach lesson builds real frames byte by byte and checks them in code.
One siteEnergy meters and a drive on RS-485, a generator on CAN, and a gateway.
Modbus RTU and TCPFrames, CRC, register maps, gateways and timing.
MQTT and OPC UASparkplug B rules and a self-describing server, on the uplink.
A multimeterResistance and idle voltage find most faults on a silent bus.
Windows, Mac and LinuxPython runs the same on every system.

Honest limits. Writing to a drive or a breaker over a network can start a machine, so commands are made only under the site's permit, and no safety function may depend on a network. Time stamps and the buffer stay in the gateway on site; the long record, the gap report and the comparison between sites are kept beyond it.

Before you start

The full course notes

The meter is fitted, the drive is running, and the screen shows nothing. Most installed industrial equipment already measures what a site needs to know, and the numbers stay inside it because nobody could get them out. This course is about getting them out correctly: the wiring, the frames, the register maps and the timing. #Modbus #RS485 #IndustrialCommunication

It follows one site: an energy meter and a variable speed drive on an RS-485 bus, a generator controller on CAN, and a gateway that carries their readings upward. Each lesson builds real frames byte by byte and checks them with code.

What you need

A computer with Python, and three libraries.

Terminal window
pip install numpy scipy matplotlib

Lessons

Lesson 1: RS-485: Wiring, Termination and Biasing

Why a bus that works on the bench fails on site, and the three resistors that decide it.

Open

Lesson 2: Modbus RTU: Frames, Function Codes and the CRC

Build and read a frame byte by byte, and compute its check.

Open

Lesson 3: Register Maps, Data Types and Scaling

Turn raw register words into volts, amps and kilowatt-hours, in the right byte order.

Open

Lesson 4: Modbus TCP and Gateways

The same request over a network, and what a gateway does to it.

Open

Lesson 5: Polling Design: Timing, Timeouts and Retries

How long a poll cycle takes, and what one dead meter does to it.

Open

Lesson 6: CAN and J1939 on Engines and Generators

Read engine speed, temperature and pressure from a generator without disturbing it.

Open

Lesson 7: MQTT and Sparkplug B

Publish and subscribe, and the rules that make the data mean something.

Open

Lesson 8: OPC UA: Data With Meaning

What a self-describing server gives you, and when it is worth its weight.

Open

Lesson 9: Timestamps, Buffering and Gaps

Keep a record honest when the link fails.

Open

Lesson 10: Diagnosing a Silent Bus

A method that finds the fault in the order that is fastest.

Open

What this course does not cover

Writing to a drive or a breaker over a network can start a machine. Commands to plant are made only under the site’s permit and lock-out rules, and no safety function may depend on a network. Wiring inside a mains panel is for a licensed electrician.



© 2021-2026 SiliconWit®. All rights reserved.

10 lessons, in order.

SiliconWit makes these courses. We also run siliconwit.io, a monitoring service.