0
1
00:00:21,700 --> 00:00:23,030
Hello in this video.
1

2
00:00:23,050 --> 00:00:26,350
We are going to learn serial communication plc programming.
2

3
00:00:26,380 --> 00:00:34,550
Example 2 in here we are writing hexadecimal86 value in D1120.
3

4
00:00:34,600 --> 00:00:38,090
So this is for communication protocol settings.
4

5
00:00:38,110 --> 00:00:39,440
And this is ASCII.
5

6
00:00:39,460 --> 00:00:46,720
9600 7 E 1  communication protocol settings set M1120
6

7
00:00:46,720 --> 00:00:54,790
equals to retain communication settings for COM2 for our Plc and we are resetting
7

8
00:00:54,790 --> 00:01:01,510
M1143 because we will use ASCII mode if we set this value this
8

9
00:01:01,840 --> 00:01:11,800
auxiliary relay bit so the communication protocol turns to RTU mode we are writing 300 decimal value
9

10
00:01:11,830 --> 00:01:19,870
to D1129 so D1129 equals to set
10

11
00:01:19,870 --> 00:01:28,420
value for data receive a receiving timeout as milliseconds it is equals to 300 millisecond our data
11

12
00:01:28,480 --> 00:01:34,880
receiving timeout value set value and D1129.
12

13
00:01:34,960 --> 00:01:45,130
So this data Register includes our plc communication address so we selected in here 17 for example
13

14
00:01:45,130 --> 00:01:49,660
for Plc communication address via com 2.
14

15
00:01:50,110 --> 00:02:00,460
So in here we are enabling M1350 and m1351 so link communication
15

16
00:02:00,490 --> 00:02:02,370
activates these ones.
16

17
00:02:02,530 --> 00:02:14,710
So why we are using timer99 and why we are waiting 3 second because after your complete system
17

18
00:02:14,740 --> 00:02:22,180
is energized or energization and the drives will be opened and the plc is going to be open but that
18

19
00:02:22,180 --> 00:02:27,560
moment for the communication complete system will be ready will be okay.
19

20
00:02:27,610 --> 00:02:35,840
So after first energy is activated drives and the plc and the other external devices and etc
20

21
00:02:35,840 --> 00:02:41,100
of which devices are added to the serial communication line should be ready.
21

22
00:02:41,200 --> 00:02:48,580
And this 3 seconds is waiting time of whole systems becomes okay or ready.
22

23
00:02:48,880 --> 00:02:57,280
So we will wait just a little bit time and the whole devices become ready after it became ready
23

24
00:02:57,310 --> 00:03:01,540
complete system we can start our communication.
24

25
00:03:01,540 --> 00:03:10,780
So because of this we are using timer99 as 3 second and after 3 seconds we are setting M1350 and
25

26
00:03:10,780 --> 00:03:13,460
M1351
26

27
00:03:13,540 --> 00:03:21,100
So enabling PLC LİNK  and then enabling auto mode and in here in the first scan we are writing
27

28
00:03:21,520 --> 00:03:29,340
as hexadecimal 1000 address to D1355
28

29
00:03:29,740 --> 00:03:36,370
We are moving this address to here because we will read from this address how many data we are going
29

30
00:03:36,370 --> 00:03:39,100
to read 16 data we are going to read.
30

31
00:03:39,130 --> 00:03:49,980
So this number of read data is here we are going to read first station and this first station reading
31

32
00:03:49,980 --> 00:03:53,100
address is D1355
32

33
00:03:53,220 --> 00:03:58,920
And how many that are we are going to read the value inside of D1434
33

34
00:03:58,920 --> 00:03:59,490
d1434
34

35
00:03:59,790 --> 00:04:02,690
And always we are moving.
35

36
00:04:02,700 --> 00:04:07,280
BLOCK Moving the datas reading datas
36

37
00:04:07,380 --> 00:04:14,410
And these are all stored in D1480 to -> D0.
37

38
00:04:14,670 --> 00:04:19,710
And how many data are we are moving always or block moving sixteen data.
38

39
00:04:19,890 --> 00:04:27,690
So inside of the D1480  data will be moved to D0 , d1481
39

40
00:04:27,690 --> 00:04:34,860
will be in D1 D1482 will be in D2
40

41
00:04:35,010 --> 00:04:38,150
and also we gonna write some data.
41

42
00:04:38,370 --> 00:04:47,720
So in the first scan we are moving hexadecimal 2000 address  inside of inside  to D 1415.
42

43
00:04:47,970 --> 00:04:54,330
So where we can get for the first station writing addresses here D1415
43

44
00:04:54,330 --> 00:04:56,560
it was like that always.
44

45
00:04:56,670 --> 00:04:58,360
Same never change.
45

46
00:04:58,380 --> 00:05:05,520
So how many data are we are going to write 16 that we are going to write so we are informing to our
46

47
00:05:05,600 --> 00:05:14,010
also our master plc we gonna write 16 that are so you can read it inside of the D1450 in here.
47

48
00:05:14,010 --> 00:05:20,560
So we are always block moving or moving the data.
48

49
00:05:21,090 --> 00:05:23,000
So these are all users data.
49

50
00:05:23,010 --> 00:05:29,520
So we will  write some datas from PLC to slave devices.
50

51
00:05:29,520 --> 00:05:34,390
So imagine you selected d100 from D100.
51

52
00:05:34,500 --> 00:05:44,020
16 data will be written into D1496 to d1511
52

53
00:05:44,020 --> 00:05:52,070
if you put inside of the d100=1 , D1496 will be 1
53

54
00:05:53,020 --> 00:05:59,860
D101 = 10  let's say like this D1497=10
54

55
00:05:59,860 --> 00:06:09,160
also sequential sixteen data we can read and write but I'm not offering these because imagine
55

56
00:06:09,190 --> 00:06:17,390
we are working with the ten slave so it will be 160 data you are going to write and 160
56

57
00:06:17,500 --> 00:06:23,470
that you are going to read so it will take a lot time it will a little bit slow down your communication
57

58
00:06:23,830 --> 00:06:32,470
so what you really need to read or what you really need to write so you can just use as much as possible
58

59
00:06:32,860 --> 00:06:40,450
lower numbers data for example if you need just to write the frequency and the run and forward or
59

60
00:06:40,450 --> 00:06:41,460
stop commands.
60

61
00:06:41,620 --> 00:06:48,220
Just use two or three words or if you just need to read from your device just a current for example
61

62
00:06:48,490 --> 00:06:51,820
just use one word to read for example.
62

63
00:06:51,820 --> 00:06:58,100
So these are all according to your projects according to your system.
63

64
00:06:58,150 --> 00:07:01,330
So this is just an example.
64

65
00:07:01,330 --> 00:07:03,580
How can we use this communication.
65

66
00:07:03,670 --> 00:07:07,660
How can we use modbus communication to write or read.
66

67
00:07:07,790 --> 00:07:09,750
datas from slave or two slave etc.
67

68
00:07:09,920 --> 00:07:13,580
So in here I am finished for this video
68

69
00:07:13,600 --> 00:07:15,130
See you in the next video.
