Norm Kirchner Posted August 21, 2008 Report Share Posted August 21, 2008 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. Quote Link to comment
LAVA 1.0 Content Posted August 21, 2008 Report Share Posted August 21, 2008 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 Quote Link to comment
Norm Kirchner Posted August 21, 2008 Author Report Share Posted August 21, 2008 Well that was just too simple... Answered my own question. Never saw "Resolve Machine Alias" in the palettes before but damn sure came in handy Quote Link to comment
JiMM Posted August 21, 2008 Report Share Posted August 21, 2008 QUOTE (Norm Kirchner @ Aug 20 2008, 02:09 PM) Well that was just too simple...Answered my own question. Never saw "Resolve Machine Alias" in the palettes before but damn sure came in handy 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. Quote Link to comment
Norm Kirchner Posted August 21, 2008 Author Report Share Posted August 21, 2008 QUOTE (neB @ Aug 20 2008, 01: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 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. http://content.screencast.com/users/NJKirchner/folders/Jing/media/0f169636-fb45-4a56-ab09-4093029e610f/2008-08-20_1315.png' rel='nofollow'> Quote Link to comment
TobyD Posted August 21, 2008 Report Share Posted August 21, 2008 I've always done it like Ben (take off the true constant and you'll get the network machine name)... Quote Link to comment
Mellroth Posted August 21, 2008 Report Share Posted August 21, 2008 I always use the way Ben mentioned, but on machines with multiple network cards, I first set the Str2IP primitive to return multiple. This way I can get IP addresses of all my cards. /J Quote Link to comment
eaolson Posted August 21, 2008 Report Share Posted August 21, 2008 QUOTE (Norm Kirchner @ Aug 20 2008, 01:17 PM) oh.... well that works too I guess... almostalmost... 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. Quote Link to comment
Norm Kirchner Posted August 21, 2008 Author Report Share Posted August 21, 2008 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 Quote Link to comment
Neville D Posted August 21, 2008 Report Share Posted August 21, 2008 QUOTE (Norm Kirchner @ Aug 20 2008, 12:05 PM) 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 I'm not sure why its not working for you but, this always works for me.. http://lavag.org/old_files/monthly_08_2008/post-2680-1219259757.jpg' target="_blank"> Neville. Quote Link to comment
dannyt Posted August 22, 2008 Report Share Posted August 22, 2008 QUOTE (TobyD @ Aug 20 2008, 07:24 PM) I've always done it like Ben (take off the true constant and you'll get the network machine name)... http://lavag.org/old_files/monthly_08_2008/post-8758-1219256588.png' target="_blank"> 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 Quote Link to comment
TobyD Posted August 22, 2008 Report Share Posted August 22, 2008 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. Quote Link to comment
B Chavez Posted August 22, 2008 Report Share Posted August 22, 2008 QUOTE (Norm Kirchner @ Aug 20 2008, 11:17 AM) oh.... well that works too I guess... almostalmost... 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. This isn't any cleaner than 'IP to String' but it does show how the integer represents the IP. Quote Link to comment
Rolf Kalbermatter Posted September 11, 2008 Report Share Posted September 11, 2008 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.