Hello. 1
In this video we are going to learn WSFR or WSFL shifting data instruction in the previous educations 2
we learned SFTR we shifted bits but these instructions is going to help us to shift datas 3
WSFR means right and WSFL left. 4
You already learned it. 5
It is s means initial device which value is shifted an initial device in which value is shifted. 6
Also D and N1 ,it is still remember it ,length is really important. 7
We worked with D4 in SFTR command but in here N1 is still same and N2 is number 8
of bits forming a group. 9
So. 10
R means It is going to shift from left to right L means. 11
It is going to shift from left to right. 12
That's all. 13
--- 14
Right to Left from left to right. 15
And I said wrongly R means we will shift to the right side and L means we will shift to the left side. 16
So that moment we are starting from the right to the left. 17
So in the ISPsoft I will create similar very basic example for you and you will understand how can we 18
use WSFR command or WSFRP - P means pulse contact. 19
Again I am telling that I will use in this project pulse contact. 20
Let's create a new project and program 0 is creating now in. 21
In this project I will use again LD ex. x0.5 22
This is because as series CPU types and WSFRP 23
This is our instruction and this moment I will add here x0.6 24
And now remember we used the rising edge in SFTR command but this moment we are not 25
using rising edge for the x0.5 because we use pulse contact in here. 26
And how many data that w are going to shift in this project or in this example. 27
I will say 5 and each time how many data is going to shift one by one. 28
So this is one. 29
So we will read the results from that let's say D20. 30
That's all. 31
And now we can send this project to simulator. 32
but now X0.6 data type is doesn't match up because now I made a mistake because 33
now what we are doing data shifting we are shifting data so x.6(bool) 34
Bu this is not a data. 35
This is not a word. 36
So we need to put here word value so we will read word values from d0. 37
Let's say like this I will go to my slide and I will say to for example the line is moving forward and 38
we have here boxes. 39
Then we have a value of these boxes but which value we are getting. 40
For example weight value from these boxes in here from the Loadcell so and than according to weight 41
we are shifting or we are separating these boxes to the right or left or front and etc. 42
This is according to your mechanical system and then we need to get these weights from here and we need 43
to send it to here immediately. 44
So this is our project structure or this is our examples structure. 45
I will compile this project. 46
Now we are okay and done. 47
I will go online to plc and I want to do a download this project say transfer now it's transferring 48
and I want to go back to running state. 49
Now we are okay so we will shift five data and we will read these five data from starting from D20 50
till D25 and then let's change it D0 will be 5 and I will increase it one by one and force it 51
on and force and off and the next one should be six and set on or force on and off next one will be 52
seven. 53
And again four set on set off. 54
This was 3. and this will be fourth one and set on and off and this will be fifth one. 55
And this is the end and set on set off. 56
Now go to the device monitor table and add here left click. 57
It is starting from D20. 58
Just five value so you can see it in here. 59
D20 is now five and d 21 is six. 60
D22 is 7 and 8 and 9. 61
What happened. 62
We shifted five data five word data to from. 63
from left to right. 64
So what happened. 65
We started with five and we ended with the nine so completely it is shifted correctly. 66
And if I go to my program area and if I say again set on and fourth set of what happened now it has 67
shifted it was 9 device monitor table it is still trying to shift with the 5 and 5 it is writed 68
immediately to D24 why because we are just working with the 5 data 69
The length is 5 because of this it is running with the D 20 till D25 so the 24 is the last one. 70
So it is writing to first D24 and d 23 so I can just write here to understand D24 and then it is writing 71
D 23 22 21 and 20 and that moment this is the fourth one and then again it is going to be equal to 72
my line because the first value was in the D24 and the second value is activated or second time it 73
is activated and first value was in the D 23 and the third time we activated the first value is now 74
twenty two and the fourth time in the D 21 and the fifth time we activated x0.5 and 75
that moment first value is came to D20 it is working like this and it is wsfr command if you 76
delete p - pulse contact from here for example like this you need put here rising edge like this 77
So this is how wsfr command is working or how we are shifting the datas or it is coming from the 78
loadcell or coming from your recipes or something like this and you can shift them all with the just 79
with one contact with according to your parameters from here what was it. 80
It is where we are reading from the values and how many data the length of the data and how many 81
we are going to shift each time when these command is the instruction is worked or run and where 82
we are going to get the results from D ,these are all for the wsfr command or you can just try it 83
yourself WSFL or WSFLP or with pulse contact command with yourself to understand this command how 84
can we use it how can we work with it. 85
But this is also for the production lines this is really important instruction and finished for this 86
video see you in the next video.