Internal Reset Mechanism of Boolean Input Parameters in SIMATIC PCS 7 APL Blocks
In SIMATIC PCS 7 Advanced Process Library (APL), boolean input parameters—such as operator commands (RstOp, StartOp, StopOp)—can be reset to FALSE internally by the block itself because STEP 7 Function Blocks (FBs) store VAR_INPUT parameters in read/write Instance Data Blocks (DBs). While classic IEC 61131-3 theory treats inputs as read-only, S7-400 architecture permits internal SCL code to write to its own input addresses. APL utilizes this mechanism for WinCC operator commands: when an operator clicks 'Reset' on a faceplate, WinCC writes TRUE (1) to RstOp; during the next cyclic execution OB, the block executes the reset algorithm and immediately clears RstOp to FALSE (0), eliminating the need for WinCC to execute a separate reset handshake.
Table of Contents
- STEP 7 Memory Model and SCL Input Variable Mutability
- APL Interface Design: Operator Inputs (Op) vs Interconnected Signals (Li)
- How Internal Input Resets Prevent 'Sticky' WinCC Operator Commands
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
STEP 7 Memory Model and SCL Input Variable Mutability
Engineers transitioning from other PLC platforms (such as Rockwell ControlLogix or IEC 61131-3 pure functional environments) frequently assume that a Function Block input (VAR_INPUT) is strictly immutable from within the block's internal algorithm, and that bidirectional modification demands an in-out parameter (VAR_IN_OUT).
In SIMATIC STEP 7 and PCS 7, however, the execution memory model operates differently:
Because an unconnected VAR_INPUT occupies standard read/write RAM within the block's Instance DB, SCL code can execute RstOp := FALSE; at the end of its execution block, modifying the input value directly.
APL Interface Design: Operator Inputs (Op) vs Interconnected Signals (Li)
The Advanced Process Library categorizes block interfaces into distinct operational groups based on data structures and caller authority:
- Operator Control Inputs (
*Op): Standard elemental data types (BOOL,REAL). Examples includeRstOp,ManOp,AutoOp,SP_IntOp. These inputs are exposed to WinCC OS faceplates. Because they are designed for momentary operator clicks, the APL block automatically resets boolean operator commands to0once processed. - Linked / Interconnected Inputs (
*Li/*Aut): Structured data types (STRUCT) containing two elements:
1.Value: The process data (BOOLorREAL).
2.ST: The NAMUR NE 107 Signal Status (BYTE), indicating Good (16#80), Bad (16#00), or Simulated (16#60).
These signals originate from other CFC blocks and are overwritten continuously on every OB execution cycle; therefore, internal resets are not applied to linked inputs.
How Internal Input Resets Prevent 'Sticky' WinCC Operator Commands
In distributed supervisory control systems, network latency across the Terminal Bus presents operational hazards. In legacy systems without internal resets, triggering a motor start required a dual-telegram handshake:
- WinCC script writes
Start = 1on mouse down. - WinCC script writes
Start = 0on mouse up.
If the operator released the mouse while network communication glitched, or if the client crashed mid-click, the start command remained permanently stuck at 1 ('sticky bit'), preventing future stops or causing unexpected restarts.
APL's internal reset architecture completely eliminates sticky bits:
[Operator Clicks Reset on Faceplate]
│
▼
WinCC writes RstOp = TRUE (Single Telegram)
│
▼
[AS Cyclic OB Execution (e.g. OB35 100ms)]
1. Block evaluates: IF RstOp THEN ClearFaults(); END_IF;
2. Block executes: RstOp := FALSE;
│
▼
[RstOp returns to FALSE in 1 cycle with 100% deterministic reliability]
Verification
Verify internal input reset behavior through these CFC diagnostic steps:
- CFC Test Mode Monitoring: Open a CFC chart containing
MotL. Switch to Test Mode (Debug -> Test Mode). AddRstOpto the watch list. - Simulate Operator Click: Double-click
RstOpin the CFC watch table. Change the value from0to1. - Observe Automatic Pulse Reset: Notice that
RstOpinstantaneously flips to1and returns to0on the very next watch update cycle, proving the AS block cleared the input in RAM.
Limitations and Operational Precautions
When interfacing logic with APL operator inputs, observe these programming rules:
- Never Interconnect Logic to
*OpInputs: Do not connect CFC chart lines or SFC step actions directly to*Opinputs (e.g.,RstOp). Interconnecting a continuous signal toRstOpcauses a continuous write collision where the predecessor writes1and the APL block writes0, causing cyclic CPU overhead and logic flapping. Always connect automated logic to*Liinputs (RstLi). - Feature Bit Control: Some operator commands depend on
Featurebit parameterization (e.g.,Feature.Bit30resetting depending on operating mode). - Structured Variable Integrity: Never attempt to modify the
ST(Signal Status) byte of an interconnected struct manually inside user logic; utilize official APL utility blocks (StruDiIn,StruDiOu) to maintain diagnostic standards.
Engineer FAQ
Can I write SCL code that resets inputs in my own custom function blocks?
Yes. In STEP 7 / SCL for S7-400, you can assign values to VAR_INPUT variables within the FB algorithm. The SCL compiler permits this because the variable resides in the writable Instance DB.
Why does TIA Portal S7-1500 behave differently regarding VAR_INPUT writing?
TIA Portal S7-1500 strictly enforces IEC 61131-3 compiler rules by default, flagging writes to VAR_INPUT as errors or warnings unless optimized block access and specific compiler compatibility settings are configured.
What is the difference between RstOp and RstLi?
RstOp is an elemental BOOL driven by WinCC operator faceplates with internal reset. RstLi is a structured input (Value + ST) driven by automated interlocking logic or SFC sequences.
Technical References
- SIMATIC Process Control System PCS 7 Advanced Process Library (APL) Manual (A5E39140304)
- SIMATIC S7-SCL for S7-300/400 Programming Manual (A5E00850742)
- IEC 61131-3: Programmable Controllers - Part 3: Programming Languages
Related Articles
- Preserving Motor Command States and Operating Modes After Fault Reset in APL Block MotSpdCl.md
- Enabling Operator Input Request Messages (Bedienanforderung) on APL Block MonDiL in SIMATIC PCS 7.md
- Interpreting APL ErrorNum = -1 in SIMATIC PCS 7 - Default Unexecuted State and Interrupt OB Assignment.md
Related Tags
- APL
- RstOp
- VAR_INPUT
- Instance DB
- SCL
- Operator Commands