1
00:00:10,000 --> 00:00:11,000
Hello, friends.

2
00:00:11,000 --> 00:00:17,000
Today we discuss how to divide or how to call or divide.

3
00:00:17,000 --> 00:00:22,000
Function from Python to left you for that purpose.

4
00:00:22,000 --> 00:00:32,000
I just go to my folder and or here I just copy this already created by and python code.

5
00:00:33,000 --> 00:00:37,000
So as you see over here and I want to just rename it.

6
00:00:37,000 --> 00:00:40,000
So the I've let's say.

7
00:00:41,000 --> 00:00:49,000
So the board mentions name change and I also want to put its name complete over here.

8
00:00:50,000 --> 00:00:52,000
The I've I'd divide.

9
00:00:53,000 --> 00:00:53,000
Okay.

10
00:00:53,000 --> 00:01:00,000
So this is my code and I just open this code in by ten cell.

11
00:01:01,000 --> 00:01:06,000
So just go to the command python integration by code.

12
00:01:07,000 --> 00:01:13,000
And over here, this is my divide or it is subtraction code, so I just change it.

13
00:01:13,000 --> 00:01:23,000
So the function name is David, let's say, and it is for X and Y and the my operator is divide.

14
00:01:23,000 --> 00:01:25,000
And initial result is zero.

15
00:01:25,000 --> 00:01:29,000
So I just want to check the result for that purpose.

16
00:01:30,000 --> 00:01:30,000
Print.

17
00:01:32,000 --> 00:01:33,000
Result.

18
00:01:36,000 --> 00:01:42,000
And I also check for the value divide.

19
00:01:44,000 --> 00:01:45,000
Divide.

20
00:01:45,000 --> 00:01:50,000
And over here, this is my value should be, let's say, seven divided by two.

21
00:01:51,000 --> 00:01:54,000
And I want to check the result.

22
00:01:54,000 --> 00:01:58,000
So run it so the value it will

23
00:02:01,000 --> 00:02:03,000
making some error.

24
00:02:04,000 --> 00:02:07,000
Both divide seven by two.

25
00:02:08,000 --> 00:02:10,000
So let's check what happened.

26
00:02:12,000 --> 00:02:16,000
Fine result x divided by Y, x and y.

27
00:02:16,000 --> 00:02:19,000
Okay, so I just put operator over here.

28
00:02:19,000 --> 00:02:22,000
I need comma over here.

29
00:02:22,000 --> 00:02:24,000
So by mistake.

30
00:02:25,000 --> 00:02:27,000
Sorry and I just run it.

31
00:02:27,000 --> 00:02:29,000
So now the value is 3.5.

32
00:02:30,000 --> 00:02:35,000
So this is how you can divide using python.

33
00:02:35,000 --> 00:02:39,000
So I just go back to my code and I want to change this.

34
00:02:40,000 --> 00:02:43,000
And I also want to delete this.

35
00:02:45,000 --> 00:02:48,000
So my return function is this I save it.

36
00:02:49,000 --> 00:02:49,000
Closing.

37
00:02:50,000 --> 00:02:52,000
Minimize this.

38
00:02:52,000 --> 00:02:55,000
Now I want to change the Part IV.

39
00:02:56,000 --> 00:03:03,000
So in this case or here, the parts would be divided.

40
00:03:04,000 --> 00:03:08,000
In the case of subtraction, divide it.

41
00:03:08,000 --> 00:03:09,000
We call this code.

42
00:03:10,000 --> 00:03:13,000
And I also want to change the.

43
00:03:14,000 --> 00:03:17,000
This I can.

44
00:03:19,000 --> 00:03:22,000
So in this case, I just use the IV.

45
00:03:23,000 --> 00:03:24,000
Okay.

46
00:03:24,000 --> 00:03:27,000
Control is close.

47
00:03:27,000 --> 00:03:28,000
So now.

48
00:03:29,000 --> 00:03:32,000
I just go to my.

49
00:03:33,000 --> 00:03:41,000
I can integration forward and over here I just copy this multiply code and paste it over here and the

50
00:03:41,000 --> 00:03:44,000
name should be renamed.

51
00:03:44,000 --> 00:03:48,000
So that is the IV underscore two.

52
00:03:48,000 --> 00:04:01,000
As you see, I just open this ignore and in this place I just operator should be divided X divided by

53
00:04:01,000 --> 00:04:09,000
Y go back or here in the case of or here it is calling multiply and it is calling multiply.

54
00:04:09,000 --> 00:04:17,000
So I just delete this and in the place of the ivy ivy and I just.

55
00:04:18,000 --> 00:04:19,000
Go to PI code.

56
00:04:19,000 --> 00:04:24,000
And over here I want to just drag and drop this.

57
00:04:28,000 --> 00:04:28,000
Sir.

58
00:04:32,000 --> 00:04:34,000
I just drag and drop this.

59
00:04:36,000 --> 00:04:37,000
Over here.

60
00:04:37,000 --> 00:04:41,000
This is the service module path, so connected.

61
00:04:41,000 --> 00:04:43,000
So my program is ready right now.

62
00:04:43,000 --> 00:04:46,000
So let's check the result for this.

63
00:04:46,000 --> 00:04:52,000
So in this case, the X should be seven and why it should be two for the same results.

64
00:04:52,000 --> 00:04:54,000
So let's check the result.

65
00:04:54,000 --> 00:04:56,000
The result is 3.5.

66
00:04:56,000 --> 00:05:05,000
So this is how you can call divide by function in lab view.

67
00:05:05,000 --> 00:05:10,000
So let's check some more.

68
00:05:11,000 --> 00:05:15,000
So in this case, numeric palette or here, this is my divide function.

69
00:05:15,000 --> 00:05:18,000
This divide function is similar to this.

70
00:05:18,000 --> 00:05:19,000
Okay.

71
00:05:19,000 --> 00:05:23,000
So, again, I just create control for this.

72
00:05:23,000 --> 00:05:25,000
Create control for this.

73
00:05:25,000 --> 00:05:27,000
So this is X variable.

74
00:05:27,000 --> 00:05:28,000
This is very variable.

75
00:05:28,000 --> 00:05:30,000
And over here, this is my indicator.

76
00:05:30,000 --> 00:05:32,000
And I just put a y loop over here.

77
00:05:33,000 --> 00:05:44,000
So this court is written in view and this code is calling python code and the result of both of these

78
00:05:44,000 --> 00:05:45,000
are same.

79
00:05:46,000 --> 00:05:47,000
Okay, so let's.

80
00:05:50,000 --> 00:05:51,000
Change the code.

81
00:05:51,000 --> 00:05:56,000
So in this case over here, I'm using this orange color.

82
00:05:56,000 --> 00:05:59,000
This orange color stands for floating value.

83
00:05:59,000 --> 00:06:01,000
Let's delete or rip.

84
00:06:02,000 --> 00:06:03,000
Change the representation.

85
00:06:03,000 --> 00:06:10,000
I want to change the representation to hi 32 over here as you see it is changed to integer value.

86
00:06:10,000 --> 00:06:14,000
And over here this is integer value is converted to floating value.

87
00:06:15,000 --> 00:06:25,000
And again, if you want to check the result of seven divided by two, you can check it is three because

88
00:06:25,000 --> 00:06:34,000
the result is in formal integer right now as you see or here integer value comes from this.

89
00:06:34,000 --> 00:06:44,000
Let's change the representation to 32 again if you want to put nine divided by two in that case, also

90
00:06:44,000 --> 00:06:45,000
you will get four.

91
00:06:46,000 --> 00:06:55,000
And the input of this variable is, let's say I want to check for nine divided by 9.5 divided by two.

92
00:06:55,000 --> 00:06:59,000
It will also produce integer value.

93
00:06:59,000 --> 00:07:03,000
Okay, you can change the representation of these.

94
00:07:04,000 --> 00:07:10,000
Controls using this or here, there are different formats.

95
00:07:10,000 --> 00:07:12,000
This is for floating value.

96
00:07:12,000 --> 00:07:13,000
This is for integer value.

97
00:07:13,000 --> 00:07:19,000
And in this case I 32 stands for to raise to 32 means its range.

98
00:07:19,000 --> 00:07:24,000
These are unsigned number and these are unsigned word.

99
00:07:26,000 --> 00:07:30,000
This is byte ward, long ward.

100
00:07:31,000 --> 00:07:34,000
So this is how data is different formats.

101
00:07:34,000 --> 00:07:37,000
So this is how you can use different.

102
00:07:38,000 --> 00:07:41,000
Metric format for your operation.

103
00:07:42,000 --> 00:07:42,000
Thank you.

