Programmatically Obtain a Computer's IP Address Using LabVIEW or LabWindows/CVIPrimary Software: LabVIEW Development Systems>>LabVIEW Full Development SystemPrimary Software Version: N/A Primary Software Fixed Version: N/A Secondary Software: LabWindows/CVI Development Systems>>Full Development System
Problem: How do I programmatically read the IP address of my computer using LabVIEW or LabWindows/CVI? Solution: From LabVIEW The String to IP function, from the TCP palette, can be used to read the IP address of a computer. To do this, place a String to IP function on the block diagram. If the name terminal of the function is left unwired, net address returns the IP network address of the current machine. To obtain all of the IP addresses of the computer, right-click the String to IP function and select Multiple Outputs, so that there is a check placed next to the option. The function will now output an array of IP addresses, so you must index the array in order to convert the IP address to a string using the IP to String function. One implementation, using the Index Array function, can be seen in the figure below.
Related Links: KnowledgeBase 3ENE8DL2: Programmatically Converting a Hostname to an IP Address in LabVIEW KnowledgeBase 3B6BTU4B: Return IP Address Instead of Machine Name in TCP Listen.vi and/or TCP Wait on Listener.vi Attachments:
Report Date: 06/08/2007 Last Updated: 05/05/2009 Document ID: 4A7G1N97 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
