Description of System Bits %S15 to %S21
Original instructions
Detailed Description
NOTE: These system bits have a specific value for each task (Mast, Fast, Aux0, ...).
Description of system bits %S15 to %S21:
Bit
Symbol
%S15
STRINGERROR
Function
Character string fault
Initial State
0
Platforms
M340: Yes M580: Yes M580 Safety: Yes Quantum: Yes Momentum: Yes Premium: Yes Atrium: Yes
Normally set to 0, this bit is set to 1 when the destination zone for a character string transfer is not of sufficient size (including the number of characters and the end of string character) to receive this character string.
The application stops in error state if the %S78 bit has been to set to 1.
This bit must be reset to 0 by the application.
%S16
IOERRTSK
Function
Task input/output fault
Initial State
1
Platforms
M340: Yes M580: Yes M580 Safety: Yes Quantum: Yes Momentum: Yes Premium: Yes Atrium: Yes
Normally set to 1, this bit is set to 0 by the system when a fault on an in-rack module or device on Fipio is detected (e.g. non-compliant configuration, exchange fault, hardware fault, etc.).
This bit must be reset to 1 by the user.
NOTE: Detected network communication errors with remote devices are not reported on bit %S16.
NOTE: On M580 Safety, not all of the possible detected errors relating to safety I/O modules are reported on bit %S16.
CAUTION
UNEXPECTED APPLICATION BEHAVIOR - SPECIFIC VARIABLE BEHAVIOR
Manage detected network communication errors with remote devices with a method specific to each type of communication modules (NOM, NOE, NWM, CRA, CRP) or motion modules (MMS):
  • communication function blocks status (if they are used)
  • communication modules status (if they exist)
Failure to follow these instructions can result in injury or equipment damage.
Bit
Symbol
%S17
CARRY
Function
Rotate shift output
Initial State
0
Platforms
M340: Yes M580: Yes M580 Safety: Yes Quantum: Yes Momentum: Yes Premium: Yes Atrium: Yes
Normally at 0.
During a rotate shift operation, this bit takes the state of the outgoing bit.
NOTE: On M580 Safety, this bit related to the execution SAFE task, is accessible in process program code via the safety system function blocks S_SYST_READ_TASK_BIT_MX and S_SYST_RESET_TASK_BIT_MX.
%S18
OVERFLOW
Function
Overflow or arithmetic error
Initial State
0
Platforms
M340: Yes M580: Yes M580 Safety: Yes Quantum: Yes Momentum: Yes Premium: Yes Atrium: Yes
Normally set to 0, this bit is set to 1 in the event of a capacity overflow if there is:
  • a result greater than + 32 767 or less than - 32 768, in integer (INT),
  • result greater than + 65 535 or less than 0, in unsigned integer (UINT),
  • a result greater than + 2 147 483 647 or less than - 2 147 483 648, in double integer (DINT),
  • result greater than +4 294 967 295 or less than 0, in double unsigned integer (UDINT),
  • real values outside limits,
  • division by 0,
  • the square root of a negative number,
  • Forcing to a non-existnet step on a drum,
  • Stacking up of an already full register, emptying of an already empty register.
There is only one case for which bit %S18 is not raised by the Modicon M340, Modicon M580, and Momentum PLCs when real values are outside limits. It is only if denormalized operands or some operations which generate denormalized results are used (gradual underflow).
It must be tested by the user program after each operation where there is a risk of overflow, then reset to 0 by the user if there is indeed an overflow.
When the %S18 bit switches to 1, the application stops in error state if the %S78 bit has been to set to 1.
%S19
OVERRUN
Function
Task period overrun (periodical scanning)
Initial State
0
Platforms
M340: Yes M580: Yes M580 Safety: Yes Quantum: Yes Momentum: Yes Premium: Yes Atrium: Yes
Normally set to 0, this bit is set to 1 by the system in the event of a time period overrun (i.e. task execution time is greater than the period defined by the user in the configuration or programmed into the %SW word associated with the task). The user must reset this bit to 0. Each task manages its own %S19 bit.
NOTE: On M580 Safety, information for SAFE task overrun is not available.
%S20
INDEXOVF
Function
Index overflow
Initial State
0
Platforms
M340: Yes M580: Yes M580 Safety: Yes Quantum: Yes Momentum: Yes Premium: Yes Atrium: Yes
Normally set to 0, this bit is set to 1 when the address of the indexed object becomes less than 0 or exceeds the number of objects declared in the configuration.
In this case, it is as if the index were equal to 0.
It must be tested by the user program after each operation where there is a risk of overflow, then reset to 0 if there is indeed an overflow.
When the %S20 bit switches to 1, the application stops in error state if the %S78 bit has been to set to 1.
%S21
1RSTTASKRUN
Function
First task cycle
Initial State
0
Platforms
M340: Yes M580: Yes M580 Safety: Yes Quantum: Yes Momentum: Yes Premium: Yes Atrium: Yes
Tested in a task (Mast, Fast, Aux0, Aux1, Aux2 Aux3), the bit %S21 indicates the first cycle of this task, including after a cold start with automatic start in run and a warm start. %S21 is set to 1 at the start of the cycle and reset to zero at the end of the cycle.
NOTE: The bit %S21 does not have the same meaning in Control Expert as in PL7.
NOTE: In a M580 redundant system, at power-up, the very first task is executed while the CPU is in WAIT. It is only during the second cycle that the CPU might be PRIMARY. Therefore, the %S21 which is reflecting the first task, will always reflect the task executed while the CPU is in WAIT. According to the setting, not all the sections of this task will be executed (by default, only first section is executed while in WAIT) compared to when the CPU will be PRIMARY.
Therefore the management of the first cycle when CPU is PRIMARY has to be done manually with application code.
Example:
(* begining of program - first section *)
IF %S21 THEN FIRST_CYCLE_PRIMARY_DONE:=0; END_IF;
...
(* end of program - last section *)
IF ECPU_HSBY_1.LOCAL_HSBY_STS.RUN_PRIMARY THEN FIRST_CYCLE_PRIMARY_DONE:=1; END_IF;
NOTE: On M580 Safety, tested in the SAFE task, this bit indicates the first cycle of this task. It is set to 1 at the start of the cycle and reset to 0 at the end of the cycle. the first cycle of the task status can be read using the SCOLD output of the S_SYST_STAT_MX system function block.