Developing a
TriStation
1131 Project
Programming Languages
• Function Block Diagram (FBD)
• Ladder Diagram (LD)
• Structured Text (ST)
• Cause & Effect Matrix (CEM)
Function Block Diagram (FBD)
Language
• FBD is a graphically oriented language that
corresponds to circuit diagrams.
Ladder Diagram (LD) Language
• LD is a graphically oriented language that
uses a standard set of symbols to
represent relay logic.
Structured Text (ST) Language
• ST is a general purpose, high-level
programming language, similar to
PASCAL or C. ST is particularly useful
for complex arithmetic calculations, and
can be used to implement complicated
procedures that are not easily expressed
in graphical languages (for example,
FBD or LD).
Structured Text (ST) Language
Cause & Effect Matrix (CEM)
Language
• CEM is a methodology that is commonly
used throughout the process control
industry to define Emergency Shutdown
(ESD) strategies.
• CEMs are frequently used for applications
like fire and gas systems for which the
programming logic is simple, but the
volume of inputs and outputs that need to
be controlled is high.
Cause & Effect Matrix (CEM)
Language
Elements of a Project
Database file that contains all of the elements you
create during application development. Each
project file has the extension PT2. The main
elements of a project include the following:
• Programs
• Function blocks
• Functions
• Data types
• Shared libraries
• Configuration
Overview of a
TriStation 1131 Project
Programs
• The highest-level logic element within a
TriStation 1131 project.
• An assembly of programming language
elements that work together to allow a
programmable control system to achieve
control of a machine or process.
• A maximum of 2,000 variables (inputs,
outputs and locals) can defined.
• A program can invoke functions or function
blocks but cannot invoke another program.
…Programs
Program Instances
• In TriStation 1131, programs are not executed
directly. In this regard, it helps to think of a program
as a program type. To download and execute a
program type, you declare one or more executable
copies of the program which are known as program
instances.
• Each program instance must have a unique instance
name.
• A maximum of 250 program instances can be
downloaded to the TRICON controller.
…Programs
Multiple Programs within a Project
• A typical TriStation 1131 project is
partitioned into multiple programs based
on the operation of particular units in the
controlled process.
• For example, the control strategy for a
common process area within an oil refinery
could be partitioned into separate
programs that control crude oil distillation
towers, furnaces, hydro-desulphurization
areas, and redistillation areas.
…Programs
Safety and Control Attributes for Programs
• Programs in TriStation 1131 must be
defined with either a Safety attribute for
programs used in safety shutdown
applications, or a Control attribute for
programs used for non-safety logic and/or
control applications.
• A program may be defined as either safety
or control, not both. A safety program can
use only safety elements, and a control
program can use control elements as well
as safety elements.
Function Blocks
• A function block is an executable logic
element which yields one or more values
and is identified by an instance name.
Function Blocks
Function Block Instances
• Function blocks, like programs, are not
directly executed. When you want a
program to invoke a function block, you
must give the function block an instance
name that is unique within the program or
function block in which it is being invoked.
Function Blocks
Safety and Control Attributes for
Function Blocks
• Every function block must be created
with either a Control or Safety and
Control attribute. A Control function
block can use functions and function
blocks that have either the Control
attribute or Safety and Control
attribute. A Safety and Control
function block can use only functions
and function blocks that have the
Safety and Control attribute.
Functions
• A function is a logic element which yields
exactly one result.
• A function is directly executed and does
not need to be instanced.
• You can declare a maximum of 400
variables (inputs, outputs and locals) in
each function.
Functions
Safety and Control Attributes for Functions
• Every function must be created with
either a Control or Safety and Control
attribute.
• A Control function can use functions that
have either the Control attribute or
Safety and Control attribute.
• A Safety and Control function can use
only functions that have the Safety and
Control attribute.
Data Types
Two kinds of data types are applicable to
TriStation 1131 projects:
• Elementary
• Generic
Elementary Data Types
• An elementary data type defines the size
and characteristics of most data used in a
program, function or function block and the
operations that can be applied to the data.
Data Type Size & Characteristics
BOOL A Boolean, 1 bit in length
DATE A specific date, in the format D#CCYY-MM-DD
DINT A double integer, 32 bits in length
DT A specific date and time, in one of the following formats:
– DT#CCYY-MMDD-HH-HH:MM:SS
– DATE_AND_TIME#CCYY-MM-DD-HH:MM:SS
DWORD A double word, 32 bits in length
INT An integer, 16 bits in length
LREAL A long real number, 64 bits in length
REAL A real number, 32 bits in length
STRING A sequence of up to 132 alphanumeric characters delimited by single quotes
TIME A period of time (duration) measured in milliseconds.
TOD A specific time of day, in one of the following formats:
– TOD#HH:MM:SS
-- TIME_OF_DAY#HH:MM:SS
Elementary Data Types
Of the data types listed above, only
variables of the following types can be
declared as TRICON points. These
variables point to hardware addresses
in the TRICON and are accessible to all
programs in a TriStation 1131 project.
• BOOL
• DINT
• REAL
Generic Data Types
• Identified by the prefix ANY, are used
exclusively in functions and function blocks
available in the TriStation 1131 shared library.
Shared Libraries
For every project, TriStation 1131 provides three
standard libraries which contain functions and
function blocks you can use for application
development:
• The Standard Library (STDLIB) which complies with
the IEC 1131-3 standard
• The Triconex Library (TCXLIB) for all Triconex
platforms
• The TRICON Library (TR1LIB) specifically for the
TRICON platform
• In addition, you can share the programs, functions
and function blocks that you develop with other
projects by using TriStation 1131’s shared library
feature.
Configuration
A configuration is the element of a TriStation
1131 project that supports the installation of
your process control application into the
TRICON controller. A configuration consists of
the following elements, as shown in the
diagram that follows:
• One or more program instance declarations
• TRICON point connections
• TRICON hardware configuration
Program Instances
• Program instances are executable copies of a
program type which are downloaded to the
TRICON.
• For example, if your project needs to control several
Firewater Deluge Pumps, using program instances
could help. The operation of the pumps is simple
and unlikely to change as time goes by, and the
amount of logic needed to control each one is
small. Therefore it would make sense to create one
program type and declare an instance of that type
for each pump being controlled.
• The maximum number of program instances you
can declare in a TRICON configuration is 250.
TRICON Point Connections
• Whereas a local variable can only be
accessed within the logic element in which
it is declared, a TRICON point is
accessible to all program instances in the
configuration.
• Each TRICON point is associated with an
Input point, Output point or Memory
address in the TRICON. Every input and
output variable in a program instance must
be connected to a TRICON point. The
Configuration editor provides the
Connections Wizard for making these
connections, either manually or
automatically.
TRICON Hardware Configuration
• Configuration of the TRICON hardware
includes the following elements, accessible
from the directory tree on the left side of the
Configuration Editor window:
• System parameters such as the network
node, scan time, passwords, and memory
allocation
• TRICON chassis
• I/O and communication modules installed
within TRICON chassis