Troubleshooting
Why Complete on a serial communication block is not success
Short answer
A serial communication function block sets Complete when a transaction ends, not when it succeeds: a timed-out or corrupted request also completes, with a nonzero Error word. Accept a new process value only when Complete is set and Error reads zero, keep the last-good value and its validity flag separate, and let one request own a shared serial port until it terminates.
On this page
- Why a failed request also completes
- What the Error word actually carries
- The accept rule in program logic
- Working the accept rule on a five-instrument poll with one offline
- Give one request the port until it ends
- When polling runs slower than expected
- Commissioning checks before you trust the channel
- Questions asked
A serial communication block that reports Complete has told you exactly one thing: the transaction ended. In the OwenNet 1.05 port of the OWEN protocol for SIMATIC S7-1200 and S7-1500 PLCs, a request that times out or receives a corrupt frame also completes — with a nonzero Error word. Accept a new process value only when Complete is set and Error reads zero, keep the last-good reading under its own validity flag, and let one request own the serial port until it terminates.
Why a failed request also completes #
In the original library, Complete stayed clear when a read failed, so logic that waited on Complete never saw a failed transaction end and simply hung on its handshake. The port deliberately sets Complete on every finished acquisition, success or failure. Every initiated request now gets a terminal event, which is the better behavior for a state machine — but it breaks programs carried over unchanged: after migration, a failed read looks identical to a good one unless the logic also tests Error.
The failures that end a transaction are the ordinary serial ones: no response inside the configured timeout, a frame corrupted on the wire, a request addressed to an instrument that is not there. None of them stops the block from finishing. That is the whole trap — the handshake reports the transaction, and only the error word reports the outcome.
Two more interface changes matter when you swap blocks. Error is typed Word everywhere in the port; the original SI8 and TRM138 blocks used DWord, so wrappers, diagnostic tags and screen mappings declared against the old interfaces need checking — a retained double-word tag is not a reason to reshape the port. And the port drops OwenPool and the PKP device functions, shipping device FBs for the TRM202, TRM138 and SI8 instruments instead.
What the Error word actually carries #
Error equal to zero means the transaction succeeded; any other value is a code with a specific meaning, not a boolean. Vendor error words are built this way across the field: one drive maker's function block manual documents a fault status word in which bit 1 set — the value 16#0002 — indicates a link processing error. You do not need to decode every code to write correct acceptance logic. The gate is binary: zero accepts the value, anything else rejects it and triggers your failure path.
The accept rule in program logic #
Put the rule in the logic once, at the point where the transaction's terminal event is processed:
- Compare
Errorwith zero on the terminal event. - Only on equality: copy the returned value into the process tag and set the validity flag for that instrument.
- On any other value: leave the process tag and the validity flag untouched, and increment a consecutive-failure counter for that instrument.
- Alarm on the counter, not on the first failure. Three consecutive failed polls is a workable raise point for an instrument polled every cycle; set it so the alarm arrives after the operator would expect a fresh value, not before.
- Establish whether
Completepulses for one scan or holds until the next request, and process each terminal event exactly once — a level-heldCompleteretriggered every scan will corrupt the counter logic.
Working the accept rule on a five-instrument poll with one offline #
The inputs: five instruments on one shared serial channel, polled cyclically from the PLC — the device FBs the port ships cover the TRM202, TRM138 and SI8 families the porter tested. Instrument four is powered down for the test. The documented behavior of the port supplies the rule: every finished transaction sets Complete, a failed one ends with a nonzero Error, so a reading is accepted only when Complete is set and Error equals zero.
The arithmetic, per polling cycle: 5 transactions start and all 5 finish, so Complete sets 5 times. The offline instrument's transaction times out, so 1 of the 5 ends with a nonzero Error and is rejected: 5 − 1 = 4 readings accepted per cycle. Over 10 cycles the totals are 5 × 10 = 50 transactions, 50 Complete indications, 1 × 10 = 10 rejected and 4 × 10 = 40 accepted.
The result: logic that accepts on Complete alone would have stored 50 readings, of which 10 are invalid — 10 ÷ 50 = 0.20, so 20 percent of everything it stores is stale. The decision follows from the threshold: Error nonzero rejects, Error zero accepts, and that one compare per transaction is the entire cost of keeping all 40 good values honest.
Give one request the port until it ends #
Polling is only safe on a shared channel if one transaction at a time owns it, from request start until its terminal event is processed. On an RS-485 trunk, coexisting protocols work only when every protocol on the wire is poll/response — Modbus RTU and Rockwell DF1 are the standard examples; anything that transmits unsolicited will collide. The port gives you no scheduler: OwenPool is gone and the device FBs arbitrate nothing themselves, so if two request sources can fire while a transaction is active, their state mixes in the instance data and responses land on the wrong request. Build the ownership explicitly — the pattern in How to poll many Modbus RTU slaves from one serial master and the queued structure in Polling many Modbus RTU slaves with one queued function block both enforce it.
When polling runs slower than expected #
A reported case with this port: polling through an ET200 with a 1SI serial module ran very slowly, while the same polling ran quickly on an S7-1200 — with the suspicion that the volume of other program code, not the module, was the cause. Before you attribute latency to hardware, split the transaction into wait time and communication time. Wait time covers scheduler delays and, critically, scans in which the FB never ran: a stateful communication FB must execute every scan while a request is active, because calling it only at request start freezes its internal state machine. Communication time covers transmission, the instrument's response, reception and retries. Trend request start, Complete, Error and scan time together, and the slow stage identifies itself.
Commissioning checks before you trust the channel #
Run the channel through this sequence before any application logic accepts its values:
- Match the physical interface, baud rate, parity, stop bits and instrument address at both ends of the line; read them from the instrument and module configurations, never from an unrelated project.
- Enable one read to one instrument with every other request source disabled.
Completemust set andErrormust read zero. - Force the failure on purpose: power the instrument down or address a vacant station.
Completemust still set, with a nonzeroError, and the process value must stay untouched. - Read a parameter whose value is visible on the instrument's own display, and confirm the decoded sign, magnitude and units agree.
- Check each parameter's documented encoding and access rights against the format argument you pass, before selecting a read or write function.
- Only then enable arbitration and add instruments one at a time.
Questions asked
Which read and write functions were tested in this port?
The porter lists OWEN_GET_DINT with the UINT_FRM and SINT4_FRM formats, OWEN_SET_DINT with UINT_FRM, OWEN_GET_REAL with FIX_BIN, FLOAT32T and FLOAT24, and OWEN_SET_REAL with FIX_BIN and FLOAT24, exercised on TRM202, TRM138 and SI8 instruments. That is one engineer's test result on three instrument families, not a vendor guarantee. Still match each parameter's documented encoding before you pick a format, because a plausible number can decode wrong.
Does a timeout set Complete as well?
Yes. Every finished acquisition attempt sets Complete, whatever the outcome: no response inside the timeout, a corrupted frame and a wrong address all end the transaction with a nonzero Error word. Complete tells you the block's state machine reached its terminal state; only the Error word tells you whether the returned value is usable.
What engineering environments does the port target?
The published projects were built in TIA Portal V13 SP1 Update 9 and STEP 7 5.6, with separate projects for the S7-1200 and S7-1500 families and for S7-300 and S7-400. Treat those as the stated baselines: compile after opening or migrating a project, and inspect each device function block's interface before connecting your own tags to it.
What replaced OwenPool, and what is missing?
The port omits OwenPool and the PKP device functions. In their place it ships device function blocks for the TRM202, TRM138 and SI8 instruments. No scheduler comes with those blocks, so request arbitration on a shared serial channel is application logic you write yourself. The Error parameter is typed Word throughout, where the original SI8 and TRM138 blocks used DWord.