SFC Presentation
-
Upload
jmtriggerz -
Category
Documents
-
view
109 -
download
2
description
Transcript of SFC Presentation
May 23, 2002 Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
1
RSLogix 5000Sequential Function Chart (SFC) & Structured Text (ST)Languages
This presentation presents the SFC & ST implementation for the Logix5000 processor.
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 2
Sequential Function Chart (SFC) Language• Available as an add-on option for RSLogix 5000 Standard or mini, and included
with RSLogix 5000 Full and Professional• Graphical Free-form drawing / programming environment
– Place steps, transitional, simultaneous and select branches and draw connections to determine execution flow
– Position and Organize blocks based on application to improve readability– Floating or linked text boxes provide application documentation (Stored off-line)
• Embed Structured Text in transitions and actions directly– Improves readability and maintenance– Eliminates extraneous routines– Use ST to call routines in FBD, LD,
SFC or ST when needed
• Off-line editing with on-line monitoring– Display Auto-scroll keeps active step
In the view to simply maintenance– Works with Logix5000 engine to
support upload/download of SFCroutines from processor
– On-Line editing planned (V13)
• IEC1131-3 Compliant language
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 3
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 4
RSLogix 5000 SFC Editor
SFCElementToolbar
SFCLanguage
Editor
SFCRoutine
EmbeddedStructuredText Action
EmbeddedStructured Text
Transitional
StepDescription
Monitor Tagof on-lineoperation
AutomaticName
Generation
Specific nameswith backingstructure tagQuick Access
Property Dialogs
SFCEditor / Routine
Overview
SFC Show/Hide Grid and
Page Lines
SFCRuntime
Autoscroll
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 5
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 structureimproves navigation (A1, B2, C3..)
– Used by cross-reference toprovide quick navigation
– Dashed lines show SFC elementplacement within grid (can behidden if desired)
• Report page boundaries displayedas solid lines within chart
– Helps organize your chart basedon the report outputs
• SFC Elements are automaticaligned to an invisible internalgrid to provide clean routineappearance
Dashed Cross-reference
Grid
SolidReport Page
Boundary
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 6
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 indicatearea in view
Move cursor toDifferent part
of chart to change view
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 7
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 currentchart position
– Drag & Drop - to manuallyposition element in chart
• Element browser provideskeyboard navigation– Just press [Insert] key
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 8
SFC Language Elements
• SBR/RET – Passes input / output parameters to/from a chart
• Initial Step – The start position for the chart execution
• Step – Position within a chart that defines an operating state
• Action – Portion of a step that defines a specific behavior
• Transitional – Decision point to determine when a steps operation is completed
• Stop – Termination position for a path 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 executed
SimultaneousBranch
SelectBranch
StopElement
InitialStep
Action
Transitional
SBR/RETParameters
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 9
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 manuallyif you prefer
• Auto routing of element connections– All wires run vertically and
horizontally with right angles
– visual display of validconnection points
– Sticky wires stay connectedwhen elements are moved
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 10
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 11
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 tocreate and name tags
– Provides more effectivedevelopment workflow
• Option to automaticallydelete tag when element isremoved from chart
– Eliminates programmodification steps
– Avoids orphaned tagsbeing left in program
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 12
• 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
optionally disabled
• Configurable step timer monitorsstep execution– Step timer preset can be a fixed value
– or an expression evaluated at run time• Tag or complex calculation
StepName
View StepAttributes
View/HideActions
Backing TagComment
EditState
ConnectionPoints
Step Elements
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 13
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
Datatype SFC_STEPStatus : DINT; Status Field containing X,FS,SA...AlarmHiX : BOOL; Step executing bit (FS + SA + LS)FS : BOOL; First scan bit SA : BOOL; Step Active bit (Not FS or LS)LS : BOOL; Last scan bitDN : BOOL; Step Timer done, T=PREOV : BOOL; Step timer overflow DINT MaximumAlarmEn: BOOL; Enables Hi/Low AlarmingAlarmLow : BOOL; Low Step Time Alarm FaultAlarmHi : BOOL; High Step Time Alarm FaultPRE : DINT; Step timer preset, sets DN when T=PRET : DINT; Length of time step has executedTMax : DINT; Maximum Step Time value detectedCount : DINT; Number of times step activatedLimitLow : DINT; Low Alarm Step TimeLimitHi : DINT; High Alarm Step Time
End_Datatype;
Alarms
Step Timer
ExecutionCount
Step StateBits
In-lineExpressions
DisplayOptions
InitialStep
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 14
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 achart so that you can organize theroutine around the application– Does not force the execution
to begin at the top
InitialStep
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 15
• Unlimited number of actions per step• Three types of actions:
– Boolean actions are true when the actionis active otherwise false
• 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
routines and improves readability• Requires ST Language option
• Action uses a tag as a control structure– Provides a 40 character name for each action,
automatically generated– 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
Step Actions
ActionQualifier
ActionName
View ActionAttributes
IndicatorTag
EmbeddedStructuredText Code
Show/HideActions
MultipleActionsper Step
EditState
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 16
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 reworkingscan after development is completed
Datatype SFC_ACTIONStatus : DINT; Status field containing A and QA : BOOL; Action is executingQ : BOOL; Active except for last scan, P0 or P1T : DINT; Time accumulated based on action qualifierPRE : DINT; Time qualifier presetCount : DINT; Number of times action activated
End_Datatype;
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 17
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 18
Action Qualifier Timing
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 19
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 20
• 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• Can use to set always true / false condition
• Transition uses a tag for state data– Tag value accessible from logic
• Choice of accessibility / isolation• Created at program scope by default• Defined as a BOOL datatype
– Provides a 40 character name for eachtransition, automatically generated
– Tag description provides in-line documentation• Can be modified in SFC Editor, tag editor and
CSV Import/Export• 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
Transition Elements
TransitionName
ConnectionPoints
Embedded Condition
Logic
TransitionForce State
ViewTransitionAttributes
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 21
Transition Forcing & Step Through Provide Chart Debug Capabilities
• Transition Forcing permits each transition to be forced true / false– True – Chart executes the step prior to the transition once then moves to next step– False – Chart scan holds on step prior to transition– Enabled either with I/O or independently to provide more control over force
operations
• Transition “Step Through” option is a one shot true force of a transition– Moves chart to next step one time
• Provides ability to manually override SFC execution– Monitor and debug directly from the interface– Simplifies equipment startup process
ForcedTransitionOn-Line toolbar
Presents Force StatusFor Both I/O & SFC
Logic MenuProvides Control
for Both I/O & SFC
Enable bothI/O and SFC Forces
together from toolbar
ForceOptions
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 22
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_STOPStatus : DINT; Status field containing XX : BOOL; ActivatedCount : DINT; Number of times Stop activated
End_Datatype
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 23
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 24
Simultaneous Branches
• Executes multiple chart paths at once– Permits multiple steps to be active at
one time– Unlimited number of branch legs, elements
per leg and nested branches
• Flexible branch layout works they way you want it to work!– permits configuration to closely
resemble process
– Avoids useless steps placeholders
• Brach leg forcing enhances chart debug and maintenance– Permits each branch to be disabled
individually
– Displayed in chart both off and on-line
BranchForce Right Click
to Force
FlexibleBranching
FlexibleBranching
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 25
Select Branches
• Executes one of many chart paths– Permits process based decisions to alter
the execution flow– Unlimited number of branch legs,
elements per leg and nested branches
• Flexible branch layout worksthey way you want it to work!
– permits configuration toclosely resemble process
– Avoids useless steps placeholders
• Configurable evaluation order– Defaults evaluation from Left to right– User defined evaluation order permits
you to determine branch priority– Permits changing order without
reorganizing chart
• Transition forcing and step through provides select branch debug override
FlexibleBranching
FlexibleBranching
Executionorder
ForcedTransition
Right Clickto Set Order
DefaultLeft to Right
User Configured
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 26
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
Destinationreference
SourcereferenceVisible
Wire
Right Clickto Hide
Gridlocation
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 27
Documenting Your SFC Routine
Routine Description Tag Comments Text Box Embedded ST
Visibility Routine property dialog and routine tool-
tip
Tag editor and data monitor, optionally
show/hide in SFC chart
SFC chart Only SFC chart Action and Transition expressions
Modification Routine Property Dialog
Step/ Transition property dialog, and Tag Editor
SFC chart editor SFC chart’s embedded 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 Linkage
N/A Moves with SFC element Free-floating or anchored to element
Moves with embedded ST code in SFC Element
Embedded STAction Comment(Stored Online)
Text Box Anchoredto Transition
Text Box Anchoredto Step
Text Box Free Floating
Step TagDescription
Transition TagDescription
Embedded STTransition Comment
(Stored Online)
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 28
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 29
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 30
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 searchesto reduce effort reissue the same search
• Where does search operate?– Language editors– Tag editor / Data monitor
• Use search to locate individualreferences or all references at once
• Replace permits the selective replacement of one string for another
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 31
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 32
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 startinglocation for processor run modetransition– Initial step - restarts at the step
you have configured as “Initial Step”
– last active – restarts at the stepthat was active when the chartstopped
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 33
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
Automatic Reset Programmatic Reset No Reset
Step
Post Scan
Method
•Automatically resets when SFC Step’s transition evaluates to true•CPU Resets outputs, timers and various instructions•ST bit or numeric assignments using [:=] are reset to 0
•Performs an additional scan of SFC Actions with “LS” bit set to true•Utilize “Step.LS” bit to programmatically clear values•Or utilize a falling edge “P0” Action to perform programmatic reset
•No more scans performed•utilize a falling edge “P0” Action to perform programmatic reset
Benefits •No additional programming required to clear outputs•Works similar to PLC’s SFC Language
•You have control over the reset operation via the Step.LS bit•Permits reset of values other than zero•Allows you to leave outputs energized across multiple steps
•Operates like programmatic but avoids overhead of “Last Scan”•Permits reset of values other than zero•Allows you to leave outputs energized across multiple steps
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 34
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 35
• 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 andProcess
– Call routines in FBD, LD, SFC or STwhen needed
• Off-Line development with on-linemonitoring
– Works with Logix5000 engine to support upload/download of STroutines from processor
– Watch-Pane auto tag list, displaysoperating tag values
– On-Line edit planned (V13)• IEC1131-3 Compliant language
RSLogix 5000 ST Language
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 36
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 37
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…
IF <Boolean expression> THEN <statements…>
ELSIF <Boolean expression> THEN <statements…>
ELSE<statements…>
END_IF;
CASE <any integer or real expression> OF< selector value 1> : <statements…>< selector value 2> : <statements…>…
ELSE< statements…>
END_CASE;
FOR <initialize iteration variable>TO <final value expression>[BY <increment expression>] DO<statements…> EXIT
END_FOR;
WHILE <Boolean expression> DO<statements…> EXIT
END_WHILE;
REPEAT<statements…> EXIT
UNTIL <Boolean expression>END_REPEAT;
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 38
ST Instruction Set• Instruction set commonality with Ladder Diagram (LD) and Function Block
Diagram (FBD)– Reduces learning curve– Permits selection of appropriate Language for application
• In line operations consistent with common text based programming languages and IEC 61131-3
– Assignment operators (retentive := , non-retentive [:=])– Mathematical operations (+,-,*,/,**, Mod)– Comparison operations (=, >=, <=,>,<,<>)– Logical operations (AND, &, OR, NOT, XOR)– Trig Functions
• Automatic numeric datatype conversion reduces development time by eliminating need for temporary tags and conversion functions
• Supports calls to Logix5000’s advanced built instruction set– Over 125+ instructions are at your disposal– Advanced Motion Instructions– FBD Process and Drive control blocks– JSR / SBR / RET functions for routine encapsulation
• The Most Comprehensive built in Instruction set in the industry– Minimizes development and reduces program debug effort
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 39
ST Instruction Programming
• Multiple ways to develop structured text codeto minimize program development time– Using a mouse and the
Integrated Instruction Toolbar– Keyboard Alt-Ins provides a
instruction selection dialog completewith instruction descriptions
– Simply type the function name toreceive formatting tool-tip
• Provides instruction parameterconfiguration
• Select the method that bestmeets your development needs
• Pop-up tool tips for Instructionsand Functions simplifycode development
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 40
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 executedor is commented out
• Red “wavy underlines”denote invalid tags– Locate misspelled or
undefined tag names– Immediate feedback
on programming errors
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 41
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 topreserver presentation
– Compressed from 70 to 80 %to minimize memory needs
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 42
ST Tag Manipulation
• Multiple ways to specify tags in your code– Using a mouse you can navigate
the context menu to the tag browsetool to select tags
– Using the keyboard, Ctrl-Spaceprovides a tag selection windowwith auto-fill / tag lookup
• list locates first tag withmatching name
• Eliminates the needto memorize tag names
• Reduces programdevelopment effort
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 43
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
• Watch Pane displaysall tags referencedby the routine– Lists tags, value and
descriptions
– Animated valueschange as routineexecuted
• Useful for debug andmaintenance operations
Tag Infotooltip
Tags referencedIn ST Routine
Data ValuesData Values
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 44
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 45
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 46
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 47
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 48
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 FBDroutines
• Works with Logix5000 engineto support upload/download ofroutines from processor– All languages are are native to
Logix5000
• IEC1131-3 Compliantlanguages
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 49
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 50
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved 51
RSLogix 5000 Packages / Options
RSLogix 5000 Enterprise Series bundles / options
Mini Edition 9324-RLD200ENE
Standard Edition 9324-RLD300ENE
Standard/Network 9324-RLD300NXENE
Full Edition 9324-RLD600ENE
Professional Edition 9324-RLD700ENE
Logix5000 Controllers Supported
CompactLogix5300 FlexLogix5400
All All All All
Ladder Diagram Included Included Included Included Included
Function Block Diagram1, 2
9324-RLDFBDENE
Separate Option Separate Option Separate Option Included Included
Sequential Function Chart1, 2
9324-RLDSFCESeparate Option Separate Option Separate Option Included Included
Structured Text1, 2
9324-RLDSTXE
Separate Option Separate Option Separate Option Included Included
PIDE Autoune9323-ATUNEENE
Separate Option Separate Option Separate Option Separate Option Separate Option
RSLinx Lite Included Lite Included Lite Included Lite Included Pro Included
RSNetWorx CNet & Dnet
9357-ANETL3
Separate Option Separate Option Included Separate Option Included
Drive Executive Lite 9303-4DTE01ENE
Separate Option Included Included Included Included
1756-MVI SW Dev Toolkit Separate Option Separate Option Separate Option Included Included
Functionality / Value Limited Maximum
1. Able to upload and download without option. Must purchase option to view, edit and print routines in this language2. 9324-RLDMLPE Multi-Language pack includes FBD, SFC, and STX