1
00:00:10,000 --> 00:00:21,000
Today I will tell you how to connect node MCU with lab view using TCP protocol.

2
00:00:21,000 --> 00:00:30,000
So for that purpose, I just use a Arduino program or here, as you see, this is a node MCU sci fi

3
00:00:30,000 --> 00:00:31,000
server program.

4
00:00:32,000 --> 00:00:37,000
Right now my Arduino ID is 1.88.16.

5
00:00:37,000 --> 00:00:41,000
So over here you can find out this program.

6
00:00:41,000 --> 00:00:46,000
I also provide a link in my description.

7
00:00:46,000 --> 00:00:52,000
So over here in this, you have to first install Arduino.

8
00:00:52,000 --> 00:01:06,000
So from when you install Arduino after this that you have to install SB 8266 package to your Arduino

9
00:01:06,000 --> 00:01:13,000
toolbox because right now I program node MCU using Arduino IDE.

10
00:01:14,000 --> 00:01:20,000
So after installation node MCU, you have to just select your board.

11
00:01:20,000 --> 00:01:29,000
Right now my board is node MCU point nine, esp 12 e OC.

12
00:01:31,000 --> 00:01:32,000
Well module.

13
00:01:33,000 --> 00:01:38,000
So after this, you have to select your computer.

14
00:01:38,000 --> 00:01:44,000
Right now, my node MCU is connected to Comm six, as you see over here.

15
00:01:44,000 --> 00:01:53,000
So I'm just telling you a little bit about the code over here in this, you have to include your ESP

16
00:01:53,000 --> 00:01:56,000
8266 wi fi header file.

17
00:01:57,000 --> 00:02:01,000
Then you have to provide a server code.

18
00:02:01,000 --> 00:02:03,000
Right now it is 8000.

19
00:02:03,000 --> 00:02:10,000
Then you have to provide SSID or you can say your wi fi username.

20
00:02:10,000 --> 00:02:12,000
Right now my username is h.r.

21
00:02:12,000 --> 00:02:13,000
Three two.

22
00:02:14,000 --> 00:02:15,000
Are you on about this?

23
00:02:17,000 --> 00:02:20,000
Then you have to set the password.

24
00:02:20,000 --> 00:02:24,000
My password is an 880403.

25
00:02:25,000 --> 00:02:29,000
After that, the wi fi server create a port.

26
00:02:30,000 --> 00:02:33,000
So I just include two variables over here.

27
00:02:33,000 --> 00:02:40,000
First is integer input and another one is floating voltage.

28
00:02:41,000 --> 00:02:53,000
Right now I just connect a potentiometer with my node MCU and I want to get this potentiometer data

29
00:02:53,000 --> 00:02:54,000
or lab view.

30
00:02:54,000 --> 00:03:04,000
So first you have to connect, create a connection, or you have to create a server using node MCU.

31
00:03:04,000 --> 00:03:16,000
So over here this is the PIN Mode 16 output as it started output and using this on the serial com port

32
00:03:16,000 --> 00:03:22,000
or here you can see that wi fi is connected or not.

33
00:03:23,000 --> 00:03:24,000
I will show you.

34
00:03:24,000 --> 00:03:30,000
And over here, this is the program and the main program.

35
00:03:30,000 --> 00:03:33,000
Or you can say the working program is over here.

36
00:03:37,000 --> 00:03:45,000
So first after connection from the lab view, you have to write, stop or start.

37
00:03:45,000 --> 00:03:51,000
When you stop, it will print stop on the serial monitor.

38
00:03:51,000 --> 00:04:02,000
When you send a command start, it will read to A0 zero called off node MCU and over here is the formula.

39
00:04:02,000 --> 00:04:09,000
So right now I just download this code to my node MCU.

40
00:04:09,000 --> 00:04:10,000
It will take some time.

41
00:04:17,000 --> 00:04:19,000
Right now it is compiling.

42
00:04:22,000 --> 00:04:24,000
And as you see.

43
00:04:53,000 --> 00:04:53,000
Right.

44
00:04:57,000 --> 00:05:07,000
So as you see over here writing in the process, Blue Lady goes on off.

45
00:05:08,000 --> 00:05:16,000
And over here, this is a hard resetting y respin reset pin.

46
00:05:16,000 --> 00:05:21,000
When you press reset pin, you will get information about your connection.

47
00:05:21,000 --> 00:05:26,000
Right now over here, you have to set the board rate 115200.

48
00:05:27,000 --> 00:05:33,000
Then when I over here, this is a reset pin when I press it.

49
00:05:34,000 --> 00:05:39,000
As you see, my node MCU is creating a connection.

50
00:05:40,000 --> 00:05:49,000
So if I successfully connected and this is my IP address of node MCU and node MCU as a server roll started.

51
00:05:49,000 --> 00:06:00,000
Okay, so this is the connection part or you can say coding part for the node MCU.

52
00:06:00,000 --> 00:06:02,000
Now we go to lab view.

53
00:06:02,000 --> 00:06:06,000
So in the lab view, I just create a new V.

54
00:06:11,000 --> 00:06:20,000
So in the lab view I just go to data communication over here protocol we you just PCB protocol.

55
00:06:21,000 --> 00:06:28,000
So I just lock it in this TCP protocol, I just use TCP open.

56
00:06:29,000 --> 00:06:33,000
Then we have to write a signal.

57
00:06:33,000 --> 00:06:42,000
Let's say A and B, and in our program already A and B are specified.

58
00:06:42,000 --> 00:06:44,000
As you see over here.

59
00:06:45,000 --> 00:06:50,000
This is when A is there the client print blank.

60
00:06:50,000 --> 00:06:58,000
When B is there, it will print analog read and it will read the signal or potentiometer.

61
00:06:59,000 --> 00:07:07,000
So over here I just also read and I want to close it.

62
00:07:07,000 --> 00:07:12,000
So I just align all these, connect this.

63
00:07:16,000 --> 00:07:19,000
Connection ID in two out.

64
00:07:25,000 --> 00:07:30,000
And over here you have to create a common state.

65
00:07:30,000 --> 00:07:35,000
And I want to just use the IP address.

66
00:07:35,000 --> 00:07:39,000
So over here, no MCU, IP addresses this.

67
00:07:42,000 --> 00:07:44,000
So I just again, reset.

68
00:07:50,000 --> 00:07:53,000
So over here I got my IP address.

69
00:07:53,000 --> 00:07:57,000
1932.168.0.103.

70
00:07:57,000 --> 00:08:02,000
For my node MCU, I just put it.

71
00:08:03,000 --> 00:08:04,000
In this constant.

72
00:08:07,000 --> 00:08:15,000
So this is my IP address and I want to create a port and the port address is 8000.

73
00:08:16,000 --> 00:08:22,000
I just create a y loop for continuous reading the signal.

74
00:08:22,000 --> 00:08:24,000
Create a control to stop the reading.

75
00:08:25,000 --> 00:08:26,000
And over here, this is my data.

76
00:08:27,000 --> 00:08:37,000
So I just create a combo box over here, and I want to edit this combo box

77
00:08:40,000 --> 00:08:44,000
and I want to insert my two signals.

78
00:08:44,000 --> 00:08:50,000
Let's a first one and second one is B and then B is there.

79
00:08:51,000 --> 00:08:59,000
It will read the data from potentiometer to node MCU disconnected.

80
00:08:59,000 --> 00:09:12,000
And over here I just get the data and there is a bit how many bytes you want to read, bytes you want

81
00:09:12,000 --> 00:09:12,000
to read.

82
00:09:13,000 --> 00:09:15,000
And I also to.

83
00:09:17,000 --> 00:09:19,000
Simple error handler.

84
00:09:19,000 --> 00:09:22,000
Or just connect it to error handler.

85
00:09:23,000 --> 00:09:30,000
Just label it visible item label so that you can identify this.

86
00:09:31,000 --> 00:09:33,000
TCP Close Connections.

87
00:09:35,000 --> 00:09:36,000
TCP Read.

88
00:09:38,000 --> 00:09:39,000
TCP Write.

89
00:09:42,000 --> 00:09:45,000
DHCP open channel control.

90
00:09:45,000 --> 00:09:50,000
You will minimize minimize as you see here.

91
00:09:52,000 --> 00:09:55,000
So I just close this or reduce the space.

92
00:09:58,000 --> 00:10:02,000
So over here I just get the output.

93
00:10:02,000 --> 00:10:06,000
Connect the potentiometer to my node MCU.

94
00:10:06,000 --> 00:10:07,000
Over here.

95
00:10:07,000 --> 00:10:09,000
This is my potentiometer.

96
00:10:12,000 --> 00:10:14,000
As you see, this is my potentiometer.

97
00:10:14,000 --> 00:10:18,000
And in this potentiometer, I have three lives.

98
00:10:19,000 --> 00:10:24,000
I just connect higher end to 3.3 volt.

99
00:10:24,000 --> 00:10:32,000
So this green one is my 3.3, and this new one is my ground.

100
00:10:34,000 --> 00:10:35,000
I just connected.

101
00:10:35,000 --> 00:10:36,000
And my third one.

102
00:10:37,000 --> 00:10:39,000
The third one is my signal.

103
00:10:41,000 --> 00:10:45,000
So for acquisition voltage.

104
00:10:46,000 --> 00:10:48,000
So I just connected to a zero.

105
00:10:49,000 --> 00:10:51,000
So my connections are ready.

106
00:10:52,000 --> 00:10:52,000
And you see.

107
00:10:59,000 --> 00:11:05,000
So now green one is my blue one.

108
00:11:05,000 --> 00:11:07,000
Or you can say purple is my.

109
00:11:07,000 --> 00:11:10,000
This one is my crown and red one is my signal.

110
00:11:11,000 --> 00:11:14,000
It will read from this potentiometer.

111
00:11:15,000 --> 00:11:17,000
So my connections are very.

112
00:11:17,000 --> 00:11:24,000
And now I want to set a particular value default, let's say a great operation.

113
00:11:24,000 --> 00:11:25,000
Make it default.

114
00:11:26,000 --> 00:11:42,000
So right now, when I hit on the run button, my data or you can say a will goes to the node MCU and

115
00:11:42,000 --> 00:11:46,000
I also check it on my.

116
00:11:52,000 --> 00:12:00,000
See the monitor as you see right now Lloyd goes blinking a is.

117
00:12:03,000 --> 00:12:09,000
Over here on the serial monitor I check a is there so I just minimize it.

118
00:12:09,000 --> 00:12:15,000
So when I send a B over here, I got the data from the potentiometer.

119
00:12:15,000 --> 00:12:18,000
The maximum value is 3.12.

120
00:12:18,000 --> 00:12:24,000
So I just increase or decrease right now I'm decreasing, as you see.

121
00:12:26,000 --> 00:12:27,000
I will read the data.

122
00:12:29,000 --> 00:12:34,000
Right now my notebook is connected to my laptop.

123
00:12:34,000 --> 00:12:38,000
I also disconnected and I just connect the.

124
00:12:42,000 --> 00:12:43,000
My power bank with it.

125
00:12:43,000 --> 00:12:51,000
So maximum value is 3.3 as node MCU will provide only 3.3 port maximum.

126
00:12:51,000 --> 00:12:53,000
So I just stop it.

127
00:12:54,000 --> 00:12:58,000
So over here in the serial monitor, you can also check it.

128
00:12:59,000 --> 00:13:02,000
So when a is there, it goes here.

129
00:13:02,000 --> 00:13:08,000
So in this I want to just convert the string to numeric.

130
00:13:09,000 --> 00:13:17,000
So just go to string control number, chromosome or here fraction string to number converter.

131
00:13:17,000 --> 00:13:18,000
I just use it.

132
00:13:19,000 --> 00:13:22,000
So this is my small string.

133
00:13:23,000 --> 00:13:26,000
And over here this is my number value.

134
00:13:26,000 --> 00:13:27,000
So I just put

135
00:13:30,000 --> 00:13:35,000
stylised numeric meter

136
00:13:38,000 --> 00:13:42,000
and its range is maximum 3.54.

137
00:13:43,000 --> 00:13:44,000
Okay.

138
00:13:44,000 --> 00:13:49,000
And also, you can use a unit display over here.

139
00:13:55,000 --> 00:13:58,000
Several items they still display.

140
00:13:58,000 --> 00:14:01,000
Okay, so I just connect this.

141
00:14:04,000 --> 00:14:08,000
Control, you will minimize my space.

142
00:14:08,000 --> 00:14:17,000
So when I again hit on run button so first I send a in that case data out is blank right now without

143
00:14:17,000 --> 00:14:18,000
is blank.

144
00:14:19,000 --> 00:14:24,000
So when I send B as you see, maximum value is there.

145
00:14:24,000 --> 00:14:35,000
And right now maximum value is there when I decrease or move the potential return of the value.

146
00:14:35,000 --> 00:14:48,000
So using this you can use or you can interface node MCU with your using this, you can interface node

147
00:14:48,000 --> 00:14:48,000
MCU.

148
00:14:50,000 --> 00:14:52,000
Okay, thank you.

