1
00:00:10,000 --> 00:00:11,000
Hello, friends.

2
00:00:11,000 --> 00:00:23,000
Today we were with Python and I want to create different functions like sine wave and host wave.

3
00:00:24,000 --> 00:00:30,000
Using Python code and I want to float that code in my lab view.

4
00:00:30,000 --> 00:00:33,000
Function for that purpose.

5
00:00:33,000 --> 00:00:36,000
I just go to my order

6
00:00:40,000 --> 00:00:43,000
and over here I just copy this addition code.

7
00:00:46,000 --> 00:00:54,000
And over here, I just paste it, just rename it float.

8
00:00:56,000 --> 00:01:07,000
Fine Lord underscore sign underscore cause dot fine.

9
00:01:07,000 --> 00:01:10,000
So the name is changed.

10
00:01:11,000 --> 00:01:16,000
So right now I just open this in my cell.

11
00:01:17,000 --> 00:01:18,000
So open.

12
00:01:22,000 --> 00:01:27,000
Command Python, python code.

13
00:01:29,000 --> 00:01:35,000
So over here, the basic function is written for the edition.

14
00:01:35,000 --> 00:01:45,000
So first I want to import math function because sine function is available in this directory and I want

15
00:01:45,000 --> 00:01:59,000
to just put, let's say R or you can say result is equal to zero or here R is very to match dot sine

16
00:02:00,000 --> 00:02:03,000
of the function x.

17
00:02:03,000 --> 00:02:10,000
So over here this is x input variable x.

18
00:02:10,000 --> 00:02:13,000
So over here this is my sine function.

19
00:02:16,000 --> 00:02:19,000
It will return r.

20
00:02:20,000 --> 00:02:20,000
Okay.

21
00:02:20,000 --> 00:02:22,000
So I just copy this

22
00:02:27,000 --> 00:02:28,000
paste over here.

23
00:02:28,000 --> 00:02:33,000
In this case, I want to go for both zero less.

24
00:02:34,000 --> 00:02:36,000
And over here the function is indexes cause.

25
00:02:37,000 --> 00:02:45,000
And the result is, let's say r one or here I want to put r one is equal to zero in this case and over

26
00:02:45,000 --> 00:02:46,000
here r one.

27
00:02:46,000 --> 00:02:52,000
So it will create false and sine values.

28
00:02:52,000 --> 00:03:05,000
So I just close this right now and I want to just go to my folder or I want to change the sub v over

29
00:03:05,000 --> 00:03:05,000
here.

30
00:03:05,000 --> 00:03:15,000
So control E in this case, my name is just rename it Control Z.

31
00:03:15,000 --> 00:03:17,000
Just put this part inside.

32
00:03:20,000 --> 00:03:26,000
But so block underscore sign underscore force dot by control.

33
00:03:26,000 --> 00:03:29,000
P Now I want to change this.

34
00:03:29,000 --> 00:03:30,000
I can also.

35
00:03:32,000 --> 00:03:33,000
So I just put

36
00:03:36,000 --> 00:03:40,000
sign and course.

37
00:03:41,000 --> 00:03:44,000
Okay, so you give me sign, it goes.

38
00:03:45,000 --> 00:03:47,000
So let's save it.

39
00:03:47,000 --> 00:03:49,000
Check the pot.

40
00:03:49,000 --> 00:03:52,000
What is done with it?

41
00:03:53,000 --> 00:03:57,000
So go to the Python integration lab folder.

42
00:03:57,000 --> 00:03:59,000
Just copy this function.

43
00:04:00,000 --> 00:04:02,000
Let's say paste it over here.

44
00:04:03,000 --> 00:04:10,000
Just make it rename it sine, underscore course function.

45
00:04:11,000 --> 00:04:17,000
So just make it or here cosine and course is available over here.

46
00:04:18,000 --> 00:04:19,000
Ignore it.

47
00:04:19,000 --> 00:04:20,000
Control p.

48
00:04:20,000 --> 00:04:22,000
Just modify the code.

49
00:04:22,000 --> 00:04:26,000
Because in this case I only require single variable.

50
00:04:26,000 --> 00:04:30,000
I want to also delete this control.

51
00:04:30,000 --> 00:04:41,000
Be this also control B and over here I want to require, let's say in this case I need sine function

52
00:04:42,000 --> 00:04:45,000
and just call the.

53
00:04:47,000 --> 00:04:52,000
So via Python, just drag it.

54
00:04:52,000 --> 00:04:54,000
So make it over here.

55
00:04:55,000 --> 00:04:56,000
Place it.

56
00:04:56,000 --> 00:04:57,000
So sign and cause.

57
00:04:58,000 --> 00:05:00,000
Service is available over here.

58
00:05:00,000 --> 00:05:01,000
So just

59
00:05:04,000 --> 00:05:05,000
minimize this.

60
00:05:05,000 --> 00:05:06,000
Go to the code.

61
00:05:06,000 --> 00:05:11,000
In this case, I need sine and cause both the values.

62
00:05:11,000 --> 00:05:12,000
So for that purpose.

63
00:05:12,000 --> 00:05:17,000
Just first, use a simple error handler over here.

64
00:05:17,000 --> 00:05:24,000
Delete this in this one and delete this one also.

65
00:05:24,000 --> 00:05:25,000
Just copy this.

66
00:05:26,000 --> 00:05:29,000
Connect this function to the zero.

67
00:05:30,000 --> 00:05:46,000
Dysfunction or sign out error out to error in you see so right now or here this is my post function.

68
00:05:46,000 --> 00:05:53,000
So the name of the function is C or less C or less.

69
00:05:53,000 --> 00:05:58,000
So right now just the module is all the same.

70
00:05:58,000 --> 00:06:03,000
B and over here the variables would be same, let's say.

71
00:06:04,000 --> 00:06:04,000
Okay.

72
00:06:04,000 --> 00:06:09,000
And over here I got the sine value or here I go to the cost value.

73
00:06:09,000 --> 00:06:19,000
So for that purpose I just use different charts, let's say in the first case.

74
00:06:20,000 --> 00:06:26,000
So I just delete this also because I want to use iteration.

75
00:06:27,000 --> 00:06:33,000
And when these iterations are equal to so I just put a comparison.

76
00:06:34,000 --> 00:06:37,000
So in these situations is equal to.

77
00:06:38,000 --> 00:06:48,000
So just delete this also control B when these iterations value is equal to let's say create some control

78
00:06:48,000 --> 00:06:53,000
over here, this control will define how many values I needed.

79
00:06:54,000 --> 00:06:56,000
So let's say it is 100.

80
00:06:57,000 --> 00:06:59,000
So I just use chart over here.

81
00:07:01,000 --> 00:07:03,000
So single chart is there.

82
00:07:03,000 --> 00:07:13,000
So this I put charts over there for one is for course value and one is for sine value.

83
00:07:13,000 --> 00:07:15,000
Just connect this to that.

84
00:07:15,000 --> 00:07:18,000
I want to merge these two signals.

85
00:07:18,000 --> 00:07:23,000
Control you minimize this control you control e let's run it.

86
00:07:24,000 --> 00:07:30,000
So as you see over here, I got the sign value and it is starting from zero.

87
00:07:30,000 --> 00:07:32,000
And over here I got cost value.

88
00:07:32,000 --> 00:07:33,000
It started from over here.

89
00:07:33,000 --> 00:07:40,000
So let's I also want to change its frequency.

90
00:07:41,000 --> 00:07:49,000
So for that purpose first, I want to just, let's say mark these two signals.

91
00:07:50,000 --> 00:07:55,000
So I just go to build a function.

92
00:07:55,000 --> 00:07:58,000
Let's check what happened.

93
00:07:58,000 --> 00:08:12,000
So over here, the signal or here's another signal these days and it will create control B control D

94
00:08:12,000 --> 00:08:14,000
control D So run it.

95
00:08:15,000 --> 00:08:24,000
As you see, I got this type of signal over here and if you want to float both the signals simultaneously,

96
00:08:24,000 --> 00:08:30,000
in that case, I just use another function.

97
00:08:30,000 --> 00:08:43,000
So first I just go to the edge of the edge or here make it down mode indexing.

98
00:08:43,000 --> 00:08:46,000
Make it normal indexing on.

99
00:08:47,000 --> 00:08:56,000
And now let's check what happened with the validity function dash edge.

100
00:08:56,000 --> 00:09:07,000
And now I just use let's say graph or here connect this graph to this and run it.

101
00:09:08,000 --> 00:09:11,000
So as you see, I got both the values.

102
00:09:11,000 --> 00:09:15,000
So right now the number of values are more.

103
00:09:15,000 --> 00:09:23,000
So I just run it only ten times as you see sign and those values are over here sine value start from

104
00:09:23,000 --> 00:09:25,000
zero post values start from one.

105
00:09:25,000 --> 00:09:32,000
So this is how you can plot sine wave and false wave using python code in live view.

106
00:09:32,000 --> 00:09:34,000
Thank you.

