0
1
00:00:21,480 --> 00:00:22,240
Hello.
1

2
00:00:22,350 --> 00:00:30,630
In this video we are going to learn how to use floating numbers in Delta plc for floating point edition.
2

3
00:00:30,720 --> 00:00:37,570
You need to use DADD instruction for subtraction floating numbers.
3

4
00:00:37,680 --> 00:00:46,160
You need to use Dsub instruction if you want to multiply two floating number in Delta plc.
4

5
00:00:46,200 --> 00:00:52,170
You need to use DMUL instruction for floating point division.
5

6
00:00:52,180 --> 00:00:56,380
You need to use DDIV instruction So
6

7
00:00:56,430 --> 00:01:00,260
You can see in this page for everything.
7

8
00:01:00,580 --> 00:01:10,680
For math instructions for floating numbers in here you can see as example DSUB DADD DDIV  and
8

9
00:01:10,770 --> 00:01:14,550
DMUL instructions in here values.
9

10
00:01:14,550 --> 00:01:18,660
And for these values you can see the outputs in the right side.
10

11
00:01:18,930 --> 00:01:28,830
So for this page we need to learn how to compare floating numbers in Delta plc so f greater than
11

12
00:01:29,190 --> 00:01:38,190
f not equal f equal f less than commands than you can see the symbols of these floating numbers
12

13
00:01:38,190 --> 00:01:39,450
comparisons.
13

14
00:01:39,450 --> 00:01:49,350
You can see them all in here and you can see as the example for example in here D38  is
14

15
00:01:49,350 --> 00:01:54,730
not is equal to 0.0001 D40 equals zero.
15

16
00:01:54,750 --> 00:01:59,870
So these are not equal as floating equals.
16

17
00:01:59,910 --> 00:02:03,030
this is our instruction.
17

18
00:02:03,120 --> 00:02:06,690
So m 32 is not activated.
18

19
00:02:06,750 --> 00:02:16,090
So for ISPSoft let's do a little bit practice and let's learn deeply these commands.
19

20
00:02:16,170 --> 00:02:19,290
I will open a new project and a new project.
20

21
00:02:19,350 --> 00:02:21,810
It's come here to programs right click.
21

22
00:02:21,810 --> 00:02:24,240
A new POU name.
22

23
00:02:24,270 --> 00:02:30,350
Let's say floating number and say OK
23

24
00:02:33,140 --> 00:02:39,250
a new project is created LDA M1000 always on contact.
24

25
00:02:39,440 --> 00:02:46,810
And for comparison let's say we need to use floating equal instruction.
25

26
00:02:46,850 --> 00:02:48,690
This is not correct.
26

27
00:02:48,820 --> 00:02:52,460
We will at just one contact.
27

28
00:02:52,460 --> 00:02:54,660
And this is a serial contact.
28

29
00:02:54,680 --> 00:02:57,590
So F Load means f LD .
29

30
00:02:57,830 --> 00:03:02,440
So we need to use it like this LD means actually LOAD.
30

31
00:03:02,450 --> 00:03:15,360
As you know that if Load or f LD D0 D2 and let's put here OR contact f or for example less
31

32
00:03:15,360 --> 00:03:18,860
than D4 D6 
32

33
00:03:19,620 --> 00:03:25,260
Also I will add to here same contact.
33

34
00:03:25,710 --> 00:03:27,140
LD 
34

35
00:03:27,140 --> 00:03:28,650
LD M1000
35

36
00:03:31,690 --> 00:03:35,880
M1000  like this already.
36

37
00:03:35,900 --> 00:03:37,620
Add a serial contact.
37

38
00:03:37,740 --> 00:03:53,550
And in here add an output out y 0 and here LD M1000 should be 1000 in here DADD for example D
38

39
00:03:53,640 --> 00:03:58,460
ten D twelve and one more netwoek.
39

40
00:03:59,570 --> 00:04:02,810
And LD M1000
40

41
00:04:05,550 --> 00:04:08,950
multiply D20 D22
41

42
00:04:08,970 --> 00:04:16,650
So these are just enough for for me for a moment I will go on line to my simulator.
42

43
00:04:16,650 --> 00:04:21,050
This project is compiling just before forgot the outputs.
43

44
00:04:21,180 --> 00:04:23,070
Sorry for this.
44

45
00:04:23,100 --> 00:04:34,380
D14 and D24 now compile our project again it it's compiled and go online and go
45

46
00:04:34,380 --> 00:04:39,300
online to plc or simulator and do a transfer for me.
46

47
00:04:39,480 --> 00:04:40,700
Yes.
47

48
00:04:40,890 --> 00:04:46,590
Now memory is remain seven thousand one hundred seventy six steps.
48

49
00:04:46,590 --> 00:04:47,730
Okay.
49

50
00:04:48,030 --> 00:04:51,790
Our cpu is run  situation but I said again.
50

51
00:04:51,900 --> 00:04:52,600
Run.
51

52
00:04:52,600 --> 00:04:54,020
So now.
52

53
00:04:54,230 --> 00:05:05,220
look our output but  this is not correct because we are always going to get this output
53

54
00:05:05,580 --> 00:05:08,010
to this condition.
54

55
00:05:08,310 --> 00:05:20,860
Imagine if D0 equals to D2  or D4  should be less than from D6
55

56
00:05:20,940 --> 00:05:22,790
So let's change it.
56

57
00:05:22,890 --> 00:05:26,640
Change present value zero point zero zero zero one
57

58
00:05:30,360 --> 00:05:31,200
no.
58

59
00:05:31,540 --> 00:05:44,000
Yes indeed so I put this value to here and I will say my data format AS float
59

60
00:05:44,060 --> 00:05:44,530
So
60

61
00:05:47,580 --> 00:05:52,770
this one change present value again zero point zero zero one.
61

62
00:05:52,920 --> 00:06:01,810
I will put it here and let's change it to zero point eight seven five.
62

63
00:06:01,950 --> 00:06:12,260
So you see our output is for a moment off because these floating numbers are not equal and for D4 - D6
63

64
00:06:12,290 --> 00:06:15,610
D4 D46 this comparison is not correct.
64

65
00:06:15,900 --> 00:06:17,220
So let's change it to
65

66
00:06:19,830 --> 00:06:31,150
zero comma zero zero two so you see from this line our output is high for a moment for floating addition.
66

67
00:06:31,540 --> 00:06:33,210
Let's change this present value.
67

68
00:06:33,250 --> 00:06:37,000
1 comma 2 3 and 5.
68

69
00:06:37,000 --> 00:06:48,300
This is our value and I will put here for example one comma and seven and six and five okay.
69

70
00:06:48,500 --> 00:06:54,110
So we will get three point zero zero zero zero for multiplication.
70

71
00:06:54,110 --> 00:06:58,600
Let's change for example change preset zero point zero comma zero.
71

72
00:06:59,570 --> 00:07:01,850
5 , 5 0 0.
72

73
00:07:02,420 --> 00:07:13,630
Let's say zero comma five hundred and multiply these three comma one or three point one.
73

74
00:07:13,870 --> 00:07:22,020
Okay so we will get these value one point five hundred fifty.
74

75
00:07:22,080 --> 00:07:28,770
So increase this value change this value for example five comma five.
75

76
00:07:28,860 --> 00:07:31,850
And enter and we will get these values.
76

77
00:07:31,860 --> 00:07:38,110
So floating one more multiplication five point like this.
77

78
00:07:38,190 --> 00:07:40,460
So we will get this all.
78

79
00:07:40,590 --> 00:07:43,960
So you can do a small practices like this.
79

80
00:07:44,130 --> 00:07:55,360
You can use DADD command for the addition DDIV command for the division and DMUL
80

81
00:07:55,420 --> 00:08:05,980
command for the multiplication and DSUB command for the subtraction for floating numbers.
81

82
00:08:06,130 --> 00:08:12,450
And you can use FLD  equals FLD less than 
82

83
00:08:12,790 --> 00:08:22,090
fld  for the serial context greater than for example and F LD not equal command in your applications.
83

84
00:08:22,180 --> 00:08:24,180
So I am finished for this video.
84

85
00:08:24,190 --> 00:08:25,600
See you in the next video.
