LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tcp/ip intercept

Hi,
I am trying to write a program that will open a tcp connection with another computer on the same network.  The program will then read the data read from the other computer, and either write the data to another computer or not.  The problem I am have is opening the connection with the other computers.  I keep getting errors like "Network address ill-formed", "Error 63", "Network address already in use."  Is it possible with LV to listen for commands from another computer using the tcp vi?  Here is the attached program I wrote.
 
Thanks,
Adam
0 Kudos
Message 1 of 17
(5,115 Views)

What kind of program is listening on port 1064 of the other computer? Is this also a LabVIEW program?

 

0 Kudos
Message 2 of 17
(5,107 Views)

The other program listing on port 1064 is not a LV program.  It sends out a command and then displays what value was read from the command sent.  It kind of works like this:

Program listing on port 1064 sends command "What position are you"

Other networked computer responses with "Postion whatever"

I am trying to make sure the command the computer listing on port 1064 sends is the right command.  I have already tried to use etherreal to captuers the packets, but received no codes which coorespond to what I am trying to verify.

Thanks,

Adam

0 Kudos
Message 3 of 17
(5,100 Views)

OK, you need to be a bit more specific.

  • Does the server simply send out a query upon a connection by a client?
  • Does the client first need to send a request in a specific syntax first?

Do you have any documentation on the server (e.g. a link to a manual)?

0 Kudos
Message 4 of 17
(5,094 Views)
I have no documentation on the server at all.  The server computer requests always are sent in the same order.  The order in which the the client receives and sends the request is always the same.  When told to, i.e pressing a button, the server computer will send a query of commands to the client.  Once received by the client, the proper information is then sent back to the server automatically.  According to ethereal, tracffic then ceases on the network card, until the button is pressed again.
 
Adam  
0 Kudos
Message 5 of 17
(5,089 Views)

Hi Adam,

 

1)      Please go to Tools >> Options >> VI Server: Configuration and check the box for TCP/IP.  Also, be sure that the Port matches the one in your VI. 

 

2)      Please try turning off any firewalls as they can block communication over the network.  If this works for you, you will need to add the port as an exception. 

 

I hope this helps get your application running.  Please post back if you are still having problems.    

 

Regards,

 

Elizabeth S.

Applications Engineer

National Instruments

0 Kudos
Message 6 of 17
(5,034 Views)
Hi,
I doubled checked to make sure I have the tcp/ip box checked and by default using the 3363 port.  If I tell my vi to use local port 3363, I get the error message 60 "Network address already in use."  I have no firewalls running on either computer.  The computer I am trying to connect to has no firewall, while my computer has a firewall which I disable before trying to connect.
 
Adam
0 Kudos
Message 7 of 17
(5,023 Views)

I don't think you should configure any VI server, because once you configure a service port you can no longer use it as a source port for outgoing connections. That error code makes sense because of that.

Let's go back to the beginning:


shivels wrote:
(1) The other program listing on port 1064 is not a LV program.  It sends out a command and then displays what value was read from the command sent.  It kind of works like this:
(2) Program listing on port 1064 sends command "What position are you"
(3) Other networked computer responses with "Postion whatever"
(4)I am trying to make sure the command the computer listing on port 1064 sends is the right command.  I have already tried to use etherreal to captuers the packets, but received no codes which coorespond to what I am trying to verify.

(1,2&3) A program that listens on a port is a server. It cannot randomly send out commands! All it can do is sit there and wait for incoming connections on that port. Once an oncoming connection is established between the client (your labview program, source port is irrelevant) and the server (the non-labview program, destination port 1064), they can communicate IF they follow a defined protocol to exchange information. If you don't have any documentation, you won't get very far. Most likely the "What position are you" is a welcome message confirming to the client that it connected to a suitable server as expected (and not e.g. to some random ftp or web server). Now the client can send its position. Do you know how the commands are formatted an terminated?

(4) An ethereal trace would certainly help, especially if you have some other equipment (non-labview) that can successfully communicate with that server. What happens if you would telnet to port 1064 of the server? do you see anything recognizeable on the terminal screen?

Are you even sure that all this uses TCP? Maybe the communications are actually in UDP, a stateless and connectionless protocol. In this case, the server can send out broadcasts or multicasts to trigger responses from the local clients.

Where does the server come from? Is it a commercial product? Who made it?

0 Kudos
Message 8 of 17
(5,017 Views)

I'm going to try and use ethernet to usb converters, that way I can modify an existing program I wrote that reads via VISA serial ports.  Thanks for the help.

Adam

0 Kudos
Message 9 of 17
(4,982 Views)
Hi,
It has been awhile since I was able to work on this, I was waiting from the USB to Ethernet converter to come in.  I am now able to connect to the remote computer.  Using an Ehtereal and, I believe it is called Smartsniffer, I was able to find hex codes to send the computer.  The computer responds, but always sends the same command.  Here is my current setup:
 
1.  Computer "1" is wired directly into my laptop's built in LAN port
2.  Computer "2" is wired directly into my laptop via USB to Ehternet converter
3.  I bridged the two Local Area Connections and assgined an IP address
4.  I am able to ping Computer "1" from Computer "2" and visa versa.
 
I am bascially using my laptop as a "passthrough" for the tcp commands.  I wrote a new vi which I thought would allow me to see the codes beiginning sent from Computer "1" and beignning sent from Computer "2".  The vi does not work, it times out at the wait on listener.  If I use Smartsniffer on my laptop and use Computer "1" to send commands to Computer "2" I can capture the hex codes.  I should be able to do the same thing using LV, but I can't seem to figure out how to structure my program to do this.  I believe this is possible in LV, but how?
 
Adam  
0 Kudos
Message 10 of 17
(4,929 Views)