LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I find a tcp/ip port number?

I am trying to connect to a Seimens S7-300 through an ethernet connection.  I have it's IP adress and can ping through command promt but using VISA in NI-MAX requires a port number when using socket connection. 
How do I determine the port number to enter and start a valid VISA resource?
 
Thanks,
Nick
0 Kudos
Message 1 of 12
(14,446 Views)
The port number is an U16 integer, so there are 2^16 possible ports. Guessing will get you nowhere. You have a few choices:
  1. Look in the documentation or server configuration what the port is that the server uses.
  2. Do a full port scan on the target IP to identify open ports (= ports where a service is listening) and try them all.
  3. IF you have some other program that can communicate with the server, run it and look at the currently established connections with a console command, network tool or packet sniffer. What is your OS?
  4. Also make sure that the server computer does not have a misconfigured firewall that blocks connections to the server.
 
Message 2 of 12
(14,434 Views)

I have very little experience with ethernet communication, but have a project that requires it. 

 

I am trying to connect LabView to one of our product that uses Ethernet/IP.  Our product currently uses software from the vendor to communicate, and it is buggy and cumbersome, so my boss has decided that we should test this product with LabView. 

 

I am trying to establish ethernet communication with our product by following the video at 

http://zone.ni.com/wv/app/play_doc/p/id/wv-1653/width/800/height/640/autostart/y 

I am able to ping the product.  

 

When I create a new device and interface in MAX, choose VISA TCP/IP Resource, both the Manual Entry of LAN instrument adn Manual Entry of Raw Socket require a Port Number. I have entered the port from Wireshark (file included) 546 and also tried 547, but MAX replies with "Could not open a VISA session to "TCPIP0::192.168.0.3::546::SOCKET".  Error code 0xBFFF0011.

 

By looking at the wireshark screen dump, can you tell me if I am trying the wrong port?  How can I get this working?

 

Thanks.




metzler CLAD
0 Kudos
Message 3 of 12
(13,864 Views)

What is the instrument that you are trying to connect to? Port 547 is for a DHCP server. ????

0 Kudos
Message 4 of 12
(13,860 Views)

I am trying to connect to one of my companies products, it's called a High Voltage Controller.  The ethernet signal comes into a MCF52235CAL60 Microcontroller made by Freescale. 

 

Port 547 is listed on the wireshark screen that I used to monitor the communcation from our customer's software to the product we designed for them. 

 

What is a DHCP server?




metzler CLAD
0 Kudos
Message 5 of 12
(13,854 Views)

DHCP - not the port you are looking for.

0 Kudos
Message 6 of 12
(13,850 Views)

These are v6 DHCP ports, but it is well possible that your software is using these for whatever it wants. Could it be they are conflicting because you also have IPv6 configured? Does it work if you disable all IPv6 in the network properties?

 

(Sorry, these are just some wild guesses, I haven't played much with IPv6 at all yet. On newer OS version, it is enabled by default, in addition to IPv4).

0 Kudos
Message 7 of 12
(13,844 Views)

If you want to try guessing, you can browse these rings that have standard port numbers and names.

 

Download All
0 Kudos
Message 8 of 12
(13,815 Views)

I have disabled IPv6 and stareted the customer's software to communicate with our product.  The software still communicates.  The included print screen shows the network properties with the product connected and communicating - i don't know if this will help.

 

Since wireshark reports the port is "User atagram Protocol, Src Port: dhcpv6-client (546), Dst Port: dhcpv6-server (547) (see previous post attachment), wouldn't that be correct?  Maybe I am doing something else wrong since I have no experience with Ethernet communication.




metzler CLAD
0 Kudos
Message 9 of 12
(13,802 Views)

Pcardinale,

 

I don't know ho to use the type defs you posted.

 

Since wireshark reports the port is "User atagram Protocol, Src Port: dhcpv6-client (546), Dst Port: dhcpv6-server (547) (see previous post attachment), wouldn't that be correct?  Maybe I am doing something else wrong since I have no experience with Ethernet communication.




metzler CLAD
0 Kudos
Message 10 of 12
(13,799 Views)