From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview find ethernet device address for TCP/IP VISA communication

Thanks for the replies.

To Raven Fan, the device (its VXI-11 compliant) I'm connected to does have an IP, one that I've specified for it (its static). 192.168.0.3, and my computer Local Area TCP/IP settings: IP 192.168.0.2 Gtwy 192.168.1.1 SUb: 255.255.255.0. I also have MAX configured so I can communicate with the device through VISA resource through the crossover cable.

Gabs, I don't think the device or my computer has an XPort.

I think the 0.0.0.0 being returned is just a result of the UDP Listen that ends the while loop. Still, I can't get my device to respond. Probably because I'm not exactly sure which port to broadcast to. Any ideas on how to determine the port number? I sniffed MAX's autodetect VISA devices procedure, and it seems like it first broadcasts to the sunrpc port (111), but when I put that in, I still get no results.

Michael

0 Kudos
Message 31 of 39
(3,895 Views)
I find that the IP addressing, subnets and masking confuses me whenever I try to look into the details of it.  So what I am about to say may be totally offbase, but you said
 


miguelc wrote:

(its static). 192.168.0.3, and my computer Local Area TCP/IP settings: IP 192.168.0.2 Gtwy 192.168.1.1 SUb: 255.255.255.0. I also have MAX configured so I can communicate with the device through VISA resource through the crossover cable.



I am wondering abou that 3rd byte of the address.  For the device and your PC you have it set as 0, the gateway is set for 1.  Now the subnet has it set for 255 which is where I'm fuzzy on the details of masking.  Perhaps it needs to be 0.  Or the device, PC, and Gateway settings all need to be the same at 0 or 1.
 
For example on my work PC, my PC is x.x.160.80.  My gateway is x.x.160.1.  My subnet mask is 255.255.255.0 (like yours) and a realtime target (cFP) I connect to is x.x.160.102
 
Just a thought.
0 Kudos
Message 32 of 39
(3,889 Views)

Thanks for your help RavensFan. There may be some settings I can optimize with the TCPIP settings, but since it can communicate when setup with MAX, I went with the "if it ain't broke don't fix it" slogan. I eventaully did figure it out, I found my device manufacturer had a IP detection in their software, which I used WireShark to look at and discover which ports and what data to send. Works fine now. It was returning the info (or acknoledgment) on a different port. Tricky stuff. Thanks.

Michael

0 Kudos
Message 33 of 39
(3,871 Views)

I put the 3rd & 4th Octal into for loops to construct a tcpip string.  Then call Visa Open with a timeout of 2ms. If no error then IP was found and I stored into array. 

 

This will find VXI-11 & LXI device on the network.  The issue for me was finding IP addresses of hardware at 169.254.x.y, since the vendor hooked up the HW for testing it would remember their address which I needed to bring up the HW page to change the IP address to my network.

0 Kudos
Message 34 of 39
(3,169 Views)

can you tell me how to find a network adapter name?

 

if i have connected 3 network port i must have local area connection1, local area connection 2, local area connection 3, and wireless network connection

Regards,
Balaji DP
0 Kudos
Message 35 of 39
(2,579 Views)

Please have a look at the parse_IP.vi I posted several posts before.

 

The names are listed in the "standard output" control.

 

You only need to parse this string for the names.

(Take care of your operating system! The string depends on the Windows Version (XP/Vista/7) and the used language!)

 

Best regards,

 

Balze

0 Kudos
Message 36 of 39
(2,569 Views)

Hi Gabs, I am search the way to find out Lan device automatically in C# or C++, I think send broadcast message is a good idea, but I don't know what content to send in the message and then the device could reply me, could you show you C++ code? I have been blocked by this issue, if could get any help from you, I will appreciate it a lot.

Thanks again.

 

0 Kudos
Message 37 of 39
(833 Views)

Hi LouisPu,

I am not working in that field anymore. One thing I could recommend you is to contact the PI software department, maybe someone there can help you. Write to info@pi.de and they will forward your question to the right person.

Best regards,

Gabriela 

Message 38 of 39
(811 Views)

@LouisPu wrote:

Hi Gabs, I am search the way to find out Lan device automatically in C# or C++, I think send broadcast message is a good idea, but I don't know what content to send in the message and then the device could reply me, could you show you C++ code? I have been blocked by this issue, if could get any help from you, I will appreciate it a lot.


There is no universally accepted broadcast device discovery protocol. This was left out of the TCP/IP specification and left to individual implementations to decide how to do. So it totally depends on the device. And many device manufacturers develop their own proprietary discovery protocol which some may, but usually don't document.

Rolf Kalbermatter
My Blog
0 Kudos
Message 39 of 39
(806 Views)