Hello. 1
In this video we are going to learn scale command. 2
We can say that the scale command is used to see or use the analog data in the range 3
We want with the scale. 4
Command or scale instruction. 5
The data whose value range is read from the source data can be converted into the desired range 6
or desired data. 7
So for example on also you can see our graphs in here. 8
Let's take a look first. 9
Our example the analog signal zero to ten volt connected to analog input of PLC and let's say these 10
analog input value is equals to 0-4000 value in PLC. 11
If we want to convert and to see zero four thousand value is zero to one hundred value in the PLC or 12
HMI etc. 13
This can be possible. 14
These processing handle with can be handled at with scale. 15
command in here let's 16
Take a look to our example our source value, minimum source value is zero and the maximum source value 17
is going to be four thousand and our destination value will be maximum as maximum one hundred according 18
to our desired range. 19
We want to see this data as 0 to 100. 20
So this is our graphs 21
So in the PLC for example the data will be equal to two thousand and the output of these two thousand 22
data will be half of our destination value = 50. 23
So in the HMI for example we are going to say okay for example the tank is half full or half of 24
our tank is empty or let's take a look to another example and let's learn how to use scale command in 25
our plc projects. 26
Imagine 0 to 20 mA our pressure sensor connected to 04AD analod card 27
And in the this analog card we are giving this value as example for a moment 0 to 20 ma 28
equal to 0 to 4000 value inside of the PLC. 29
And the scaled value should be between zero to one hundred as percentage the analog value between 30
0 to 4000 is going to be in d20 data register. 31
So we are going to write this value in d20 and in here. 32
Let's take a look what we have maximum analog input value as digital in PLC is going to be 4000 according 33
to our example minimum analog input value as digital in plc is going to be zero and maximum desired 34
output range will be one hundred and minimum desired output range is going to be zero and in here. 35
Let's take a look our example. 36
So our source maximum value is D100. 37
This is just an example. 38
But this is K4000 is our analog input value as maximum value. 39
Source Max we are moving it always on with the always on contact. 40
In here we are moving this value to D100 and source min value is zero is we are moving is this value 41
to D101 and now target max value. 42
So our target maximum value or desired output range maximum value is one hundred and we are moving it 43
to be D102 and minimum desired output range is zero. 44
So we are moving the zero value to D103 and in here we are using our scale command 45
SCLP D20 remember what was it. 46
It is our written reading value as it is coming from the our pressure sensor and D100 is remember 47
it is coming from here it is our maximum value and this scale command is going to use this for parameter 48
in the instruction and d200 is our reading value what we are reading in D200 49
for example if the data is written from the reading not written reading from the pressure sensor 50
equals to let's say 5 mA and 5 mA is going to be equal to 1000 inside of the plc and according 51
to our scale command and according to our source max and min and target max and min values we are 52
going to see 25 in d200 53
So in in D200 is to 25 , %25 It means quarter 54
value is reading from the pressure sensor for example if the reading data is 2000 so we are 55
going to see a 50% in D200 data registers for example if this value is 4000 it 56
is coming from the 4000 from the pressure sensor so we are going to see 100 inside of D200 data register. 57
So in this video I am finished here. 58
See you in the next video.