04-07-2010 11:56 PM
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.
04-08-2010 12:12 AM
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.
04-08-2010 08:35 PM
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.
04-08-2010 09:03 PM
04-08-2010 10:19 PM
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?
04-08-2010 10:36 PM
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.
04-08-2010 10:39 PM
04-08-2010 11:12 PM
@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.
this is the version 8.6.
i have add in the tcp function but it's wrong. still tryign to figure it out
04-08-2010 11:46 PM
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.
04-08-2010 11:53 PM
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.