Status Flags - Allen-Bradley Logix5000 Reference Manual

1756 controllogix, 1768 compactlogix, 1769 compactlogix, 1789 softlogix, 1794 flexlogix, powerflex 700s with drivelogix
Hide thumbs Also See for Logix5000:
Table of Contents

Advertisement

Appendix A
Common Attributes

Status Flags

644
To access controller configuration and status in your logic, use the Get System
Value (GSV) and Set System Value (SSV) instructions. There is also a set of status
flags that you can access directly with relay and structured text instructions. These
flags are not tags and you cannot create aliases for them.
Status Flag
S:FS
S:N
S:Z
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Description
First scan flag
The first scan flag is set by the controller on the
first scan of routines in a program. This flag can
be used with only the XIC and XIO relay
instructions or in structured text like a Boolean
variable. You can use this flag to initialize data
for use in later scans.
Sometimes called the 'first pass' bit.
Negative flag
The controller sets the negative flag when the
result of an arithmetic or logical operation is a
negative value. This flag can be used only with
XIC, XIO, OTE, OTL and OTU relay instructions or
in structured text like a Boolean variable. You
can use this flag as a quick test for a negative
value. Using S:N is more efficient than using the
CMP instruction.
This math status flag is cleared at the start of
executing an instruction capable of setting this
flag.
Sometimes called the 'sign' bit.
If a computation results in a NAN value, the sign
bit is irrelevant and could be positive or
negative. In this situation, the software displays
1#.NAN with no sign.
An integer divide returns the numerator when
the denominator is 0, but does not set this flag.
Zero flag
The zero flag is set by the controller when the
result of an arithmetic or logical operation is
zero. This flag can be used with only the XIC,
XIO, OTE, OTL and OTU relay instructions or in
structured text like a Boolean variable. You can
use this flag as a quick test for a zero value.
Using S:Z is more efficient than using the CMP
instruction.
The math status flag is cleared at the start of
executing an instruction capable of setting this
flag.
An integer divide returns the numerator when
the denominator is 0, but does not set this flag.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents