Hello. 1
In this video we are going to learn how to use floating numbers in Delta plc for floating point edition. 2
You need to use DADD instruction for subtraction floating numbers. 3
You need to use Dsub instruction if you want to multiply two floating number in Delta plc. 4
You need to use DMUL instruction for floating point division. 5
You need to use DDIV instruction So 6
You can see in this page for everything. 7
For math instructions for floating numbers in here you can see as example DSUB DADD DDIV and 8
DMUL instructions in here values. 9
And for these values you can see the outputs in the right side. 10
So for this page we need to learn how to compare floating numbers in Delta plc so f greater than 11
f not equal f equal f less than commands than you can see the symbols of these floating numbers 12
comparisons. 13
You can see them all in here and you can see as the example for example in here D38 is 14
not is equal to 0.0001 D40 equals zero. 15
So these are not equal as floating equals. 16
this is our instruction. 17
So m 32 is not activated. 18
So for ISPSoft let's do a little bit practice and let's learn deeply these commands. 19
I will open a new project and a new project. 20
It's come here to programs right click. 21
A new POU name. 22
Let's say floating number and say OK 23
a new project is created LDA M1000 always on contact. 24
And for comparison let's say we need to use floating equal instruction. 25
This is not correct. 26
We will at just one contact. 27
And this is a serial contact. 28
So F Load means f LD . 29
So we need to use it like this LD means actually LOAD. 30
As you know that if Load or f LD D0 D2 and let's put here OR contact f or for example less 31
than D4 D6 32
Also I will add to here same contact. 33
LD 34
LD M1000 35
M1000 like this already. 36
Add a serial contact. 37
And in here add an output out y 0 and here LD M1000 should be 1000 in here DADD for example D 38
ten D twelve and one more netwoek. 39
And LD M1000 40
multiply D20 D22 41
So these are just enough for for me for a moment I will go on line to my simulator. 42
This project is compiling just before forgot the outputs. 43
Sorry for this. 44
D14 and D24 now compile our project again it it's compiled and go online and go 45
online to plc or simulator and do a transfer for me. 46
Yes. 47
Now memory is remain seven thousand one hundred seventy six steps. 48
Okay. 49
Our cpu is run situation but I said again. 50
Run. 51
So now. 52
look our output but this is not correct because we are always going to get this output 53
to this condition. 54
Imagine if D0 equals to D2 or D4 should be less than from D6 55
So let's change it. 56
Change present value zero point zero zero zero one 57
no. 58
Yes indeed so I put this value to here and I will say my data format AS float 59
So 60
this one change present value again zero point zero zero one. 61
I will put it here and let's change it to zero point eight seven five. 62
So you see our output is for a moment off because these floating numbers are not equal and for D4 - D6 63
D4 D46 this comparison is not correct. 64
So let's change it to 65
zero comma zero zero two so you see from this line our output is high for a moment for floating addition. 66
Let's change this present value. 67
1 comma 2 3 and 5. 68
This is our value and I will put here for example one comma and seven and six and five okay. 69
So we will get three point zero zero zero zero for multiplication. 70
Let's change for example change preset zero point zero comma zero. 71
5 , 5 0 0. 72
Let's say zero comma five hundred and multiply these three comma one or three point one. 73
Okay so we will get these value one point five hundred fifty. 74
So increase this value change this value for example five comma five. 75
And enter and we will get these values. 76
So floating one more multiplication five point like this. 77
So we will get this all. 78
So you can do a small practices like this. 79
You can use DADD command for the addition DDIV command for the division and DMUL 80
command for the multiplication and DSUB command for the subtraction for floating numbers. 81
And you can use FLD equals FLD less than 82
fld for the serial context greater than for example and F LD not equal command in your applications. 83
So I am finished for this video. 84
See you in the next video.