Today I will tell you how to connect node MCU with lab view using TCP protocol.
So for that purpose, I just use a Arduino program or here, as you see, this is a node MCU sci fi
server program.
Right now my Arduino ID is 1.88.16.
So over here you can find out this program.
I also provide a link in my description.
So over here in this, you have to first install Arduino.
So from when you install Arduino after this that you have to install SB 8266 package to your Arduino
toolbox because right now I program node MCU using Arduino IDE.
So after installation node MCU, you have to just select your board.
Right now my board is node MCU point nine, esp 12 e OC.
Well module.
So after this, you have to select your computer.
Right now, my node MCU is connected to Comm six, as you see over here.
So I'm just telling you a little bit about the code over here in this, you have to include your ESP
8266 wi fi header file.
Then you have to provide a server code.
Right now it is 8000.
Then you have to provide SSID or you can say your wi fi username.
Right now my username is h.r.
Three two.
Are you on about this?
Then you have to set the password.
My password is an 880403.
After that, the wi fi server create a port.
So I just include two variables over here.
First is integer input and another one is floating voltage.
Right now I just connect a potentiometer with my node MCU and I want to get this potentiometer data
or lab view.
So first you have to connect, create a connection, or you have to create a server using node MCU.
So over here this is the PIN Mode 16 output as it started output and using this on the serial com port
or here you can see that wi fi is connected or not.
I will show you.
And over here, this is the program and the main program.
Or you can say the working program is over here.
So first after connection from the lab view, you have to write, stop or start.
When you stop, it will print stop on the serial monitor.
When you send a command start, it will read to A0 zero called off node MCU and over here is the formula.
So right now I just download this code to my node MCU.
It will take some time.
Right now it is compiling.
And as you see.
Right.
So as you see over here writing in the process, Blue Lady goes on off.
And over here, this is a hard resetting y respin reset pin.
When you press reset pin, you will get information about your connection.
Right now over here, you have to set the board rate 115200.
Then when I over here, this is a reset pin when I press it.
As you see, my node MCU is creating a connection.
So if I successfully connected and this is my IP address of node MCU and node MCU as a server roll started.
Okay, so this is the connection part or you can say coding part for the node MCU.
Now we go to lab view.
So in the lab view, I just create a new V.
So in the lab view I just go to data communication over here protocol we you just PCB protocol.
So I just lock it in this TCP protocol, I just use TCP open.
Then we have to write a signal.
Let's say A and B, and in our program already A and B are specified.
As you see over here.
This is when A is there the client print blank.
When B is there, it will print analog read and it will read the signal or potentiometer.
So over here I just also read and I want to close it.
So I just align all these, connect this.
Connection ID in two out.
And over here you have to create a common state.
And I want to just use the IP address.
So over here, no MCU, IP addresses this.
So I just again, reset.
So over here I got my IP address.
1932.168.0.103.
For my node MCU, I just put it.
In this constant.
So this is my IP address and I want to create a port and the port address is 8000.
I just create a y loop for continuous reading the signal.
Create a control to stop the reading.
And over here, this is my data.
So I just create a combo box over here, and I want to edit this combo box
and I want to insert my two signals.
Let's a first one and second one is B and then B is there.
It will read the data from potentiometer to node MCU disconnected.
And over here I just get the data and there is a bit how many bytes you want to read, bytes you want
to read.
And I also to.
Simple error handler.
Or just connect it to error handler.
Just label it visible item label so that you can identify this.
TCP Close Connections.
TCP Read.
TCP Write.
DHCP open channel control.
You will minimize minimize as you see here.
So I just close this or reduce the space.
So over here I just get the output.
Connect the potentiometer to my node MCU.
Over here.
This is my potentiometer.
As you see, this is my potentiometer.
And in this potentiometer, I have three lives.
I just connect higher end to 3.3 volt.
So this green one is my 3.3, and this new one is my ground.
I just connected.
And my third one.
The third one is my signal.
So for acquisition voltage.
So I just connected to a zero.
So my connections are ready.
And you see.
So now green one is my blue one.
Or you can say purple is my.
This one is my crown and red one is my signal.
It will read from this potentiometer.
So my connections are very.
And now I want to set a particular value default, let's say a great operation.
Make it default.
So right now, when I hit on the run button, my data or you can say a will goes to the node MCU and
I also check it on my.
See the monitor as you see right now Lloyd goes blinking a is.
Over here on the serial monitor I check a is there so I just minimize it.
So when I send a B over here, I got the data from the potentiometer.
The maximum value is 3.12.
So I just increase or decrease right now I'm decreasing, as you see.
I will read the data.
Right now my notebook is connected to my laptop.
I also disconnected and I just connect the.
My power bank with it.
So maximum value is 3.3 as node MCU will provide only 3.3 port maximum.
So I just stop it.
So over here in the serial monitor, you can also check it.
So when a is there, it goes here.
So in this I want to just convert the string to numeric.
So just go to string control number, chromosome or here fraction string to number converter.
I just use it.
So this is my small string.
And over here this is my number value.
So I just put
stylised numeric meter
and its range is maximum 3.54.
Okay.
And also, you can use a unit display over here.
Several items they still display.
Okay, so I just connect this.
Control, you will minimize my space.
So when I again hit on run button so first I send a in that case data out is blank right now without
is blank.
So when I send B as you see, maximum value is there.
And right now maximum value is there when I decrease or move the potential return of the value.
So using this you can use or you can interface node MCU with your using this, you can interface node
MCU.
Okay, thank you.