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