Troubleshooting
Why PLC Coder generation fails with unconnected ports as warnings
Short answer
The run stopped because the subsystem selected for generation had unconnected input and output ports; your diagnostics reported that only as warnings, so no settings change was needed to find it. Keep the severity settings as they are, connect or deliberately terminate every external port, and generate again for the SIMATIC STEP 7 target. A warning says model processing continued past the check, not that the boundary is eligible for generation.

On this page
- Severity and eligibility are separate checks
- What each message is telling you
- Working the reported case: one open input and one open output on the selected subsystem
- Inspect before you change anything
- Repair the interface
- Severity is a checking policy, not a repair
- The decision for each case
- Questions asked
Your diagnostics settings did not cause this failure, and changing them will not fix it. Generation stopped because the subsystem you selected has unconnected input and output ports, and your severity configuration reports that condition as a warning, so the diagnostics window showed warnings while the run still failed. Keep the settings as they are, open the selected subsystem's boundary in the parent model, and connect or deliberately terminate every external port. A warning means model processing was allowed to continue past that check; it is not a statement that the boundary is eligible for code generation. Repair the interface, then generate again for the same subsystem and the SIMATIC STEP 7 target.
Severity and eligibility are separate checks #
A diagnostic severity is the configured response to a detected model condition: report a warning and continue, or stop with an error. Generation eligibility asks a different question: whether the selected model element satisfies the generator's requirements, which include a fully connected external interface on the subsystem being translated. Passing the first check says nothing about the second.
The headline message, the one about errors while simulating the model, names the failed operation rather than the defect. The detailed messages under it name the model elements to inspect. Read those before touching any severity setting; in this failure the actionable content was the unconnected external ports of the selected subsystem, not the wording of the headline.
What each message is telling you #
| Message in the diagnostics | What it means | What you do |
|---|---|---|
| Generation stops with a general message about errors simulating the model | A model-processing step that generation depends on did not complete acceptably | Open the detailed messages first; change no severity setting yet |
| Unconnected-port messages appear as warnings | The configured severity lets processing continue at that check | Inspect the selected subsystem's external connections |
| Input or output ports of the selected subsystem are open | The generation boundary is incompletely connected in the parent model | Connect or deliberately terminate each port, then retry |
| Generation still fails after every port is resolved | A different condition remains | Diagnose the new detailed message on its own terms |
The shape is the same one behind PLC Coder update diagram not possible with a clean model: a broad headline on top, one specific model condition underneath. The headline tells you which operation failed; the detail tells you where to put the screwdriver.
Working the reported case: one open input and one open output on the selected subsystem #
Inputs #
- Generation target: SIMATIC STEP 7, from the configuration of the failed run.
- Element being generated: the subsystem selected for that attempt.
- Diagnostic severity for unconnected ports: warning, from the diagnostics settings, which is why the window showed warnings only.
- Open ports named by the diagnostics: input ports and output ports of that subsystem. The smallest set that matches the report is one open input port and one open output port, so that is the count worked here.
The rule #
Every external port of the selected subsystem must be connected or deliberately terminated before the generator will translate it. Each unresolved port is one blocking condition, and generation proceeds only when the number of blocking conditions is zero. Severity is not a term in that count: raising the unconnected-ports diagnostic to error changes when the message stops you, not whether the port is open.
The arithmetic #
- Blocking conditions on the failed run: 1 open input port + 1 open output port = 2 blocking conditions.
- Required for generation: 0 blocking conditions.
- Raise the severity to error instead of repairing: 1 + 1 = 2 blocking conditions, unchanged, and the run still cannot generate.
- Connect the input to its intended source: 2 − 1 = 1 blocking condition.
- Connect the output to its consumer, or terminate it deliberately as unused: 1 − 1 = 0 blocking conditions.
Result and decision #
With 0 blocking conditions the boundary satisfies the generator's connection requirement. Update the model, confirm the connectivity warnings for those two ports are gone, and generate again for the same subsystem and target. The threshold is zero unresolved ports; any count above zero stops generation whatever the diagnostics settings say, which is why this is an interface repair and not a settings repair.
Inspect before you change anything #
- Confirm which subsystem the failed attempt selected; the boundary you inspect must be that one, not a neighboring block or the whole model.
- Open the detailed diagnostic messages and locate each referenced block or connection.
- Trace every external input port: its connection at the subsystem block in the parent model, and its use inside the subsystem.
- Trace every external output port from its internal source outward, and find which downstream logic consumes the result.
- Leave the target at SIMATIC STEP 7; the target is not the fault here, and switching targets is not a repair.
Repair the interface #
- Write down the intended interface: the inputs the algorithm actually needs and the outputs the enclosing control logic actually consumes.
- Connect each required input to its intended source. If an input is fixed by design, model the fixed value explicitly and check its data type and dimensions against the port.
- Resolve each output deliberately: connect it to its consumer, terminate it explicitly as intentionally unused, or remove it from the interface after checking the effect on the design.
- Update the model and rerun the simulation checks; the connectivity warnings for the repaired ports should disappear.
- Generate again for the same subsystem and target, keeping the boundary unchanged unless resizing it was part of the repair.
Connecting an arbitrary signal just to clear a warning can change the algorithm's behavior while the original interface defect stays hidden. An open input asks a design question, what value this port should receive; an open output asks another, whether anything downstream needs the result. Answer both from the control design, not from the diagnostics window.
Severity is a checking policy, not a repair #
No diagnostics configuration had to change to find and fix this failure, and that is the direct answer to the question of which settings suit code generation. If you want a policy, make it timed: keep the unconnected-ports check at warning while the layout is still fluid, then raise it to error for the finishing phase of a project, when no half-built interfaces should remain, so model update refuses an incomplete boundary at the earliest moment. The same setting can halt work on intentionally unused connections elsewhere, so set it per project, on purpose, and never read a severity change as evidence that the model has become fit for generation.
The decision for each case #
- Boundary repaired and connectivity warnings gone: generate for the same subsystem and target. Then confirm the generated code loads in the SIMATIC STEP 7 Target IDE, that the repaired signals keep their intended data types and dimensions, and that representative input cases still produce the intended outputs. If the code compiles but an output never moves, that is a separate fault with its own causes, covered by why PLC Coder reusable code leaves an output unchanged.
- Diagnostics point at a new element after the repair: a different condition remains; work it from its own detailed messages rather than revisiting severity.
- A port you cannot justify from the control design: remove it from the interface instead of inventing a signal for it. The interface should match the design, not the diagnostics window.
Questions asked
Why did the failure message talk about simulating the model at all?
Generation begins by processing the model much as a simulation does, resolving signal properties and execution relationships before any translation happens. When that processing meets the open boundary, the tool reports the problem under the operation that was running, so the headline names simulating the model. The wording is honest about the stage and silent about the defect; the detailed messages underneath carry the part you can act on.
Does an input port the algorithm never reads still block generation?
Yes. The connection requirement applies to every port on the selected subsystem's boundary, whether or not the algorithm reads the signal inside, because the generator translates the interface as declared. Decide from the control design: connect the port to the signal it was meant to receive, or delete it from the interface. A stand-in source only keeps the diagnostics quiet while preserving an interface that no longer matches the design.
Generation still fails after every port is connected. What now?
Treat it as a new fault. Confirm the subsystem selection and target are still the intended ones, then read the new detailed messages and work the condition they name instead of cycling severity settings. If the failure persists, record the software release and the complete diagnostic text and raise it through the software manufacturer's official support channel; a support engineer can act on the exact release and message text, not on a description of warnings.


