AB CONTROLLOGIX – SYSTEM OPERATION AND PROGRAMMING COURSE
INTERPRETING FUNCTION BLOCK
DIAGRAM
Summary Tasks
After completing this lesson you will able to:
Interpret the Data Flow of Function Block
Create BIT Instruction with Function Block
Create Timer and Counter with Function Block
Solve the basic problem (Exercise)
Section 1: FBD Data Flow
Lab Works Function Block Diagram
1
AB CONTROLLOGIX – SYSTEM OPERATION AND PROGRAMMING COURSE
1.1 Each Output tag must use only one Output Reference
1.1.A Create Routine
1.1.B Create Tag
Lab Works Function Block Diagram
2
AB CONTROLLOGIX – SYSTEM OPERATION AND PROGRAMMING COURSE
Add These 8 more Tags:
No
Name
Data Type
Style
1
Switch_1
BOOL
Binary
2
Switch_2
BOOL
Binary
3
Switch_3
BOOL
Binary
4
Result_Switch_1
BOOL
Binary
5
Result_Switch_2
BOOL
Binary
6
Analog_Value_1
DINT
Decimal
7
Analog_Value_2
DINT
Decimal
8
Analog_Value_3
DINT
Decimal
1.1.C Create Jump To Subroutine in MainRoutine
Lab Works Function Block Diagram
3
AB CONTROLLOGIX – SYSTEM OPERATION AND PROGRAMMING COURSE
1.1.D Create Instruction example 1
Drag and drop from Instruction Bar
and Create This:
OSRI_01
OSRI
...
One Shot Rising with Input
2#0000_0000
Switch_0
0
InputBit
OutputBit
Result_Switch_1
Instruction example 1
1.1.E Verify Controller
And show error window
IF error is not occur, it means that BFD is correct:
1.1.F Create Instruction example 2 and Verify Controller
Lab Works Function Block Diagram
4
AB CONTROLLOGIX – SYSTEM OPERATION AND PROGRAMMING COURSE
ADD_01
ADD
...
Add
0
0.0
Analog_Value_1
SourceA
Dest
Analog_Value_3
SourceB
0
Analog_Value_2
EQU_01
EQU
...
Equal
0
0
Analog_Value_1
SourceA
Dest
Switch_0
SourceB
10
10
Instruction example 2
The Error Window should be:
1.1.G Create Instruction example 3 and verify controller
ADD_01
ADD
...
Add
0
Analog_Value_1
0.0
SourceA
Dest
Analog_Value_3
SourceB
0
Analog_Value_2
SEL_02
SEL
...
Select
0
Analog_Value_1
0.0
In1
Out
Analog_Value_3
In2
0
Analog_Value_2
SelectorIn
2#0000_0000
Switch_0
Instruction example 3
The error window will show
Lab Works Function Block Diagram
5
AB CONTROLLOGIX – SYSTEM OPERATION AND PROGRAMMING COURSE
This is because the FBD not allow the instruction to have two or more Output
reference with same Tag.
The FBD Data flows from output block to the next wired input
block.
1.2 Latching Data
1.2.A Create Instruction example 4 and verify controller
Instruction example 4
1.2.B Download to the controller
Before Download to the controller, make sure that the controller path and controller
slot (in the controller properties) is true.
Lab Works Function Block Diagram
6
AB CONTROLLOGIX – SYSTEM OPERATION AND PROGRAMMING COURSE
1.2.C Run Controller
Watch that the Analog_Value_1, both in input reference and in output
reference have the same value.
The FBD Latch the data until next scan execute.
1.3 Assume Data Available
1.3.A Create Instruction example 5 and verify controller
ADD_01
ADD
...
Add
1
0.0
1
SourceA
Dest
Analog_Value_1
SourceB
0
Analog_Value_1
ADD_02
ADD
...
Add
1
1
0.0
SourceA
Dest
Analog_Value_2
SourceB
Instruction example 5
1.3.B Download to the controller and then run processor
Lab Works Function Block Diagram
7
AB CONTROLLOGIX – SYSTEM OPERATION AND PROGRAMMING COURSE
Two instructions give the same mean. The assume data available uses an
output that the block produced on the previous scan. Or in other word we can
create delay with this.
1.3.C Create Instruction example 6 and verify controller
ADD_01
ADD
MUL_01
MUL
...
Add
Multiply
1
1
...
0.0
SourceA
0.0
Dest
SourceA
SourceB
Dest
Analog_Value_2
SourceB
1
1
1.3.D Download to controller and then run
The Assume data available use above is to produce a one scan delay
between blocks.
Lab Works Function Block Diagram
8
AB CONTROLLOGIX – SYSTEM OPERATION AND PROGRAMMING COURSE
The assume data available can create delay between block
1.2 Exercise 1, BIT Instruction
1.2.A Create Tag
Create this tag
No
Tag
Alias
Data Type
Style
1
Light_0
Local:3:O.Data.0(C) BOOL
Binary
1
Light_1
Local:3:O.Data.1(C) BOOL
Binary
1
Light_2
Local:3:O.Data.2(C) BOOL
Binary
1
Light_3
Local:3:O.Data.3(C) BOOL
Binary
1.2.B Create Exercise BIT Instruction, and verify controller
2#0000_0000
Switch_0
Light_0
2#0000_0000
Light_0
Light_1
BNOT_02
BNOT
...
Boolean Not
2#0000_0000
Switch_1
1
In
Out
Light_2
OSRI_04
OSRI
...
RESD_02
One Shot Rising with Input
2#0000_0000
Switch_2
0
InputBit
RESD
...
OutputBit
Reset Dominant
0
Set
Out
OSRI_06
OSRI
Light_3
1
Reset
OutNot
...
One Shot Rising with Input
2#0000_0000
Switch_3
0
InputBit
OutputBit
When Create Instruction, make sure the tag you use is the same like the tag
you create.
1.2.C Download to the controller and then run processor
1.2.D Monitor the value
Monitor from the sheet:
Lab Works Function Block Diagram
9
AB CONTROLLOGIX – SYSTEM OPERATION AND PROGRAMMING COURSE
2#0000_0000
Switch_0
Light_0
2#0000_0000
Light_0
Light_1
BNOT_02
BNOT
...
Boolean Not
2#0000_0000
Switch_1
1
In
Out
Light_2
OSRI_04
OSRI
...
RESD_02
One Shot Rising with Input
2#0000_0000
Switch_2
0
InputBit
RESD
...
OutputBit
Reset Dominant
0
Set
Out
OSRI_06
OSRI
Light_3
1
Reset
OutNot
...
One Shot Rising with Input
2#0000_0000
Switch_3
0
InputBit
OutputBit
From Program Tag Display:
1.2.E Toggle the switch
Lab Works Function Block Diagram
10
AB CONTROLLOGIX – SYSTEM OPERATION AND PROGRAMMING COURSE
1.2.E Answer following question:
A. Close Switch_0 (By toggle the Tag), When Switch_0 is Close (Bit = 1), which
Tag/Light(s) is turn on?
B. Open Switch_0. When Switch_0 is Open what happen to Light_0 and
Light_1?
C. Close Switch_1. What happens to the Light_2?
D. Open Switch_1. What happens?
E. Close Switch_2. What happens?
F. Open Switch_2. What happens?
G. What must you do to turn the Light_3 off?
H. What happens if we close Switch_2 and Switch_3 (Correspond to Light_3)?
Lab Works Function Block Diagram
11
AB CONTROLLOGIX – SYSTEM OPERATION AND PROGRAMMING COURSE
1.3 Exercise 2, Timer/Counter Instruction
1.3.A Open Routine: FBD_OPEN_PROJECT_1
TONR_05
TONR
1
...
CTUD_01
Timer On Delay with Reset
1
T imerEnable
CTUD
0
Count Up/Down
...
ACC
2000
2000
0
PRE
DN
0
Reset
CUEnable
ACC
CDEnable
DN
0
PRE
3
3
Reset
EQU_01
EQU
...
Equal
0
SourceA
Dest
Light_0
0
0
SourceB
EQU_02
EQU
...
Equal
0
SourceA
Dest
Light_1
1
1
SourceB
EQU_03
EQU
...
Equal
0
SourceA
Dest
Light_2
2
2
SourceB
1.3.B Download to the processor, and then run controller
1.3.C Answer following question:
A. Which Block Instruction generates a pulse output?
B. What is the pulse wave function?
C. Describe what is the purpose of that process?
Lab Works Function Block Diagram
12