Rslogix 5000: Sequential Function Chart (SFC) & Structured Text (ST) Languages
Rslogix 5000: Sequential Function Chart (SFC) & Structured Text (ST) Languages
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 2
2
Applications for Sequential Function Chart
• Sequencing of a machine’s states
– High level program / routine execution management
– More flexible approach to developing sequencers
– Highly visual language is easy to understand
– Ideal for machines with repetitive operations
• Execution of batch process applications
• Provide a foundation for motion or robotic applications using the
Graphical Motion Language (GML)
– Embedded Structured Text Motion commands provide streamlined
development environment
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 3
2
RSLogix 5000 SFC Editor
SFC
SFC Show/Hide Runtime
Grid and Autoscroll
Page Lines SFC
Element
SFC Toolbar
Editor / Routine
Overview Specific names
with backing
Quick Access structure tag
SFC Property Dialogs
Routine Automatic
Name
Generation
SFC
Language
Editor Embedded
Monitor Tag
Structured Text
of on-line
Transitional
operation
Step Embedded
Description Structured
Text Action
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 4
2
SFC Graphical Drawing Environment
• Unlimited drawing space provides free form editing style
– Personalized place SFC elements permits chart organization to more closely follow
application or physical machine
– Streamlines development and simplifies maintenance
• Scale window to increase/decrease view size
– Simplifies navigation and permits ability to monitor chart execution more readily
• Spreadsheet style grid structure
improves navigation (A1, B2, C3..)
– Used by cross-reference to
provide quick navigation
– Dashed lines show SFC element Dashed
placement within grid (can be Cross-reference
hidden if desired) Grid
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 5
2
Routine Overview Navigation
• Routine overview button in editor provides “birds-eye-view” of
full SFC routine
– All SFC elements scaled to fit a reduced size window above editor
– Provides indication of viewable area and permits movement
– Lets you know your the area of the chart you are viewing and simplifies
navigation within large routines
Box to indicate
area in view
Move cursor to
Different part
of chart to
change view
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 6
2
SFC Element Entry
• Multiple methods available for SFC element entry
– Pick the approach that best meets your needs
• Context sensitive element toolbar provides two methods
of programming
– Click to insert – drops
element at current
chart position
– Drag & Drop - to manually
position element in chart
• Element browser provides
keyboard navigation
– Just press [Insert] key
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 7
2
SFC Language Elements
• SBR/RET – Passes input / output
Action
parameters to/from a chart
• Initial Step – The start position for the chart SBR/RET Initial
execution Parameters Step
• Step – Position within a chart that defines
an operating state
• Action – Portion of a step that defines a
specific behavior Simultaneous Transitional
• Transitional – Decision point to determine Branch
when a steps operation is completed
Select
• Stop – Termination position for a path Branch
within a chart
• Simultaneous Branch – defines dual
execution paths in a chart that are both
executed at the same time
• Select Branch – defines dual execution
paths in a chart where only one path is Stop
executed Element
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 8
2
Intelligent SFC Connection Routing
• Multiple ways to make SFC element connections
– Manually wire the elements together (connect the dots)
– Auto-connect by placing a new element adjacent to an existing element
– Select the best method for your style of programming
• Select and Simultaneous branches are determined automatically by
the environment based on where the connections are made
– Saves you time when developing the chart
– You can add them manually
if you prefer
• Auto routing of element connections
– All wires run vertically and
horizontally with right angles
– visual display of valid
connection points
– Sticky wires stay connected
when elements are moved
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 9
2
SFC Element Property / Data Tags
• Each of the SFC Element utilize a tag
containing operational information for the
block
– Used to assign a name to each element (40
Character)
– Pre-defined SFC data-types provide specific
names for element data
• Steps – SFC_STEP structure
• Actions – SFC_ACTION Structure
• Transitional – BOOL
• Stop – SFC_STOP structure
– Contain operational, status and diagnostic
values
• Operational – Execution Timer, Executing
State, First Scan, Last Scan…
• Status / Diagnostics –Execution Count, Over-
run / Under-run alarms...
– Simplifies access to element information,
reduces training and maintenance effort
• Built-in property displays simplify
configuration and display operating status
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 10
2
Automatic SFC Tag Management
• The software optionally does an automatic name generation for steps,
transitions and actions
– User-specified prefix for step, transition, action, and stop names
– Option to include SFC routine name in prefix
– Automatic numbering of elements
– Reduces typing to improve development time
• If you want more control software can “Prompt for Tag Name” when element is
added to SFC chart
– Avoids extra step to
create and name tags
– Provides more effective
development workflow
• Option to automatically
delete tag when element is
removed from chart
– Eliminates program
modification steps
– Avoids orphaned tags
being left in program
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 11
2
Step Elements
• Unlimited number of steps in an SFC routine
• Step uses a tag as a control structure
– 40 Character name for each step, automatically generated
– Structure contains step configuration and status attributes
– Step attributes are accessible from logic
• Choice of accessibility / isolation
• Created at program scope by default
• Ex: StartupLine1.PRE
– Tag description provides in-line documentation
• Can be modified in SFC Editor,
tag editor and CSV Import/Export
• Display of description can be Backing Tag
Step Connection
optionally disabled Comment
Name Points
• Configurable step timer monitors
step execution
– Step timer preset can be a fixed value
View/Hide
– or an expression evaluated at run time
Actions
• Tag or complex calculation View Step Edit
Attributes State
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 12
2
Step Attributes and Built in Diagnostics
• Structured step tag provide specific names for step configuration and properties
– Includes all IEC61131-3 defined attributes and Logix5000 extensions
– Directly accessible via an MMI using names stored in the controller
• Built in step diagnostics capabilities eliminates application code commonly added
to most SFC programs
– Step execution time alarms - User configurable presets or expressions for step
underrun (AlarmLow) and overrun (AlarmHigh)
– Execution count tracks number of times Step is activated - provides immediate
feedback on process execution
Initial Step State
Datatype SFC_STEP Step Bits
Status : DINT; Status Field containing X,FS,SA...AlarmHi
X : BOOL; Step executing bit (FS + SA + LS)
FS : BOOL; First scan bit
SA : BOOL; Step Active bit (Not FS or LS) Step
LS : BOOL; Last scan bit Timer
DN : BOOL; Step Timer done, T=PRE
OV : BOOL; Step timer overflow DINT Maximum
AlarmEn: BOOL; Enables Hi/Low Alarming Execution
AlarmLow : BOOL; Low Step Time Alarm Fault Count
AlarmHi : BOOL; High Step Time Alarm Fault
PRE : DINT; Step timer preset, sets DN when T=PRE
T : DINT; Length of time step has executed Alarms
TMax : DINT; Maximum Step Time value detected
Count : DINT; Number of times step activated
LimitLow : DINT; Low Alarm Step Time Display
LimitHi : DINT; High Alarm Step Time Options In-line
End_Datatype; Expressions
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 13
2
Initial Step Property
• This step property allows you to specify the location in the chart you
want to being the execution after a restart
– Visualized with double border to help locate within chart
– Operates based on restart configuration
– One initial step per chart or routine
– Can be anywhere in the chart
– Same configuration as a normal step
• Provides flexibility when setting a
Initial
chart so that you can organize the Step
routine around the application
– Does not force the execution
to begin at the top
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 14
2
Step Actions
• Indicator
Unlimited number of actions per step View Action
Attributes Tag
• Three types of actions:
– Boolean actions are true when the action Action Action
is active otherwise false Qualifier Name
• Action can be reused by multiple steps
– using action tag reference
– State of action is logical OR of all references
– Reference routines in other languages
• LD, FBD, ST, SFC
– Embedded Structured Text
• Eliminates need to create separate Show/Hide
routines and improves readability Actions
• Requires ST Language option
• Action uses a tag as a control structure Edit Multiple Embedded
– Provides a 40 character name for each action, State Actions Structured
automatically generated per Step Text Code
– Structure contains action configuration and status attributes
– Action attributes are accessible from logic
• Choice of accessibility / isolation
• Created at program scope by default
• Ex: Action_001.PRE
• Indicator tag provides diagnostic monitoring while running
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 15
2
Action Attributes and Built in Diagnostics
• Structured Action tag provide specific names for action configuration and properties
– Includes IEC61131-3 defined attributes and Logix5000 extensions
– Directly accessible via an MMI using names stored in the controller
• Built in Action execution count tracks number of times action is activated - provides
immediate feedback on process execution
– eliminates application code commonly added to most SFC programs
• Provides option to include an indicator tag displayed on the action
– Select any tag available in the local program or controller scope areas
– Provide run-time data-value updates to assist in debug an maintenance
• Configurable Execution Order
– Permits easy access to Action execution order
– Simplifies addition of new actions or reworking
scan after development is completed
Datatype SFC_ACTION
Status : DINT; Status field containing A and Q
A : BOOL; Action is executing
Q : BOOL; Active except for last scan, P0 or P1
T : DINT; Time accumulated based on action qualifier
PRE : DINT; Time qualifier preset
Count : DINT; Number of times action activated
End_Datatype;
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 16
2
Action Qualifiers
• Action qualifiers determine how an action should execute
– Following IEC 1131-3 definitions
– None (no qualifier defaults to Non-Stored)
– N - Non-Stored (action is active when step is active)
– S - Stored (Starts running when step active, continues running even after step goes inactive)
– R - Overriding Reset (stops a stored action)
– L - Time Limited (starts running when step active, stops when step goes inactive or time
expires)
– D - Time Delayed (waits a period of time after step active and executes if step is still active)
– P1- Rising Edge Pulse (runs once on step activation)
– P0 - Falling Edge Pulse (runs once on step deactivation)
– P - Pulse (runs once on step activation and again on deactivation P1+P0)
– SL - Stored and Time limited (starts running when step active, stops when time expires)
– SD - Stored and Time Delayed (waits a period of time after step active runs regardless of step
state and continues running even after step goes inactive)
– DS - Delayed and Stored (waits a period of time after step active, if step is still active, it runs
continuously even after step goes inactive)
• Time based action qualifiers
– Qualifier preset can be a fixed value
– An expression evaluated at run time
• Tag or complex calculation
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 17
2
Action Qualifier Timing
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 18
2
Step / Action Preset Expression Builder
• Built in expression editor simplifies creation of embedded structured text
expressions for step timer preset value
– Quick access to create tags, browser tags, function and operator selection lists
• Permits step timer preset to be determined during step operation
• Provides more control over step execution with minimal effort
• Reduces need for external code to calculate and set the timer preset value
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 19
2
Transition Elements
• Unlimited number of transitions in an SFC routine
• Two types of transitions
– Reference another routine in any ControlLogix language
– Embedded Structured Text
• Eliminates need to create separate routines View Transition
Transition Name
• Can use to set always true / false condition
Attributes
• Transition uses a tag for state data
– Tag value accessible from logic
• Choice of accessibility / isolation
• Created at program scope by default Transition
• Defined as a BOOL datatype Force State
– Provides a 40 character name for each
transition, automatically generated
– Tag description provides in-line documentation Connection Embedded
• Can be modified in SFC Editor, tag editor and Points Condition
CSV Import/Export Logic
• Display of description can be optionally disabled
• Transition forcing overrides program logic
– Similar to I/O forcing
• Force multiple transitions to true / false
• Enable / disable all transition forces at once
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 20
2
Transition Forcing & Step Through Provide Chart Debug Capabilities
Enable both
I/O and SFC Forces
together from toolbar
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 21
2
Stop Element
• The Stop Element terminates execution of a path in the SFC chart
– Located at the end of the chart or on a branch leg
– If there are no other steps to execute, control reverts to the predefined
initial step
– Eliminates need to provide directed link looped back to initial step
• Unlimited number of stop elements
• Utilizes a tag to name the element, provide a comment in the chart
and store diagnostic information
– Activated Bit is set when Stop Element is executed
– Built in step execution count tracks number of times the stop is activated -
provides immediate feedback on process execution
• Extension over IEC61131
Datatype SFC_STOP
Status : DINT; Status field containing X
X : BOOL; Activated
Count : DINT; Number of times Stop activated
End_Datatype
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 22
2
SBR / RET Element
• Subroutine Input / Return element provides a means of passing parameters
in/out of a SFC based subroutine
– SBR – Specifies tag(s) to store input parameters for use in the routine
– RET – Specifies tag(s) you want to return as output parameters
– Unlimited number of parameters
– Both atomic and compound data types supported
– Passed by value
• Permits SFC Routines to be called from other routines within a program
– Call from LD, FBD, STX and even another SFC
– Provides program development flexibility and supports modular programming
methods
... SBR
Subroutine
MCR
RET
Return
Status
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 23
2
Simultaneous Branches
• Executes multiple chart paths at once
– Permits multiple steps to be active at
one time Branch
Force Right Click
– Unlimited number of branch legs, elements to Force
per leg and nested branches
• Flexible branch layout works they
way you want it to work!
– permits configuration to closely
resemble process
Flexible
– Avoids useless steps placeholders Branching
• Brach leg forcing enhances chart
debug and maintenance
– Permits each branch to be disabled
individually
– Displayed in chart both off and on-line
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 24
2
Select Branches
• Executes one of many chart paths Execution
– Permits process based decisions to alter order
the execution flow
– Unlimited number of branch legs,
elements per leg and nested branches
• Flexible branch layout works Forced Right Click
they way you want it to work! Transition to Set Order
– permits configuration to
closely resemble process
– Avoids useless steps placeholders
• Configurable evaluation order
Flexible
Flexible
– Defaults evaluation from Left to right Branching
Branching
– User defined evaluation order permits
you to determine branch priority
– Permits changing order without
reorganizing chart Default
Left to Right
• Transition forcing and step through User
provides select branch debug override Configured
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 25
2
Directed Link
• Directed link permits you to shift the chart execution forward or
backward to another step
• Optional link visualization setting
– Wired to the destination step (default)
– Hidden wire with source / destination references to reduce wire / chart
congestion
– Gives you control over how the link is displayed in the chart
Source
Visible reference
Wire
Destination
reference
Transition Tag
Description Text Box Anchored
to Transition
Embedded ST
Transition Comment
(Stored Online)
Routine Description Tag Comments Text Box Embedded ST
Visibility Routine property Tag editor and data SFC chart Only SFC chart Action and
dialog and routine tool- monitor, optionally Transition expressions
tip show/hide in SFC chart
Modification Routine Property Step/ Transition property SFC chart editor SFC chart’s embedded
Dialog dialog, and Tag Editor ST editor
Size 120 Characters 120 Characters 64K Characters Unlimited
Stored Off-line Off-line Off-line Off-line & On-line
Import / Export L5K File CSV and L5K Files L5K File L5K File
Element N/A Moves with SFC element Free-floating or Moves with embedded
Linkage anchored to element ST code in SFC Element
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 27
2
SFC Reports
• Both Fit to page report and multi-page
formats
– Single page table of contents
– Enlarged view of chart sections
• Report Page boundaries displayed in
editor view
– Configurable page settings
• Supports Letter (8.5x11”), Legal
(8.5x14”), Tabloid (11,17”), A4
(210x297mm), and A3 (297x420mm)
• Portrait or Landscape
– What you see is what you get!
– Simplifies development
• Cross-reference grid and page
numbers printed on report
– Speeds up chart negotiation
– Links to cross reference reports
• Additional element and cross-
reference reports provide
configuration detail
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 28
2
Cross-Reference
• Provides a listing of any reference to a tag
– Destructive and Non-destructive
– Direct and alias references
– Location where tag is accessed
• LD Rung/Instruction
• SFC Element Grid Location
• FBD Block Grid Location
• ST Line Number
• Generate reports based on cross-reference
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 29
2
Search & Replace
• What you can search for...
– Text in tag names, comments or logic
– Tags
• Component Alias - Will find other tags that
share the same base tag as the specified tag
• All Aliases - Will find other tags that can
reference any part of the specified tag
– Language Elements (instructions)
– Logix edits (I/R/D)
• Maintains a list of the last 10 searches
to reduce effort reissue the same search
• Where does search operate?
– Language editors
– Tag editor / Data monitor
• Use search to locate individual
references or all references at once
• Replace permits the selective replacement
of one string for another
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 30
2
New Instructions for SFC
• Three new Ladder Diagram (LD) and Structured Text (STX)
instructions added to Logix5000 to control SFC Operations
– SFR- Sequential Function Chart Reset
• Resets a specific SFC chart to a specified step
• Active steps are post scanned by processor
to reset outputs
– SFP – Sequential Function Chart Pause
• Suspends the operation of the specified
chart as long is rung is true
– EOT – End of Transitional
• Used within a subroutine called by a transitional
to indicate that a step’s operation is complete
• Execute these in a separate LD/ST subroutine
called by an Action of a step
• Provides programmatic control over SFC execution
– Develop code to determine machine state and automatically adjust to the
appropriate SFC step to facilitate machine startup and recovery
– Provides consistency for applications developed in PLC-5
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 31
2
Configurable SFC Execution Options
• Logix5000 provides different type of execution methods to help you
customize the chart control to meet specific needs
– Provides more control over execution
– Avoids the need to create and manage additional code
• Execution model – Determines when chart scan terminates
– Execute only active step(s) per scan
– Execute multiple steps in a single scan till false transition is found
• Restart - Determines chart starting
location for processor run mode
transition
– Initial step - restarts at the step
you have configured as “Initial Step”
– last active – restarts at the step
that was active when the chart
stopped
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 32
2
Configurable SFC “Last Scan” options
• Logix provides multiple options to configure a controller to
selectively reset operations when an SFC step completes
– Supports retentive and non-retentive operations
– Provides for automatic and controlled shutdown
• Gives you full control of step post-scan operations so that
your program operates using the most optimal method
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 33
2
SFC Off-line & On-line Support
• Initially developed as an off-line development tool with on-line support
monitoring and debug support
– Develop programs off-line
– Download/upload programs to/from controller
– Monitor programs on-line
• Active step/branch animation
• Auto-scroll to keep active step on display
– Debug chart execution
• Tag data and SFC element property changes
• Transition Forcing and Step Through Control
• Simultaneous Branch Forcing
• Select Branch execution order
– Future on-line programming support
• Initially available for hardware based Logix5000 controllers
– ControlLogix5500, FlexLogix5400, CompactLogix5300, and
DriveLogix5700
– SoftLogix5800 support planned for future releases
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 34
2
RSLogix 5000 ST Language
• Available as an add-on option for RSLogix 5000 Standard or mini, and included with RSLogix
5000 Professional
• Fully functional editor
– Red “Wavy Underlines” annotate undefined tags or programming errors
– Syntactic coloring monitoring for commands, tags and comments to improves readability
– Instruction format tool-tips simplify code development
– Cut/Copy/Paste from other text editor tools
• High level programming language similar to Basic, Fortran, Pascal or “C”
– If/Then, Case, Do/While, Do/Until,
and For/Next constructs
– Most LD and FBD Instructions
supported, Including Motion and
Process
– Call routines in FBD, LD, SFC or ST
when needed
• Off-Line development with on-line
monitoring
– Works with Logix5000 engine to
support upload/download of ST
routines from processor
– Watch-Pane auto tag list, displays
operating tag values
– On-Line edit planned (V13)
• IEC1131-3 Compliant language
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 35
2
Applications for Structured Text
• Easily represent complex mathematical
calculation
• Development of specialized array / table
processing
• Creation of ASCII String protocol
processing
• Imbedded motion control functions
• Inclusion of Process / Drive control
functions permits specialized algorithms
• Provide a foundation for applications
using the Reliance Automax basic
language
• Easily convert text based Basic, “C”,
Pascal and Fortran code to run on a
Logix5000 controller
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 36
2
ST Decision and Loop Constructs
• IF and CASE operations determine execution
– Build decisions to meet application’s specific needs
– Combined with symbolic tags to provide self documented code
• FOR, WHILE and REPEAT process repetitive operations
– Build custom looping algorithms
– Easy way to process tables of information’
– Performs operation of Ladder file instructions like FAL…
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 39
2
ST Text Syntactic Color Coding
• Language statements, tag names, and comments
displayed in different colors
– Makes code easier to read and understand
– Simplifies code development
– Determine quickly if
code will be executed
or is commented out
• Red “wavy underlines”
denote invalid tags
– Locate misspelled or
undefined tag names
– Immediate feedback
on programming errors
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 40
2
ST Comments
• Both in-line and multi-line comments supported
– In-line comments provide a description for a single line of code
• Beginning with “//” and terminate with a “CRLF”
• Can also be used to block a single line of code from execution
• Rockwell Automation extension to IEC61131-3
– Multi-line comments provide more descriptive information for how the
code performs its function
• Two formats available (* comment…*) or /* comment… */
• Can also be used to block a group of code lines from executing
• Green context coloring makes comments standout from code
• All Structured Text comments are loaded into the controller during
application download
– Available on upload even if you
don’t have the original source
– Maintains program white-space,
tabs, and line-feeds to
preserver presentation
– Compressed from 70 to 80 %
to minimize memory needs
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 41
2
ST Tag Manipulation
• Multiple ways to specify tags in your code
– Using a mouse you can navigate
the context menu to the tag browse
tool to select tags
– Using the keyboard, Ctrl-Space
provides a tag selection window
with auto-fill / tag lookup
• list locates first tag with
matching name
• Eliminates the need
to memorize tag names
• Reduces program
development effort
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 42
2
ST On-Line Monitoring
• ST Routine highlighted to show running status
– Lets you know the processor is in run mode
• Tooltips provide access to tag data values
– Displays description, datatype and a snapshot of the data value
– Preserves routine formatting and avoids having to scroll watch pane to
view a single tag
• Tag Info
Watch Pane displays tooltip
all tags referenced
by the routine
– Lists tags, value and
descriptions
– Animated values
change as routine
Data Values Tags referenced
executed In ST Routine
• Useful for debug and
maintenance operations
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 43
2
ST Routine Execution
• Each time a Structured Text routine is called (either as a subroutine or as the
main routine in a program) it begins executing from the beginning of the
routine (Similar to Ladder Diagram)
– Code within the ST routine is executed based on the constructs used
– Using IF and CASE you can selectively choose the code you want to execute
• Focuses the execution on specific areas of the code
• Helps reduces routine scan time to optimize CPU performance
– Using FOR, DO UNTIL, and DO WHILE you can perform repetitive loops
• Useful for processing arrays or tables
• The CPU watchdog timer continues while ST executes, so infinite loops will be trapped
• Structured Text Transitional Instructions
– In Ladder Diagram a rung state change is used to trigger various operations within
instructions (timers, counters, one-shots, messaging, motion…)
– In ST these instructions are handled in one of two ways:
• Counters, messaging and motion instructions acts as though the rung has just gone true
each time they are executed in ST
– May require additional code to manage the instructions execution
• For timers and one-shot instructions external manipulation is required to initialize and
reset
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 44
2
ST Pre-Scan Operation
• On power-up the controller performs a pre-scan of each task
to initialize instructions (outputs, non-retentive timers…)
– Select instructions also perform various operations during pre-scan
– Example: ONSR one-shot instruction turns off storage bit...
• In ST you can use the bracketed assignment operator “[:=]”
to force the value to be reset during pre-scan
– Resets Bit tags and forces numeric tags to zero
– If you want tag left in last state, use the non-bracketed assignment
operator “:=“
– Extension over IEC61131 standard
• Minimizes the amount of code you need to write to initialize
your application
– Provides more control over what you want retained or reset
– Reduces development time
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 45
2
SFC Post Scan Impact on ST
• SFC provides an automatic reset operation
– Performs a post-scan of the actions associated with a Step once the
transition indicates the step is completed
• Perform a controlled shutdown of the code
• In ladder diagram routines, output coil (OTE) instructions are turned off and
non-retentive timers are reset...
• The SFC Automatic reset is optional and can be overridden by changing a
controller property
– ST code embedded in an SFC Step’s action directly or ST code called
via a JSR are also post scanned
• Depending on the application you can control what occurs during post-scan
• Using the bracketed assignment operator “[:=]“ tags are reset to zero (both
Boolean and numeric tags)
• Using non-bracketed assignment operator “:=“ tags are left in their last state
• The Automatic reset combined with the two ST assignment
operators simplify program initialization
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 46
2
ST Off-line & On-line Support
• ST programming environment is initially targeted as an off-line
development tool with the ability to monitor running programs
– Off-line programming
– ST Programs both downloaded and uploaded (with comments)
– Tag values in watch pane update with memory changes
– Tooltip provides tag snapshot
– Future on-line programming support
• Initially available for hardware based Logix5000 controllers
– ControlLogix5500, FlexLogix5400, CompactLogix5300, and
DriveLogix5700
– SoftLogix5800 support planned for future release
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 47
2
RSLogix 5000 Multi Language Support
• Fully integrated with other languages within RSLogix 5000
– Exists as part of RSLogix 5000, uses existing database, menu structure,
controller organizer, I/O configuration, etc.
– Available as an option to mini and standard versions and included with
Professional
• LD, FBD, SFC, ST routines can co-exist with other routine types in the
same controller
– A routine of any language can
call other SFC, ST, LD or FBD
routines
• Works with Logix5000 engine
to support upload/download of
routines from processor
– All languages are are native to
Logix5000
• IEC1131-3 Compliant
languages
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 48
2
Acquiring SFC / ST
• The SFC and ST Languages are available in two
forms
– Add on option for RSLogix 5000 Mini Edition (9324-
RLD200ENE) and Standard Edition (9324-
RLD300ENE)
• 9324-RLDSFCE Sequential Function Chart Language Option
• 9324-RLDSTXE Structured Text Language Option
• 9324-RLDMLPE Multi-Language Pack Option (Includes FBD,
SFC, and STX)
• Permits you to purchase just the language(s) you need
– Included with RSLogix 5000 Full Edition (9324-
RLD600ENE) and Professional Edition 9324-
RLD700NXENE
• All languages are included (LD, FBD, SFC, and ST)
• Purchase all languages from a single catalog number
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 49
2
New RSLogix 5000 Full Edition
• Complete version of RSLogix 5000
– Will Support all Logix5000 Controllers
– Provides all of the capabilities of the Standard Edition and
includes support for all optional programming languages
• Function Block Diagram (FBD)
• Sequential Function Chart (SFC)
• Structured Text (STX)
– RSNetWorx and RSLogix Emulate5000 are available separately
• Targeted SI’s and Large End Users needed multiple
languages and already own RSNetWorx
– Existing users of Mini and Standard can get the same capabilities
as the Full Edition by purchasing the separate language options
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 50
2
RSLogix 5000 Packages / Options
RSLogix 5000 Enterprise Mini Edition Standard Edition Standard/Network Full Edition Professional Edition
Series bundles / options 9324-RLD200ENE 9324-RLD300ENE 9324-RLD300NXENE 9324-RLD600ENE 9324-RLD700ENE
Logix5000 Controllers CompactLogix5300 All All All All
Supported FlexLogix5400
Function Block Diagram1, 2 Separate Option Separate Option Separate Option Included Included
9324-RLDFBDENE
Sequential Function Chart1, 2 Separate Option Separate Option Separate Option Included Included
9324-RLDSFCE
Structured Text1, 2 Separate Option Separate Option Separate Option Included Included
9324-RLDSTXE
PIDE Autoune Separate Option Separate Option Separate Option Separate Option Separate Option
9323-ATUNEENE
RSLinx Lite Included Lite Included Lite Included Lite Included Pro Included
RSNetWorx CNet & Dnet Separate Option Separate Option Included Separate Option Included
9357-ANETL3
Drive Executive Lite Separate Option Included Included Included Included
9303-4DTE01ENE
1756-MVI SW Dev Toolkit Separate Option Separate Option Separate Option Included Included
1. Able to upload and download without option. Must purchase option to view, edit and print routines in this language
2. 9324-RLDMLPE Multi-Language pack includes FBD, SFC, and STX
May 23, 200 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 51
2