Guides /
Finding intermittent PLC–WCS handshake faults: a working checklist
A telegram arrives twice, or a tote stops with no alarm, once a shift. A structured way to find handshake faults between a Siemens PLC and the warehouse control system.
The conveyor PLC and the warehouse control system exchange small messages: a load arrived, where should it go, it has left. Each exchange follows a handshake. When the handshake fails once in a few thousand cycles, the result is a load that stops with no alarm, a duplicate booking, or a destination applied to the wrong load.
These faults are hard to find because nothing is permanently broken. This checklist is a way to work through them in order.
1. Write down the handshake as it is specified
Before you look at code, write the sequence for one exchange as a numbered list. For a typical request and reply:
- The PLC writes the request data.
- The PLC sets “request valid”.
- The WCS reads the data and writes its reply.
- The WCS sets “reply valid”.
- The PLC reads the reply and clears “request valid”.
- The WCS clears “reply valid”.
For each step, note who writes it, what condition allows it, and what happens when it does not occur within a time limit. If the interface specification leaves any of these open, you have found the first candidate. Faults often live in the cases the specification does not mention.
2. Make the fault visible before trying to fix it
A fault that occurs twice a day cannot be watched online. Record it.
- Record every handshake signal for the affected station, plus the data that travels with it: load identifier, sequence number, destination.
- Record on change, with a timestamp from the PLC. Timestamps added by a PC after transport hide the order of events that happened a few milliseconds apart.
- Record for long enough. The standard TIA Portal trace records a short window around a trigger. Recent TIA Portal versions add a long-term trace for S7-1500 that streams to the engineering PC and can run for hours, but that PC has to stay online the whole time. For a fault that appears once a shift, a recorder that runs on its own is often more practical. Either way, you need a way to find the moment afterwards.
- Record both sides. Ask the WCS team for their log of the same period, with the clock offset between the systems.
One recording of the fault is worth more than a week of reading code.
3. Check the usual causes
Data and “valid” bit are not consistent. If the request data and the valid bit are written in different cycles, or read by the partner while they are being updated, the partner can read new data with an old flag or the reverse. Write the data first and set the flag in a later step. The reader must check the flag first and then read the data, or read both in one consistent access, then copy the whole structure once and work on the copy. On telegram interfaces over TCP, the same class of fault shows up as partial or merged telegrams in the receive buffer, because TCP delivers a byte stream and not separate messages.
A signal shorter than the partner’s polling interval. A bit that is set and cleared within one PLC cycle may never be seen by a system that polls every few hundred milliseconds. Signals in a handshake should be held until they are acknowledged. A fixed time is not a substitute.
Reset too early. One side clears its flag on a timer or on a condition that is usually true, before the other side has acknowledged. This works until the partner is slow once.
Duplicate processing after a reconnect. After a communication interruption, one side repeats the last message. Without a sequence number or message identifier that the receiver checks, it is processed twice.
Two writers. The same variable is written from two places in the program, or by the program and an HMI or test tool. Search for every write access to each handshake variable.
Restart behaviour. After a PLC restart or a WCS restart, the two sides disagree about whether an exchange was in progress. Decide and test what each side does with a half-finished handshake.
The mechanical event is the real trigger. A load detected twice by a flickering sensor, or two loads close together, produces a correct handshake for the wrong situation. Record the sensor with the handshake.
4. Reproduce it on a bench
Once you have a suspect, reproduce the timing deliberately. This needs something that plays the role of the WCS and can be told to answer late, answer twice, or not answer at all.
Do this on a test controller or a simulation. Forcing handshake signals on a running plant moves real loads on the strength of a guess.
5. Fix the rule
When the cause is found, fix the general rule in the interface as well as the one station where it showed. If a flag was cleared too early at one station, the same block is probably used at fifty others.
Then update the written sequence from step 1, including timeouts and restart behaviour, and get the WCS side to agree to it. Most recurring interface faults trace back to two teams holding slightly different versions of the sequence in their heads.
A short version
- Write the sequence down, including the failure cases.
- Record all signals on change, with PLC timestamps, for long enough.
- Check consistency, signal length, early reset, duplicates, second writers, restart and the sensor.
- Reproduce on a bench with a controllable partner.
- Fix the rule everywhere and update the specification.
Stuck on a fault like this? See the PLC and WCS service.
Send a sample and get a fixed quote
Email a few pages, a DXF or a description of the fault. You get a price and a delivery date before any work starts.
Or write to [email protected]. Replies within one business day.