0
1
00:00:21,520 --> 00:00:22,100
Hello.
1

2
00:00:22,140 --> 00:00:26,910
In this video we are going to learn the importance of scanning order in plc programs.
2

3
00:00:26,910 --> 00:00:28,290
Sample application.
3

4
00:00:28,290 --> 00:00:32,630
The conveyor will move with the start signal but with the stop signal.
4

5
00:00:32,640 --> 00:00:36,000
conveyor movement will be stopped at any time.
5

6
00:00:36,000 --> 00:00:42,210
The number of boxes passing over the belt with the sensor on the converter will be counted when the number
6

7
00:00:42,210 --> 00:00:43,800
of boxes reaches 10.
7

8
00:00:43,800 --> 00:00:45,460
This is an example number.
8

9
00:00:45,630 --> 00:00:50,340
The conveyor will stop and the counter value will be reset for the next count.
9

10
00:00:50,370 --> 00:00:56,580
The above mentioned process will repeat periodically with each start signal.
10

11
00:00:56,580 --> 00:01:01,860
This is the condition , write the plc program according to the above scenario and the test operation
11

12
00:01:01,860 --> 00:01:04,190
in simulator mode.
12

13
00:01:04,200 --> 00:01:08,450
This is the first example solution.
13

14
00:01:08,580 --> 00:01:13,640
And just for this page just you need to know this.
14

15
00:01:13,680 --> 00:01:20,220
Imagine we are using reset command at the third line in here.
15

16
00:01:20,220 --> 00:01:26,680
Here the second example of solution and in here you need to reset command.
16

17
00:01:26,700 --> 00:01:29,190
What happens if we use it in the second line.
17

18
00:01:29,490 --> 00:01:35,070
So let's go to a ISPSoft and let's create a new project and let's take a look.
18

19
00:01:35,070 --> 00:01:35,850
What will happen
19

20
00:01:41,270 --> 00:01:46,580
program section and the new program and say okay a new project.
20

21
00:01:46,580 --> 00:01:58,840
Pages opened I will use m internal relays for example X0 will be m0, X1 will be M1 and X2
21

22
00:01:58,900 --> 00:02:06,010
will be m2 , because of simulator can not detect physical input sometimes.
22

23
00:02:06,010 --> 00:02:14,800
Already we know in here we have set MPU X on and off ,so we can adopt/monitor our physical input on and
23

24
00:02:14,800 --> 00:02:18,580
off but I will use m internal relays.
24

25
00:02:18,640 --> 00:02:22,760
So let us start to write code.
25

26
00:02:23,560 --> 00:02:33,570
LD M0 and LDI  M1 and LDI C0
26

27
00:02:33,570 --> 00:02:36,270
and out Y0.
27

28
00:02:36,270 --> 00:02:46,800
I will put OR contact then I will latch output like this and one more network the first showing our example
28

29
00:02:47,160 --> 00:03:00,000
I will use it LD M2 and  LD Y0 and CNT C0 3 and I will say just 3 is enough for a moment
29

30
00:03:00,090 --> 00:03:03,280
not 10 in here.
30

31
00:03:03,450 --> 00:03:07,740
LD C0 and reset
31

32
00:03:11,160 --> 00:03:15,850
like this and let's send this project to plc.
32

33
00:03:19,830 --> 00:03:22,620
I will use simulator for a moment.
33

34
00:03:22,620 --> 00:03:29,400
So it is writing this project to the simulator now and simulated a stop situation.
34

35
00:03:29,460 --> 00:03:32,200
I will say run Plc , also confirm.
35

36
00:03:32,220 --> 00:03:35,430
So now we are at run situation.
36

37
00:03:35,430 --> 00:03:45,000
So start signals came and somebody released start button of conveyor and it is turning forward and the sensor
37

38
00:03:45,030 --> 00:03:55,840
detected boxes and counter value is one and the second one and the third one.
38

39
00:03:55,840 --> 00:04:13,200
So what will happen now counter is resetted in here and because of this C0 is didn't lose condition
39

40
00:04:13,740 --> 00:04:16,290
and the latched is not broken.
40

41
00:04:16,560 --> 00:04:25,080
So conveyor is still turning forward and the counter is resetted and we don't need to press the start button
41

42
00:04:25,440 --> 00:04:26,700
anymore, 
42

43
00:04:27,030 --> 00:04:27,840
Again I will show you.
43

44
00:04:27,840 --> 00:04:36,290
Set on set off and set on and set off and set on and set off.
44

45
00:04:36,450 --> 00:04:46,470
Still our conveyor is turning forward and forward because when the counter is get to reach three I mean
45

46
00:04:46,470 --> 00:04:48,790
counter goes from off to on.
46

47
00:04:49,020 --> 00:04:55,530
Then suddenly in the next network it is resetting so it's going to beginning position and everything
47

48
00:04:55,530 --> 00:05:02,240
is continue and the counter is already resetted at the second line or second network.
48

49
00:05:02,490 --> 00:05:11,390
So what will happen if I change this network two to network three, I will go off line and I will delete
49

50
00:05:11,510 --> 00:05:27,050
this line and I will edit to here , LD C0 and reset C0 and I will do a download again and it
50

51
00:05:27,050 --> 00:05:28,310
is transferring now
51

52
00:05:34,480 --> 00:05:38,570
object code is sended and I will say yes.
52

53
00:05:38,800 --> 00:05:39,760
Now we are ready.
53

54
00:05:39,850 --> 00:05:45,100
I will go online to my simulator and I will give a start to my conveyor.
54

55
00:05:45,190 --> 00:05:54,130
Now it started and released start button and now conveyor is turning forward and sensor is detected a
55

56
00:05:54,130 --> 00:05:59,340
box and counter value is 1 and counter value will be 2.
56

57
00:05:59,980 --> 00:06:05,280
And what will happen if counter detected or sensor is detected.
57

58
00:06:05,280 --> 00:06:11,620
The third box let's see set on you see when counter-revolution.
58

59
00:06:11,680 --> 00:06:21,730
It equals to tree it will go to up and that moment because of C0 counter zero goes from off to on
59

60
00:06:22,030 --> 00:06:24,430
this contact goes off.
60

61
00:06:24,730 --> 00:06:26,710
Because of this is normally close contact.
61

62
00:06:26,950 --> 00:06:31,210
So the latched is from here is broken.
62

63
00:06:31,210 --> 00:06:43,650
The line broken or it didn't float continuously because of this , this line is now output our conveyor is 
63

64
00:06:43,640 --> 00:06:44,380
stopped.
64

65
00:06:44,460 --> 00:06:53,280
And then suddenly we goes to network 2, in the network 2 it was 3 ,but suddenly it resetted and
65

66
00:06:53,280 --> 00:06:54,720
it goes to zero.
66

67
00:06:55,080 --> 00:06:57,430
So what will happen now.
67

68
00:06:57,480 --> 00:07:07,320
Somebody needs to press Start button again and stopped , started and somebody released his hand from the
68

69
00:07:07,320 --> 00:07:08,010
start button.
69

70
00:07:08,010 --> 00:07:13,690
Now conveyor turning again and again and sensor detect box , 
70

71
00:07:13,860 --> 00:07:16,410
And the second box it's detected.
71

72
00:07:16,410 --> 00:07:22,740
And the third box detected and suddenly we have no output and conveyor is stopped.
72

73
00:07:22,950 --> 00:07:32,910
So according to our scenario this will repeat periodically with the each start signal so we can say
73

74
00:07:33,360 --> 00:07:34,650
this is the correct one.
74

75
00:07:34,980 --> 00:07:44,700
So the importance of the scanning if you put your reset after counter and if you put your reset before
75

76
00:07:44,700 --> 00:07:46,560
counter what's changing.
76

77
00:07:46,560 --> 00:07:52,740
One time the conveyor stopping , another time continuously conveyor turning.
77

78
00:07:52,830 --> 00:07:54,890
This is really important.
78

79
00:07:55,020 --> 00:07:59,670
Just one network a above or just one network is lower.
79

80
00:07:59,670 --> 00:08:01,550
Everything can be change.
80

81
00:08:01,560 --> 00:08:07,590
So while you are writing plc code code as ladder logic inside of the Delta plc or another one plc
81

82
00:08:07,590 --> 00:08:15,760
you must be careful about the scanning order that all saw in this video.
82

83
00:08:15,810 --> 00:08:16,920
I am finished here.
83

84
00:08:16,920 --> 00:08:18,300
See you in the next video.
