Skip to main content

Run Structured Text Program

Instruction Parameters

Supported PLC Series

CM1

XP SeriesUP SeriesCP Series
--

CM3

PlusMini ModularMicro-SPro
--

Supported Data Registers

MXYKLFTCSZRQD@DConstant
S1-
S2-
D----

Supported Flags

FlagBitSupport
ErrorF11.0-
ZeroF11.1-
CarryF11.2-

Number of Steps

Steps
3

Operands

OperandDescription
S1The first operand.
Entries are WORD data registers or constants.
This is the Structured Text program ID.

The value range is 0 ~ 127.

If the value is set to 0xFF, all Structured Text programs are targeted.
S2The second operand.
Entries are BOOL data registers or constants.

0: Disables Structured Text program.
1: Enables Structured Text program.
DThe third operand.
Entries are only WORD data registers.
This is the result of the instruction execution.
The result is in Hexadecimal form.

Result Format

ValueDescription
0x01Result value during normal operation.
0xF0Result value when setting a running program to run or a stopped program to stop.
0xF1Result value when a non-Structured Text program is used for the first operand.
Sets an error value as the instruction execution result, but no CPU error occurs.
0xF2Result value when the operand value of S2 is neither 0 or 1.
Instruction Behavior

The STCALL instruction behaves as follows:

  • It is required that the STCALL instruction be used with a pulse contact as an execution condition.
  • A single execution is sent to manually run Structured Text programs.
    • Manual execution programs execute once they receive the command, and then they return to a waiting state.
  • The manual program executes once immediately after the execution of the STCALL instruction.
    • The timing of a manually executed Structure Text program may be different from the timing of an automatically executed Structured Text program.
Program Execution Behavior

Program execution behaves as follows:

  1. Input (Refresh)
  2. Scan Program Execution
  3. Structured Text Program Execution
  4. Self-Diagnosis
  5. Output (Refresh)
  6. Structured Text Manual Execution
  7. Repeat

Examples