Right Click on main program and choose New Routine 2.. Write New Routine name and choose Function Block Diagram for its type 3.. Right Click on Program Tags and choose New Tag 2.. FUNC
Trang 1DAY 3
SESSION 2
FUNCTION BLOCK DIAGRAM (FBD)
PROGRAMMING I
Trang 2ADD PFD ROUTINE
1 Right Click on main
program and choose New
Routine
2 Write New Routine name and choose
Function Block Diagram
for its type
3 Open the new routine
Trang 3CREATE TAGS
1 Right Click on Program
Tags and choose New
Tag
2 Write a name, select
data type, scope, and
style for the tag
Trang 4ADD A SHEET IN ROUTINE
1 Click the icon
2 Type a sheet description
Trang 5FUNCTION BLOCK DATA FLOWS
Trang 6FUNCTION BLOCK ELEMENT
Trang 7LATCHING DATA
=
The Input Reference value does not change until the next scan execution of the routine
Trang 8FUNCTION BLOCK INSTRUCTION
Trang 9ADD INSTRUCTION TO SHEET
3 Drop
1 Select
2 Drag
Trang 100 DN 0
CONNECT ELEMENT(1)
1 Click button to show the block properties
2 Check to show the pin, and Uncheck to hide the pin
Trang 11EXAMPLE OF SHOWING A PIN
InRawMax InRawMin InEUMax InEUMin Limiting
Out
0.0 MaxAlarm
0 MinAlarm
0
I for Input
O for Output
Check the Vis Pin
Check the Vis Pin
Trang 120 DN 0
CONNECT ELEMENT(1)
1 Click button to show the block properties
2 Check to show the pin, and Uncheck to hide the pin
Trang 13CONNECT ELEMENT(2)
2 Wire Element Together
A B
• Click Output pin of the First element (A)
• Then Click input pin of the other element (B)
• Green Dots show a valid connection point
Green Dots
Trang 140 DN 0
ACC
0 DN 0
Resolve a loop
If a group of blocks are in a loop, the controller cannot determine which block to execute first In other words, it cannot resolve the loop.
LOOP ERROR
Trang 15ASSUME DATA AVAILABLE
To define a wire as an input, right-click the wire and choose
Assume Data Available.
T ONR_03
T ONR
T imer On Delay with Reset
T imerEnable PRE
Reset
ACC 0 DN 0
Reset
ACC 0 DN 0
This input pin uses the output that block 2 produced on the
previous scan.
Trang 162 Program Tag Window
Shown
3 Right Click on the tag,
choose Toggle bit
Trang 170 LAlarm
0 LLAlarm
0 ROCPosAlarm
0 ROCNegAlarm
0
Window
Trang 18FUNCTION BLOCK
INSTRUCTION
Trang 19A IO REFERENCE & IO WIRING
Trang 20HHLimit HLimit LLimit LLLimit Deadband
HHAlarm
0 HAlarm
0 LAlarm 0LLAlarm
0 ROCPosAlarm
0 ROCNegAlarm
Trang 21InRawMax InRawMin InEUMax InEUMin Limiting
Out
0.0
B PROCESS INSTRUCTION (2)
2 SCL
Device Tagname (Raw
Data) Device Tagname
(Scale Data)
If set, Output is limited to between InEUMin and InEUMax.
Trang 22In2 SelectorIn
Out
0.0
If SelectorIn is set Output = In2
If SelectorIn is clear Output = In1
Input1 Input2 Selector
Trang 23D BIT INSTRUCTION
1 OSRI (One Shot Rise with Input)
2 OSFI (One Shot Falling with Input)
Trang 24ACC 0DN
0
HORN PULSE1_ALARM 0
Trang 25CDEnable PRE Reset
ACC
Trang 26F COMPARE INSTRUCTION
4 GRT (Greater Than or Equal to)
PT001 0PT002
Trang 270.0
RESULT_INT SOURCE_1
0
SOURCE_2
0
Trang 28H MOVE/LOGICAL INSTRUCTION
(1)
1 BAND (Boolean And)
Out = In1 AND In2 AND In3 AND In4
In2 In3 In4
Out
0
Trang 29H MOVE/LOGICAL INSTRUCTION
(2)
2 BOR (Boolean Or)
3 BNOT (Boolean Not)
Out = In1 Or In2 Or In3 Or In4 Or In5 Or In6 Or
Trang 31H MOVE/LOGICAL INSTRUCTION
(4)
5 DFF(D Flip Flop)
When Clock goes from cleared to set, the DFF instruction sets
Q = D When Clear is set, Q is cleared
Clear Clock
Q 0 QNot
0
Clock Clear D
Trang 32H MOVE/LOGICAL INSTRUCTION
(5)
6 SETD (Set Dominant)
When Set is set, Out is set When Reset is set and Set is cleared, Out is cleared Set has precedence over Reset
BOOLEAN_1 0BOOLEAN_2
0
SET D_01
SETD
Set Dominant Set
Reset
Out
0 OutNot
0
RESULT_BOOL
Set Reset Out
Trang 33SESSION 3
FUNCTION BLOCK DIAGRAM (FBD)
PROGRAMMING II