Jump to content

Obtaining IP address of machine


Recommended Posts

I am doing some messaging through VI server to a remote app.

I want to package up some information about the app sending the command, in particular the IP of the machine and the current port of the app instance.

I know I can get the port easily enough, but the IP address is a bit elusive.

Any ideas or previous inventions.

As mentioned in the topic, I don't want to use systemexec and parse if possible.

Link to comment

QUOTE (Norm Kirchner @ Aug 20 2008, 02:01 PM)

I am doing some messaging through VI server to a remote app.

I want to package up some information about the app sending the command, in particular the IP of the machine and the current port of the app instance.

I know I can get the port easily enough, but the IP address is a bit elusive.

Any ideas or previous inventions.

As mentioned in the topic, I don't want to use systemexec and parse if possible.

On TCP palette "String to IP" if you don't wire an input will return machines IP.

If that works for you, thanks got to Rolf, if its wrong please forgive me.

Ben

Link to comment

QUOTE (Norm Kirchner @ Aug 20 2008, 02:09 PM)

That must have come out in 8.0. It's not in 7.1.

QUOTE (neB @ Aug 20 2008, 02:06 PM)

On TCP palette "String to IP" if you don't wire an input will return machines IP.

If that works for you, thanks got to Rolf, if its wrong please forgive me.

Ben

That's what I have always used Ben.

Link to comment

QUOTE (Norm Kirchner @ Aug 20 2008, 01:17 PM)

oh.... well that works too I guess... almost

almost... because i'm not sure how to interpret the decimal notation...so I have to convert back

Also I guess my previous implementation is giving me someone else IP address.

Very strange.

I notice that 174.24.0.120 is in a block of reserved IP addresses. Is your computer part of a private network or anything?

I didn't know about the Resolve Machine Alias node until now, either. However, I can't get it to give me anything other than an invalid input error. How is it supposed to work? The help page is distinctly unhelpful.

Link to comment

That is actually a real IP within our internal network to someone in Tuscon.

I checked that PCs running services and there is no sign of any NI SW on it.

This is private corp network.

And I figured it had something to do with the alias in the project tree, hence the My Computer and not my PC name.

any other combination just tossed an error.

I have an SR out to NI at the moment, so we'll find out more soon and I'll pass along what I learn

Link to comment

QUOTE (TobyD @ Aug 20 2008, 07:24 PM)

I did not know of this nice elegant solution, here we always run the dos command ipconfig /all and parse the output.

There seems to still be a big advantage to our method in that we also get a lot of extra information that we tends to use alongside the machine IP address, the subnet Mask MAC address and if you have multiple cards the adaptor name so it is easy to tell which network card is which. Are we missing a trick here, is there a nice elegant way of getting this extra info directly of LabVIEW primitives ?

cheers

Dannyt

Link to comment

QUOTE (dannyt @ Aug 21 2008, 02:01 AM)

Are we missing a trick here, is there a nice elegant way of getting this extra info directly of LabVIEW primitives ?

There are no tricks that I am aware of for pulling out this extra info. If you have it working with the parser I'd stick with that.

Link to comment
  • 3 weeks later...

QUOTE (dannyt @ Aug 21 2008, 05:01 AM)

I did not know of this nice elegant solution, here we always run the dos command ipconfig /all and parse the output.

There seems to still be a big advantage to our method in that we also get a lot of extra information that we tends to use alongside the machine IP address, the subnet Mask MAC address and if you have multiple cards the adaptor name so it is easy to tell which network card is which. Are we missing a trick here, is there a nice elegant way of getting this extra info directly of LabVIEW primitives ?

There is no trick to get more information with native functionality. But there is an iptools.llb library over at the dark side I have posted there that calls into the Windows network management API and returns to you just about anything that you could get with ipconfig too, which by the way calls the same API anyhow.

Rolf Kalbermatter

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.