1
00:00:10,000 --> 00:00:11,000
Hello, friends.

2
00:00:11,000 --> 00:00:23,000
Today we will discuss how to call a multiplication function from Python to leave you for that purpose.

3
00:00:23,000 --> 00:00:27,000
I already create a copy of subtraction.

4
00:00:27,000 --> 00:00:30,000
I just want to change its name.

5
00:00:30,000 --> 00:00:35,000
It is multiply ull.

6
00:00:36,000 --> 00:00:39,000
And over here I want to adjust.

7
00:00:41,000 --> 00:00:49,000
I also the name of python code is also changed so I just rename it complete name I want to place over

8
00:00:49,000 --> 00:00:51,000
here am ul

9
00:00:58,000 --> 00:01:04,000
multi life so over here and this is my sub vi.

10
00:01:04,000 --> 00:01:07,000
So first I want to change the sub via let's see.

11
00:01:09,000 --> 00:01:17,000
So this is my again same current vi part strip part, build part, append part and over here this is

12
00:01:17,000 --> 00:01:18,000
the part for subtraction.

13
00:01:18,000 --> 00:01:21,000
I want to change it to multiply.

14
00:01:21,000 --> 00:01:34,000
So I just rename it, copy this and just place this name over here so it will create path for it or

15
00:01:34,000 --> 00:01:35,000
append path for it.

16
00:01:35,000 --> 00:01:38,000
So let's check as you see see user.

17
00:01:38,000 --> 00:01:42,000
So no comment by turn, integration by code multiply.

18
00:01:42,000 --> 00:01:44,000
So this is done.

19
00:01:44,000 --> 00:01:47,000
Now I want to change the name.

20
00:01:48,000 --> 00:01:59,000
So from here it is mu l multiplied oc so oc controller's save the sub v is saved.

21
00:01:59,000 --> 00:02:07,000
Now I want to just change the python code because earlier it is written in return for subtraction.

22
00:02:07,000 --> 00:02:18,000
So I just open, I just go to the command python integration by code multiply open this code.

23
00:02:18,000 --> 00:02:22,000
So as you see, the code is written for the subtraction.

24
00:02:22,000 --> 00:02:30,000
So now I just define another function multiply.

25
00:02:30,000 --> 00:02:31,000
Okay.

26
00:02:31,000 --> 00:02:40,000
So in this case also I have two variable x and y and now I want to multiply this x into y and the result

27
00:02:40,000 --> 00:02:41,000
is this.

28
00:02:41,000 --> 00:02:43,000
So I want to also check the result.

29
00:02:43,000 --> 00:02:45,000
So let's say print.

30
00:02:51,000 --> 00:02:51,000
Okay.

31
00:02:52,000 --> 00:02:58,000
And I also want to define the value of X and Y.

32
00:02:58,000 --> 00:03:08,000
So for that purpose, multiply the value of X is, let's say three, comma five.

33
00:03:09,000 --> 00:03:11,000
So the results would be 15.

34
00:03:11,000 --> 00:03:15,000
So I just save it, run it.

35
00:03:16,000 --> 00:03:19,000
So as you see, the result is 15.

36
00:03:20,000 --> 00:03:22,000
So I just minimize this.

37
00:03:22,000 --> 00:03:29,000
So I do not require this command and this command also.

38
00:03:31,000 --> 00:03:34,000
So this is my code for multiplication.

39
00:03:34,000 --> 00:03:35,000
Just save it.

40
00:03:36,000 --> 00:03:37,000
Close this.

41
00:03:38,000 --> 00:03:43,000
And now I just go to the main die.

42
00:03:43,000 --> 00:03:45,000
So I just copy this.

43
00:03:45,000 --> 00:03:49,000
Or let's create a new Y for this purpose.

44
00:03:50,000 --> 00:04:06,000
So if I knew y control d over here, just call connectivity, python code and this open python session.

45
00:04:06,000 --> 00:04:09,000
Then we require python node.

46
00:04:09,000 --> 00:04:12,000
Then we have to close the python.

47
00:04:12,000 --> 00:04:19,000
So as you see over here, I want to visible its labels.

48
00:04:20,000 --> 00:04:22,000
Then I want to arrange it.

49
00:04:22,000 --> 00:04:26,000
So connect session now to session in session output.

50
00:04:26,000 --> 00:04:29,000
Session in error.

51
00:04:29,000 --> 00:04:34,000
How to error in like this or here you have to create the version.

52
00:04:34,000 --> 00:04:36,000
The version is 3.9.

53
00:04:37,000 --> 00:04:44,000
Then you have to give the path of the module so it will come from code.

54
00:04:45,000 --> 00:04:51,000
This is my VI, so I just copy this.

55
00:04:51,000 --> 00:04:54,000
This one I already save.

56
00:04:54,000 --> 00:04:56,000
That is MLE.

57
00:04:56,000 --> 00:04:59,000
So just connect this over here.

58
00:04:59,000 --> 00:05:01,000
You have to put the function name.

59
00:05:01,000 --> 00:05:06,000
The name of the function is amu l multi ply.

60
00:05:07,000 --> 00:05:19,000
So as you see over here and then you have to put the constant because what type of variable you want.

61
00:05:19,000 --> 00:05:31,000
So let's say in this case I just DB constant that is zero connect this and in this I want to create

62
00:05:31,000 --> 00:05:32,000
control for x and Y.

63
00:05:32,000 --> 00:05:34,000
So I just go over here.

64
00:05:34,000 --> 00:05:48,000
So numeric control for x, this is my x and numeric control for y, this is my y and I also require

65
00:05:48,000 --> 00:05:49,000
indicator.

66
00:05:50,000 --> 00:05:52,000
So here is my numeric indicator.

67
00:05:52,000 --> 00:05:55,000
It will produce x into y.

68
00:05:56,000 --> 00:05:56,000
Okay.

69
00:05:57,000 --> 00:05:59,000
So just connect.

70
00:06:01,000 --> 00:06:06,000
So this will connect it to this first variable.

71
00:06:06,000 --> 00:06:08,000
This is my second variable.

72
00:06:10,000 --> 00:06:15,000
And over here, this is my result.

73
00:06:15,000 --> 00:06:17,000
Okay, so my program is done.

74
00:06:18,000 --> 00:06:25,000
I also create a simple error handler, as you see, and just label it

75
00:06:28,000 --> 00:06:30,000
visible label.

76
00:06:30,000 --> 00:06:38,000
And for the continuous reading or continuous calling, I just create a y loop over here.

77
00:06:38,000 --> 00:06:42,000
Create a control for this now control you.

78
00:06:42,000 --> 00:06:44,000
It will minimize the space.

79
00:06:44,000 --> 00:06:50,000
So let's check the result of these two.

80
00:06:50,000 --> 00:06:52,000
Let's say three and two.

81
00:06:52,000 --> 00:06:53,000
Five,

82
00:06:56,000 --> 00:06:56,000
right?

83
00:06:56,000 --> 00:07:03,000
As you see, I got 15 over here and if you four into five, 25 and five, 25.

84
00:07:03,000 --> 00:07:11,000
So this code is similar to the function in the toolbox numeric multiply.

85
00:07:11,000 --> 00:07:16,000
So as you see over here, I just create control for this.

86
00:07:16,000 --> 00:07:18,000
This is my x variable.

87
00:07:18,000 --> 00:07:19,000
This is my y variable.

88
00:07:19,000 --> 00:07:25,000
It is by two because x and y is already used or and or.

89
00:07:25,000 --> 00:07:28,000
Here this is my indicator.

90
00:07:28,000 --> 00:07:30,000
And for the while continuous

91
00:07:33,000 --> 00:07:34,000
operation I just create a value.

92
00:07:34,000 --> 00:07:42,000
So this code and this code are both are similar to this code is in lab view and this code is for the

93
00:07:42,000 --> 00:07:43,000
python code.

94
00:07:44,000 --> 00:07:46,000
So this is how you can multiply.

95
00:07:48,000 --> 00:07:54,000
Or you can call a multiply function from python to leave you.

96
00:07:54,000 --> 00:07:55,000
Thank you.

