1
00:00:11,000 --> 00:00:12,000
Hello, friends.

2
00:00:12,000 --> 00:00:25,000
Today I will tell you how to create data in Lab view and how to store that data into Excel file.

3
00:00:26,000 --> 00:00:32,000
So for that purpose, I just create first data.

4
00:00:32,000 --> 00:00:35,000
So I'm just using a for loop.

5
00:00:35,000 --> 00:00:39,000
As you see over here, I am having a for loop.

6
00:00:40,000 --> 00:00:43,000
And over here we just create a control.

7
00:00:43,000 --> 00:00:50,000
And the name of this data, Numeric is it is the data history.

8
00:00:51,000 --> 00:00:53,000
Or you can say data memory,

9
00:00:56,000 --> 00:00:59,000
because how many

10
00:01:02,000 --> 00:01:06,000
data you require in this case you just put over here.

11
00:01:06,000 --> 00:01:09,000
Let's say I want ten times.

12
00:01:09,000 --> 00:01:11,000
So I just put ten over here.

13
00:01:11,000 --> 00:01:22,000
If you require 100 data, then basically the number of data you require you should put over here.

14
00:01:23,000 --> 00:01:26,000
So right now, this is my data memory.

15
00:01:26,000 --> 00:01:29,000
And over here, this is my iteration.

16
00:01:29,000 --> 00:01:33,000
It will start from zero two up to N minus one.

17
00:01:33,000 --> 00:01:36,000
And N is given by this data memory.

18
00:01:37,000 --> 00:01:41,000
So let's I have a random number over here.

19
00:01:42,000 --> 00:01:48,000
And this random number will create values from 0 to 1.

20
00:01:49,000 --> 00:01:55,000
And I just take another number.

21
00:01:55,000 --> 00:01:56,000
Random number.

22
00:01:57,000 --> 00:02:07,000
Let's say this random number will generate the temperature between 0 to 100 degrees Celsius, let's

23
00:02:07,000 --> 00:02:08,000
say.

24
00:02:09,000 --> 00:02:15,000
And I just copy this function, this random number.

25
00:02:16,000 --> 00:02:24,000
Because in this case, I want to generate all type of data and I want to put that full type of data

26
00:02:24,000 --> 00:02:26,000
inside a Excel sheet.

27
00:02:26,000 --> 00:02:31,000
So the range of this second random number is from

28
00:02:34,000 --> 00:02:36,000
20 to 60, let's say.

29
00:02:37,000 --> 00:02:44,000
So I just add on these using build array function.

30
00:02:46,000 --> 00:02:56,000
So let's first data is my serial number that is 0123456789 up to date to me.

31
00:02:56,000 --> 00:03:01,000
Second is my random number that will generate 0 to 1.

32
00:03:03,000 --> 00:03:06,000
Third is my best one.

33
00:03:06,000 --> 00:03:08,000
Let's say this is my temperature data.

34
00:03:10,000 --> 00:03:16,000
And the fourth one is let's say it is the humidity.

35
00:03:18,000 --> 00:03:18,000
Right.

36
00:03:19,000 --> 00:03:20,000
Okay.

37
00:03:21,000 --> 00:03:29,000
And at the edge, I got all these data collected because auto indexing is right now on.

38
00:03:30,000 --> 00:03:41,000
So to write this data into Excel sheet, I just go to file input, output, write delimited spreadsheet.

39
00:03:41,000 --> 00:03:45,000
Just you have to connect as you see over here.

40
00:03:46,000 --> 00:03:53,000
And when I put Control Edge over here, I just feed to the data, two dimensional data to it.

41
00:03:53,000 --> 00:03:56,000
And over here it require a file path.

42
00:03:56,000 --> 00:04:06,000
Just create a constant over here because I have to give file path to to this function.

43
00:04:06,000 --> 00:04:09,000
And I'm just using comma delimited file.

44
00:04:10,000 --> 00:04:13,000
So just put comma over here.

45
00:04:13,000 --> 00:04:19,000
So it will create your data into Excel file.

46
00:04:19,000 --> 00:04:22,000
So just create an Excel sheet over here.

47
00:04:22,000 --> 00:04:29,000
So first I just create an Excel sheet.

48
00:04:29,000 --> 00:04:34,000
You have to just right click new micro Excel worksheet.

49
00:04:35,000 --> 00:04:37,000
And I just name it November.

50
00:04:38,000 --> 00:04:41,000
Okay, so this is Excel sheet.

51
00:04:41,000 --> 00:04:44,000
I have to create a CSV file from it.

52
00:04:44,000 --> 00:04:49,000
So to create a CSV file, I just save it.

53
00:04:50,000 --> 00:04:54,000
Save as on my desktop again.

54
00:04:54,000 --> 00:04:58,000
And the name is again November.

55
00:04:58,000 --> 00:05:03,000
And over here you have to use comma delimited CSV file.

56
00:05:04,000 --> 00:05:05,000
Okay.

57
00:05:06,000 --> 00:05:07,000
Just save it.

58
00:05:09,000 --> 00:05:10,000
Yes.

59
00:05:11,000 --> 00:05:12,000
Just close.

60
00:05:16,000 --> 00:05:16,000
See?

61
00:05:23,000 --> 00:05:23,000
Okay.

62
00:05:23,000 --> 00:05:26,000
So as you see over here, I got a CSV file.

63
00:05:27,000 --> 00:05:36,000
Just delete this Excel sheet right now in the browser or here in the part, you just click on Browse

64
00:05:36,000 --> 00:05:37,000
for part.

65
00:05:39,000 --> 00:05:43,000
Just select your file in the next of

66
00:05:45,000 --> 00:05:47,000
This is my number CSV file.

67
00:05:48,000 --> 00:05:48,000
Save it.

68
00:05:50,000 --> 00:05:55,000
Control you to minimize the path as you see over here.

69
00:05:55,000 --> 00:05:57,000
This is my temperature data or here.

70
00:05:57,000 --> 00:05:58,000
This is my humidity data.

71
00:05:58,000 --> 00:06:02,000
And this random number will create some values from 0 to 1.

72
00:06:02,000 --> 00:06:04,000
And this is my iteration.

73
00:06:04,000 --> 00:06:09,000
From zero to and minus one and NW is given by data empty.

74
00:06:09,000 --> 00:06:10,000
So let's check.

75
00:06:12,000 --> 00:06:20,000
So let's I put ten inside this and when I hit on run button data generated and it will be updated into

76
00:06:20,000 --> 00:06:26,000
the excel file that is CSV number csv.

77
00:06:26,000 --> 00:06:31,000
As you see when I hit on button, I got this data.

78
00:06:31,000 --> 00:06:32,000
This is my iteration.

79
00:06:32,000 --> 00:06:35,000
Second is my random number data.

80
00:06:35,000 --> 00:06:41,000
Third one is my humidity data, not temperature data, because it is from 0 to 100.

81
00:06:41,000 --> 00:06:44,000
As you see, I got 85 over here.

82
00:06:44,000 --> 00:06:50,000
And this data inside this data, we got the data between 20 to 60 only.

83
00:06:50,000 --> 00:06:57,000
So this is how you can feed or log your data inside Excel sheet.

84
00:06:57,000 --> 00:07:03,000
So let's check another important features of this.

85
00:07:03,000 --> 00:07:13,000
So when I again hit on Run button, it will create some error because right now this CSV file or you

86
00:07:13,000 --> 00:07:19,000
can say this Excel sheet is open, you have to close this and just also check this.

87
00:07:20,000 --> 00:07:23,000
The ninth data for the humidity is 28.

88
00:07:23,000 --> 00:07:27,000
When I again hit on one button, it will again update it.

89
00:07:27,000 --> 00:07:30,000
So close this, stop this.

90
00:07:30,000 --> 00:07:39,000
So when I again hit homerun button data is generated right now let's check what happened to the last

91
00:07:39,000 --> 00:07:43,000
data as you see over here, data is updated.

92
00:07:44,000 --> 00:07:48,000
So this is how you can generate in this case.

93
00:07:48,000 --> 00:07:51,000
Right now, I'm not appending the data.

94
00:07:52,000 --> 00:08:01,000
If you want to store your data, let's say right now, I again hit on the button again, it will create

95
00:08:01,000 --> 00:08:04,000
error because Excel is open in this case.

96
00:08:05,000 --> 00:08:13,000
Let's say if you hit button, data is created again, data is overwriting again and again in your file.

97
00:08:13,000 --> 00:08:16,000
If you want to store your previous data.

98
00:08:16,000 --> 00:08:21,000
Also just append to file create constant over here.

99
00:08:21,000 --> 00:08:23,000
It is false in this condition.

100
00:08:23,000 --> 00:08:31,000
Just make it true when it is true when you hit on run button, let's say first, second, third.

101
00:08:31,000 --> 00:08:35,000
Right now multiple data stored into your Excel file.

102
00:08:39,000 --> 00:08:46,000
As you see over here, the data is zero one, two, three, four, up to nine again, zero one, two,

103
00:08:46,000 --> 00:08:48,000
three, four, up to nine again.

104
00:08:48,000 --> 00:08:52,000
So this is how you can store your previous day data.

105
00:08:53,000 --> 00:08:58,000
Let's say I make it for the 24 hours.

106
00:08:58,000 --> 00:09:01,000
So I just put over here 24.

107
00:09:02,000 --> 00:09:12,000
So according to me, in a day, there are 24 hours and one hour this loop.

108
00:09:12,000 --> 00:09:18,000
When this loop runs, once time, it is equal to, let's say, one hour.

109
00:09:18,000 --> 00:09:24,000
So according to this, if you want to store the data day by day, you can use this program.

110
00:09:24,000 --> 00:09:35,000
And over here, if you want to put some delay, also delay, make it to show you the data what is going

111
00:09:35,000 --> 00:09:36,000
on over here.

112
00:09:36,000 --> 00:09:39,000
But I just delayed this delay.

113
00:09:40,000 --> 00:09:50,000
So when you hit on again run button right now it make error because it is open.

114
00:09:52,000 --> 00:09:57,000
So when I hit on the button again, let's check what happened to the data.

115
00:10:00,000 --> 00:10:09,000
So as you see, our previous data is from 0 to 9 again, 029 and in the last we have from 0 to 23.

116
00:10:10,000 --> 00:10:15,000
So this is how you can log your data inside the Excel sheet.

117
00:10:15,000 --> 00:10:20,000
This is all about how you can log data into Excel sheet.

118
00:10:20,000 --> 00:10:21,000
Thank you.

