LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

STR to IP --- Which result?


@CoastalMaineBird wrote:

Not exactly.  The remote device is something I have no control over.  There is some type of UI to configure it to connect to address X.X.X.X and send its data (UDP or TCP).  I simply want to display, on the Windows host program (which I develop), the address that I'm listening on.  They then enter that address into the gizmo, and away we go.


This will not usually work as soon as there is more than one physical network adapter on your computer as there is no way to know which adapter your user has the device connected to. You can sort of eliminate VMWare and VPN adapters by name or attribute but once you have more than one network adapter, and or routers, etc. things get definitely unmanageable for you to solve for the user.

 

Unless you wire a specific IP address to the "net address" of "Listen.vi" or "Create Listener", you are not listening on a specific network adapter but on any and all that are currently active on your computer!!!

 

I had recently a different challenge but that was relatively easy to solve. I had to tell an instrument which IP address (and port number) to connect to for a data streaming channel. But I had been creating a connection first to the device so I knew its IP address. This allowed me to do a Create Listener to find out what port number I was really listening too, and then I did match the IP address of the device with the IP addresses returned by the String to IP in array mode. The one that had the most matches in terms of bits counted from the highest significant bit was the address the device should try to connect too. So if your user can tell you what IP address his device has, you can actually backtrace from that, which of the String to IP addresses matches best with it.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 21 of 23
(569 Views)

@CoastalMaineBird wrote:

What you are looking for is something that you can program into the Remote Device to tell it the IP of the Host to which it should connect.

 

Not exactly.  The remote device is something I have no control over.  There is some type of UI to configure it to connect to address X.X.X.X and send its data (UDP or TCP).  I simply want to display, on the Windows host program (which I develop), the address that I'm listening on.  They then enter that address into the gizmo, and away we go.


     Thank you for clarifying this for me.

 

     This "find the unique Host IP because it is needed for XXXX" just trapped me, as it happens, and I haven't "untangled it" yet.  I purchased some software that has a pretty restrictive "locked license", where you tell the Company your PC's MAC Address, and they send you a License file configured for that MAC Address.  Like you, my Laptop (where I plan to use the Software) shows a Gigabit Ethernet Adaptor, two Microsoft Wi-Fi Direct Virtual Adaptors, two VMWare Virtual Ethernet Adaptors, an NI USBLAN Adaptor, a QualComm MU-MIMO Wireless Adaptor, and a Bluetooth Device.  Which one is "real"?  Needless to say, I chose the first, the Gigabit Ethernet Adaptor, and got a License file configured for this.  But I recently realized that my Laptop doesn't have any Ethernet Adaptor -- this is coming from a Dell Dock that I'm using (while in my home office) to, among other things, give me access to dual monitors.  Sigh, I'll have to go back and request a License change ... 

 

I hope you'll keep us informed and let us know how to (a) found the "right" IP Address, and (b) if you can similarly find the associated MAC Address.

 

Bob Schor

0 Kudos
Message 22 of 23
(561 Views)

I hope you'll keep us informed

 

Well, for better or for worse, here is what I'm going with:

Get My IP.png

It's not cross-platform, and it won't work in multi-NIC environs, but I don't see that there is a solution that will.

 

 

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

Message 23 of 23
(553 Views)