LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help in TCP/IP

Hi, im really new to labview.

need some help in TCP/IP.

im kind of stuck on it.

i try the example in labview.

but only able to communicate if it send and receive on the same computer.

when i use 2 computer using lan connection (ethernet wire)

it cant send or receive when i enter the address and port(which i found from tool>option>VI Server.)

(correct me if i key in the wrong port or address)

im trying to use the labview example to understand how it work and program it on my program.

but i cant seem to make it work with using 2 computer connecting using lan connection (ethernet)

 

 

this attachment is my program which has help given for me to complete.

0 Kudos
Message 1 of 20
(4,149 Views)

im just a student, doing a project.

let me explain what my program about.

Computer A is to write and Computer B is to read.

when computer A have input and write to computer B, it read and send back the value which it has in the server to Computer A.

i need to use tcp/ip because there only 1 read computer that read the input and send back the value.

and more computer on writing.

to understand more about my program the attachment i have attach is the program and the text file to store all the values.

thanks.

 

 

 

Download All
0 Kudos
Message 2 of 20
(4,142 Views)

1. What is the cable you use? If you connect from PC to PC directly, cross cable is needed, and you must configure static IP in network interface, since there's no DHCP server to assign your PC an IP address.

2. You can check your IP address by start>>run>>cmd>>ipconfig.

3. Try Data Client, and Data Server from Help>>Find Examples>>Networking>>TCP whether it works? Change address to match with your target PC. Default port should be fine.

4. Try turning off firewall, and antivirus. They probably block the port you use.

0 Kudos
Message 3 of 20
(4,104 Views)
im connecting the ethernet cable to the school lan network, im not sure if it work.
0 Kudos
Message 4 of 20
(4,097 Views)

ok i'm now able to have respone from another computer.

but how am i going to program in a way like 1 as a server and another as a transmitter.

the server to store all the data and transmitter to search the database and give the result.

i have program it  that is able to store search and replace in just 1 computer itself.

you do you mind guiding me?

0 Kudos
Message 5 of 20
(4,087 Views)

If you can do it on opne PC, why don't you split part on client and server code, and put it on each side?

You cannot ask every single question, you've to think by yourself.

Try your very best before asking any questions.

0 Kudos
Message 6 of 20
(4,085 Views)
can you post your code as version 8.6?
0 Kudos
Message 7 of 20
(4,082 Views)

@kateB:

i have try my best but i have not knowledge about this. i have not lecturer in school to guide me on this therefore im here to ask.

apologize if i have ask too much.

 

@lavalava

this is the version 8.6.

i have add in the tcp function but it's wrong. still tryign to figure it out

0 Kudos
Message 8 of 20
(4,068 Views)

Okay, I just looked at you code but I couldn't figure out what you're trying to do with the first loop.

 

But the first thing I've noticed was you have only written the server side.   Where is the client?  A TCP socket server by itself serves no practical purpose unless there is client. So if you tried to run this code on both machine A & B, you will not talk because they're both servers.  You will need write a client application that will plug into this server socket so they can communicate.

 

If only want don't want a client/server application then write a UDP socket application then and have it broadcasts all over the LAN.

 

Regarding the lower loop, it doesn't look right.  I suggest you go to the example section, search "TCP".  And check out "Multiple Connections - Server.vi" and the two clients provided with LV.   A TCP socket server should handle more than just one connection, even if you can get this code to work you're still going to stuck with only one connection.  Change it to multiple connections.
0 Kudos
Message 9 of 20
(4,054 Views)

Divineapple wrote:
im connecting the ethernet cable to the school lan network, im not sure if it work.

Don't try your code yet. 

 

Try the example I just suggested.  Try running the server on one computer, log onto another computer run the clients and you should have a pretty good idea of how socket application works.

0 Kudos
Message 10 of 20
(4,051 Views)