RSLogix 5000 Sequential Function Chart (SFC) Language

Download Report

Transcript RSLogix 5000 Sequential Function Chart (SFC) Language

RSLogix 5000
Sequential 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
1
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 SFC
routines from processor
– On-Line editing planned (V13)
•
IEC1131-3 Compliant language
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
3
RSLogix 5000 SFC Editor
SFC Show/Hide
Grid and
Page Lines
SFC
Runtime
Autoscroll
SFC
Element
Toolbar
SFC
Editor / Routine
Overview
Quick Access
Property Dialogs
SFC
Routine
SFC
Language
Editor
Embedded
Structured Text
Transitional
Automatic
Name
Generation
Monitor Tag
of on-line
operation
Embedded
Structured
Text Action
Step
Description
May 23, 2002
Specific names
with backing
structure tag
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
4
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
placement within grid (can be
hidden if desired)
•
Report page boundaries displayed
as solid lines within chart
– Helps organize your chart based
on the report outputs
•
Dashed
Cross-reference
Grid
SFC Elements are automatic
aligned to an invisible internal
grid to provide clean routine
appearance
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
Solid
Report Page
Boundary
5
Routine Overview Navigation
• Routine overview button in editor provides “birds-eyeview” 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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
6
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
7
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
May 23, 2002
Action
SBR/RET
Parameters
Simultaneous
Branch
Initial
Step
Transitional
Select
Branch
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
Stop
Element
8
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
9
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, Overrun / 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
10
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
11
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
optionally disabled
Step
Name
Connection
Points
• Configurable step timer monitors
step execution
– Step timer preset can be a fixed value
– or an expression evaluated at run time
View Step
Attributes
Backing Tag
Comment
View/Hide
Actions
Edit
State
• Tag or complex calculation
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
12
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_STEP
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)
LS : BOOL;
Last scan bit
DN : BOOL;
Step Timer done, T=PRE
OV : BOOL;
Step timer overflow DINT Maximum
AlarmEn: BOOL; Enables Hi/Low Alarming
AlarmLow : BOOL; Low Step Time Alarm Fault
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
TMax : DINT;
Maximum Step Time value detected
Count : DINT;
Number of times step activated
LimitLow : DINT; Low Alarm Step Time
LimitHi : DINT;
High Alarm Step Time
End_Datatype;
May 23, 2002
Initial
Step
Step State
Bits
Step
Timer
Execution
Count
Alarms
Display
Options
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
In-line
Expressions
13
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
chart so that you can organize the
routine around the application
Initial
Step
– Does not force the execution
to begin at the top
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
14
Step Actions
• Unlimited number of actions per step
• Three types of actions:
Indicator
Tag
View Action
Attributes
Action
Name
Action
Qualifier
– Boolean actions are true when the action
is 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
Show/Hide
Actions
Edit
State
Multiple
Actions
per Step
Embedded
Structured
Text Code
– 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
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
15
Action Attributes and Built in Diagnostics
•
Structured Action tag provide specific names for action configuration and properties
–
–
•
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
–
–
•
Includes IEC61131-3 defined attributes and Logix5000 extensions
Directly accessible via an MMI using names stored in the controller
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;
A : BOOL;
Q : BOOL;
T : DINT;
PRE : DINT;
Count : DINT;
End_Datatype;
May 23, 2002
Status field containing A and Q
Action is executing
Active except for last scan, P0 or P1
Time accumulated based on action qualifier
Time qualifier preset
Number of times action activated
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
16
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
17
Action Qualifier Timing
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
18
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
19
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
• Can use to set always true / false condition
View
Transition
Attributes
Transition
Name
• 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
Transition
Force State
– Provides a 40 character name for each
transition, automatically generated
– Tag description provides in-line documentation
Connection
Points
Embedded
Condition
Logic
• 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
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
20
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
On-Line toolbar
Presents Force Status
For Both I/O & SFC
Forced
Transition
Force
Options
Logic Menu
Provides Control
for Both I/O & SFC
Enable both
I/O and SFC Forces
together from toolbar
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
21
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
22
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
23
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
Branch
Force
Right Click
to Force
• Flexible branch layout works they
way you want it to work!
– permits configuration to closely
resemble process
– Avoids useless steps placeholders
Flexible
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
24
Select Branches
•
Executes one of many chart paths
Execution
order
– Permits process based decisions to alter
the execution flow
– Unlimited number of branch legs,
elements per leg and nested branches
•
Flexible branch layout works
they way you want it to work!
Forced
Transition
Right Click
to Set Order
– permits configuration to
closely 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
May 23, 2002
Flexible
Flexible
Branching
Branching
Default
Left to Right
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
User
Configured
25
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
Visible
Wire
Source
reference
Destination
reference
Right Click
to Hide
May 23, 2002
Grid
location
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
26
Documenting Your SFC Routine
Text Box
Free Floating
Text Box Anchored
to Step
Step Tag
Description
Embedded ST
Action Comment
(Stored Online)
Transition Tag
Description
Text Box Anchored
to Transition
Embedded ST
Transition Comment
(Stored Online)
Routine Description
Tag Comments
Text Box
Embedded ST
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
Routine Property
Dialog
Step/ Transition property
dialog, and Tag Editor
SFC chart editor
SFC chart’s embedded
ST editor
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
N/A
Moves with SFC element
Free-floating or
anchored to element
Moves with embedded
ST code in SFC Element
Visibility
Modification
Size
Element
Linkage
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
27
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
•
May 23, 2002
Additional element and crossreference reports provide
configuration detail
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
28
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
29
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
30
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
31
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
32
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
33
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
34
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
35
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
36
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;
FOR <initialize iteration variable>
TO <final value expression>
[BY <increment expression>] DO
<statements…>
EXIT
END_FOR;
May 23, 2002
CASE <any integer or real expression> OF
< selector value 1> : <statements…>
< selector value 2> : <statements…>
…
ELSE
< statements…>
END_CASE;
WHILE <Boolean expression> DO
<statements…>
EXIT
END_WHILE;
REPEAT
<statements…>
EXIT
UNTIL <Boolean expression>
END_REPEAT;
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
37
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
–
–
–
–
–
•
•
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
–
–
–
–
•
Assignment operators (retentive := , non-retentive [:=])
Mathematical operations (+,-,*,/,**, Mod)
Comparison operations (=, >=, <=,>,<,<>)
Logical operations (AND, &, OR, NOT, XOR)
Trig Functions
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
38
ST Instruction Programming
• Multiple ways to develop structured text code
to minimize program development time
– Using a mouse and the
Integrated Instruction Toolbar
– Keyboard Alt-Ins provides a
instruction selection dialog complete
with instruction descriptions
– Simply type the function name to
receive formatting tool-tip
• Provides instruction parameter
configuration
• Select the method that best
meets your development needs
• Pop-up tool tips for Instructions
and Functions simplify
code development
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
39
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
40
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
41
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
42
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 displays
all tags referenced
by the routine
– Lists tags, value and
descriptions
– Animated values
change as routine
executed
Tag Info
tooltip
Data Values
• Useful for debug and
maintenance operations
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
Tags referenced
In ST Routine
43
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
44
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 prescan
– 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
45
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
46
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
47
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, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
48
Acquiring SFC / ST
• The SFC and ST Languages are available in two
forms
– Add on option for RSLogix 5000 Mini Edition (9324RLD200ENE) and Standard Edition (9324RLD300ENE)
• 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 (9324RLD600ENE) and Professional Edition 9324RLD700NXENE
• 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
49
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
50
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
CompactLogix530
0 FlexLogix5400
All
All
All
All
Included
Included
Included
Included
Included
Function Block Diagram1, 2
9324-RLDFBDENE
Separate Option
Separate Option
Separate Option
Included
Included
Sequential Function Chart1, 2
9324-RLDSFCE
Separate Option
Separate Option
Separate Option
Included
Included
Structured Text1, 2
9324-RLDSTXE
Separate Option
Separate Option
Separate Option
Included
Included
PIDE Autoune
9323-ATUNEENE
Separate Option
Separate Option
Separate Option
Separate Option
Separate Option
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
Ladder Diagram
RSLinx
Functionality / Value
1.
2.
Limited
Maximum
Able to upload and download without option. Must purchase option to view, edit and print routines in this language
9324-RLDMLPE Multi-Language pack includes FBD, SFC, and STX
May 23, 2002
Copyright © 2002 Rockwell Automation Inc., All Rights Reserved
51