INTERPRETING SFC Summary Tasks After completing this lesson, you will be able to: Add SFC Elements Create Simultaneous Branch Create Selection Branch Rename Step Configure Ste
Trang 1INTERPRETING SFC
Summary Tasks
After completing this lesson, you will be able to:
Add SFC Elements
Create Simultaneous Branch
Create Selection Branch
Rename Step
Configure Step
Add Action
Rename Action
Configure Action
Configure The Execution of SFC
In this Lab Work, you will learn:
The different of Qualifier Type
How to make a simple Flip Flop Function using SFC
The different of Last Scan of Active Step
- Don’t Scan Option
- Programmatic Scan Option
- Automatic Scan Option
To add SFC elements, use the SFC toolbar
Trang 21 Open existing project, namely: BBFE_Training_Day2
Trang 32 Create a new routine in Main Program, namely: Qualifier Select type:
Sequential Function Chart
3 Double click Qualifier routine then SFC worksheet editor will appear By default, there will be Step_000 and Tran_000
4 Rename Step_000 by clicking button of the step
- Click Tag Tab
- Type the new name for the step: Start_Sequence
- Click Button
5 Enter a Bool expression in Tran_000 by double-click the text area of
the transition
- Type Bool expression: Start_Sequence.DN
- To close the text entry window, press [Ctrl] + [Enter]
6 On the SFC toolbar, click the Step button
- Drag the Step element to the required location on the SFC
Trang 4- To wire (connect) two elements together, click a pin on one of the elements and then click the pin on the other element A green dot shows a valid connection point
- Rename Step_001 as Store_Light0
- Assign Preset Time for Store_Light0 by click button
a Type the time for the step: 1000 milliseconds
b Click OK
7 Add an action of Store_Light0 Step by right click this step
- Change the qualifier of the Action_000 as following steps
a Click the button of the action
Trang 5b Choose qualifier as Stored (S)
c Click OK
- Program an Action by enter structured text
a Double click the text area of the action
b Type following structured text:
Light0 := 1;
c To close the text entry window, press [Ctrl] + [Enter]
8 Add Selection Branch by clicking button Then drag new branch to the desired location
- To wire the selection branch to the preceding step, click the bottom pin of the step and then click the horizontal line of the branch A green dot shows a valid connection point
- Enter a Bool expression in Tran_001 by double-click the text area of the transition Type : SW0
- Enter a Bool expression in Tran_002 by double-click the text area of the transition Type : NOT SW0
- Click button to add new Step
a Wire this step to transition: Tran_001
b Rename this step: Reset_Light0
c Add action for this step Change the qualifier as Reset (R) Change the name of this action to Action_000
by double click this action and select the drop down tag menu
Trang 6d Add another action, choose qualifier as Non-Stored
(N), type action: Light0 := 0;
- Click button to add new transition
a Enter bool expression: Reset_Light0.DN
b At the end of this section, you will have the following result:
- Click button to add another new Step
a Wire this step to transition: Tran_002
b Rename this step: Not_Reset_Light0
c Add action for this step Select the qualifier as Non-Stored (N) Type action: Light0 := 0;
- Click button to add another new transition
a Enter bool expression: Not_Reset_Light0.DN
b At the end of this section, you will have the following result
Trang 7- End Selection Branch
a Select the last transition of each path in the branch
Click the first transition (Tran_003) and then press
and hold [Shift] and click the rest of the transitions that
you want to select (Tran_004)
b On the SFC toolbar, click the button
9 Return to previous step
- Click the top pin of the step to which you want to go
(Start_Sequence) A green dot shows
- Then click the lower pin of the transition that signals the jump
Trang 810 In Main Routine add JSR (Jump to Sub Routine) ladder to call Qualifier Routine Add new tag SW_Qualifier that has same format with SW0
11 Save this SFC
EXERCISE
1 Download and go online to the project
2 Place processor in remote run mode
3 Toggle SW_Qualifier to bit = 1 Make sure other switches in MainRoutine
are switch off
4 Open Qualifier routine Notify the green color of each step The green color
of step means that the step is active What does step that always active during all scan?
_
What is qualifier for that action?
_
5 Monitor the SW0 Tag What is this tag value?
_
Trang 96 Monitor the Light0 Tag What is this tag value?
_
7 Toggle SW0 Tag to 1
8 Monitor the Light0 Tag What is this tag value?
_
9 Give your conclusion from this exercise!
Differences between Ladder and SFC
In this exercise you will see the difference between how to program using SFC and ladder
The following figure so ladder diagram
Trang 10EXERCISE
1 Open project: SFC_Ladder from your hard drive
2 Download and go online the project to controller
3 Place processor in remote run mode
4 Double click SFC routine in Main routine You will have following figure
This following figure has the same logic with previous ladder diagram figure
Trang 115 Interpret the instruction in the program file by answering the following question:
A Go to Controller Tags for monitoring tags
B Close SW0 (by Toggle this tag to bit = 1) When SW0 is closed, which light(s) turn on?
C Open SW0 (by Toggle this tag to bit = 0) When SW0 is open, what happen to Light1 and Light2?
D Close SW1 What happen to Light3?
Trang 12
Simple Flip Flop
In this exercise you will learn how to make a simple flip flop using SFC
1 Open existing project, namely: BBFE_Training_Day2
2 Create a new routine in Main Program, namely: Flip_Flop Select type:
Sequential Function Chart
3 Double click Flip_Flop routine then SFC worksheet editor will appear By default, there will be Step_000 and Tran_005
4 Rename Step_000 to : Lamp_A
- Add action of Lamp_A step Rename this action to: Lamp_A_ON
Select qualifier as Non-Store (N) Type the following structured
text for this action: Light1 := 1;
- Add another action of Lamp_A step Rename this action to:
Lamp_A_OFF Select qualifier as PO (Pulse Falling Edge) Type the following structured text: Light1 := 0;
- At this section you will have following SFC:
Trang 135 Enter a Bool expression in Tran_005 by double-click the text area of the transition Type Bool expression: Lamp_A.T > 1500 At this section you
will have following SFC
6 Repeat some previous sections until you have following SFC
Trang 149 Place processor in remote run mode
10 Toggle SW_Flip_Flop to bit = 1 Make sure other switches in MainRoutine
are switch off
11 Monitor the Tags value of Light1, Light2 and Light3 from Controller Tags
What is your value of these tags?
12 Check that your program is running correctly
Trang 15Difference between Automatic Scan, Programmatic Scan and
Don’t Scan Option
In this exercise you will learn the difference between Automatic Scan, Programmatic Scan and Don’t Scan option of Last Scan of Active Steps
Exercise of Don’t Scan Option
1 Open project: FLIP_FLOP_SFC from your hard drive
2 Open Controller properties by click button as shown on following figure:
3 Select SFC Execution tab and choose Last Scan of Active Steps: Don’t
Scan
4 Click OK
5 Download and go online the project to controller
6 Place processor in remote run mode
Click this button
Trang 169 Open MainRoutine Toggle Switch_1 again (Set Switch_1 bit to 0) Then toggle Switch_2 (Set Switch_2 bit to 1)
10 Monitor tags of Lamp1, Lamp2 and Lamp3 What is the value of each
these tags?
11 Open MainRoutine Toggle Switch_2 again (Set Switch_2 bit to 0) Then toggle Switch_3 (Set Switch_3 bit to 1)
12 Monitor tags of Lamp1, Lamp2 and Lamp3 What is the value of each
these tags?
Exercise of Programmatic Scan Option
Trang 171 Open Controller properties
2 Select SFC Execution tab and choose Last Scan of Active Steps:
Programmatic Scan
3 Click OK
4 Download and go online the project to controller
5 Place processor in remote run mode
6 Open MainRoutine Toggle Switch_1 (Set Switch_1 bit to 1)
7 Monitor tags of Lamp1, Lamp2 and Lamp3 What is the value of each
these tags?
8 Open MainRoutine Toggle Switch_1 again (Set Switch_1 bit to 0) Then toggle Switch_2 (Set Switch_2 bit to 1)
9 Monitor tags of Lamp1, Lamp2 and Lamp3 What is the value of each
these tags?
Trang 18
these tags?
Exercise of Automatic Scan Option
1 Open Controller properties
2 Select SFC Execution tab and choose Last Scan of Active Steps:
Automatic Scan
3 Click OK
4 Download and go online the project to controller
5 Place processor in remote run mode
6 Open MainRoutine Toggle Switch_1 (Set Switch_1 bit to 1)
7 Monitor tags of Lamp1, Lamp2 and Lamp3 What is the value of each
these tags?
8 Open MainRoutine Toggle Switch_1 again (Set Switch_1 bit to 0) Then toggle Switch_2 (Set Switch_2 bit to 1)
Trang 199 Monitor tags of Lamp1, Lamp2 and Lamp3 What is the value of each
these tags?
10 Open MainRoutine Toggle Switch_2 again (Set Switch_2 bit to 0) Then toggle Switch_3 (Set Switch_3 bit to 1)
11 Monitor tags of Lamp1, Lamp2 and Lamp3 What is the value of each
these tags?
12 Give your conclusion from this exercise