Вы находитесь на странице: 1из 5

Practical No:

AIM: - To study programming methods in DCS


OBJECTIVE:

To study various programming languages available in DCS

THEORY:DCS can be programmed using 5 different languages as follows:


1.
2.
3.
4.
5.

Ladder Diagram(LD)
Function Block Diagram(FBD)
Structured Text(ST)
Instruction List(IL)
Sequential Function Chart(SFC)

From all of these five languages mostly ladder diagram and function block diagram are most popular
for the programming of the Controller.
1. Ladder diagram
The ladder diagram is graphical representation of programming language using relay based
logic. To programming a DCS controller in ladder logic follows the same ladder logic as in the PLC.
All the connections and logics are same for both that controllers.
The ladder name is derived from the programs resemblance to a ladder with two vertical rails and a
series of horizontal rungs between them. The rails included in the ladder logic are called a power
rails. DCS ladder logic contains all the logics and instructions as the PLC logic contains.
DCS ladder logic is used for the higher level application. All the logics and instructions in both the
controllers are same as each other.
There are many types of instructions in ladder logic as shown below.
1. Basic instructions- NO -||- , NC -|/|- and output relay logic.
2. Arithmetic instructions- in which all the addition, subtraction, multiplication and dividing
functions contains.
3. Timer & Counter instructions- from which we can set the timers to automatically on-off the
process after some time.
So there are so many instruction format contains in the ladder logic. And it is also a simplest level
language format among all the other formats and also mostly used format for programming also.
2. Functional Block Diagram (FBD)
A functional block diagram, also a graphical representation of various mathematical and logical
functions, is primarily developed for programming continuous process automation, even though it
also supports discrete process automation.
FBD has also some rules and it based on the following:
Graphical representation of programming elements, which are modular, repetable, and
reusable in different parts of the program.

It represents functional relation between i/o.


Different blocks of this language are connected together to make whole logic structure
In this type of programming structure the logic will flow through the different logic blocks.
And it will be flow through the input to output.
Primary concept behind FBD is data flow. The connecting lines have data types that must be
compatible on both the ends.
Its main advantage is that it will supports programming of binary numbers to deal with bit
logic
For the FBD logic all the process can be done only by the different blocks. For example: If we want
to multiply Sine and Cosine functions then we have to take two blocks of Sine and Cosine and then
we have provide their output to the input of multiplication block. So thats how we can do the
different functions.
In FBD for all the functions there are so many blocks from which we can do all the tasks easily and
can set the logics so much easily.
There are five types of logic instructions in FBD
1. Logic instructions- in which it interpret signal states of 1 & 0 and combine them according to
Boolean logic.
2. Compare instructions- in which it will compare two functions and give the according output
to the system.
3. Flip-flop instructions- in which we can check out the different logics.
4. Timer and counter instructions- in which we can set timing and counters by the different
timer and counter blocks.
5. Arithmetic instructions- in which we can add, multiply, subtract and divide the two values
directly come from the different processes.
3. Structured Text (SL)
Structured text is a high level language that is block structured and has syntax that resembles to the
syntax of the languages like Pascal, Basic and C. The language is composed of written statements
separated by semicolons. The statements use predefined statements and program subroutines to
change variables. The variables can be explicitly defined values, internally stored variables, or inputs
and outputs. Spaces can be used to separate statements and variables, although they are not often
necessary.
Structured text is not case sensitive, but it can be useful to make variables lower case, and make
statements upper case. Indenting and comments should also be used to increase readability and
documents the program.
ST programs allow named variables to be defined. Variable names must begin with a letter, but after
that they can include combinations of letters, numbers, and some symbols such as _. Variable
names are not case sensitive and can include any combination of upper and lower case letters.
Variable name must not have the same name as predefined functions, or user defined functions.
When defining variables one of the declarations shown below can be used:
DECLARATION
DESCRIPTION
VAR
The general variable declaration
VAR_INPUT
Defines a variable list for a function
VAR_OUTPUT
Defined output variable from a function
VAR_IN_OUT
defines variable that are both inputs and
outputs from a function

VAR_GLOBAL
RETAIN
CONSTANT
END_VAR

Global variable
Value is retained when the power is lost
a value that cannot be changed
marks the end of a variable declaration

Number types includes: Integers, Real numbers, Real with exponents, Binary numbers, Octal
numbers, Hexadecimal numbers & Boolean numbers. Almost all Mathematical, Logical and
Conditional operators used in C are available in ST also.
Control programs can become very large. When written in a single program these become confusing,
and hard to write/debug. The best way to avoid the endless main program is to use subroutines to
divide the main program. The IEC61131 standard allows the definition of subroutines/functions. The
function will accept up to three inputs and perform a simple calculation. It then returns only one
value.
4. Instruction List (IL)
Instruction List is a low level language and resembles assembly language of programming
controllers. It uses very simple instructions similar to the original mnemonic programming languages
developed for PLCs. It is the most fundamental level of programming language - all other
programming languages can be converted to IL programs. Most programmers do not use IL
programming on a daily basis, unless they are using hand held programmers.
Program control (control flow) is achieved by jump instructions, function calls and subroutines. A
rung of ladder logic contains four inputs, and one output. It can be expressed in a Boolean equation
using parentheses and in turn the Boolean equation can then be directly converted to instructions of
Instruction List.
The beginning of the program begins at the START: label. At this point the first value is loaded, and
the rest of the expression is broken up into small segments. The only significant change is that AND
NOT becomes AND.
All instructions are to be enclosed in a parenthesis. An important concept in this programming
language is the stack. The instruction values are pushed on the stack until the most deeply nested
term is found. The LD instruction pushes the first value on the stack. The end of a parenthesis sends
the stack downwards and the value of stack is incremented.
Allen Bradley and Siemens both have their own version of IL programming. Allen Bradley only
supports IL programming on the Micrologix 1000, and does not plan to support it in the future.
5. Sequential Function Chart (SFC)
All of the previous methods are well suited to processes that have a single state active at any one
time. This is adequate for simpler machines and processes, but more complex machines are designed
perform simultaneous operations. This requires a controller that is capable of concurrent processing this means more than one state will be active at any one time. This could be achieved with multiple
state diagrams, or with more mature techniques such as Sequential Function Charts.

Sequential Function Chart (SFC) is a graphical technique for writing concurrent control programs. It
can be used to program processes that can be split into steps.
Main components of SFC are:
Steps with associated actions
Transitions with associated logic conditions
Directed links between steps and transitions
Steps in an SFC diagram can be active or inactive. Actions are only executed for active steps. A step
can be active for one of two motives:
It is an initial step as specified by the programmer
It was activated during a scan cycle and not deactivated since
Steps are activated when all steps above it are active and the connecting transition (its associated
condition) is true. When a transition is passed, all steps above are deactivated at once and after all
steps below are activated at once. Actions associated with steps can be of several types, the most
relevant ones being Continuous (N), Set (S) and Reset (R). Apart from the obvious meaning of Set
and Reset, an N action ensures that its target variable is set to 1 as long as the step is active.
An SFC rule states that if two steps have an N action on the same target, the variable must never be
reset to 0. It is also possible to insert LD (Ladder Diagram) actions inside an SFC program.
SFC is an inherently parallel language in that multiple control flows can be active at once. Nonstandard extensions to the language include actions inside a program unit that influence the state of
another program unit. The most relevant such action is "forcing", in which a functional block can
decide the active steps of another functional block.
SFC diagrams can be converted to ladder logic using MCR blocks. The sequence of operations is
important when converting SFCs to ladder logic.

Assignment: Which programming languages are supported by the any one DCS available in the
market?

Вам также может понравиться