Determine own IP address
aries
Junior Member
Does anyone know if there is a way to determine the IP address assigned to a master from within Netlinx? I want to have the code determine the IP of the master, picked up via DHCP, and then do some configuration depending on what the IP is.
Comments
-
Look up GET_IP_ADDRESS() in the help file and you will find what you're looking for.
Here is an example how to get the address of the NI.DEFINE_DEVICE dvMaster = 0:1:0 dvTP = 10001:1:0 DEFINE_FUNCTION PrintIP() { IP_ADDRESS_STRUCT IPInfo GET_IP_ADDRESS(dvMaster,IPInfo) SEND_STRING 0,"'My IP Address is: ',IPInfo.IPADDRESS" } DEFINE_EVENT BUTTON_EVENT[dvTP,1] { PUSH: {PrintIP()} }
After I push button 1:Line 23 (15:30:25):: My IP Address is: 192.168.1.10
-
Thank you.. this was tremendously helpful!
Categories
- All Categories
- 2.5K AMX General Discussion
- 922 AMX Technical Discussion
- 514 AMX Hardware
- 502 AMX Control Products
- 3 AMX Video Distribution Products
- 9 AMX Networked AV (SVSI) Products
- AMX Workspace & Collaboration Products
- 3.4K AMX Software
- 151 AMX Resource Management Suite Software
- 386 AMX Design Tools
- 2.4K NetLinx Studio
- 135 Duet/Cafe Duet
- 248 NetLinx Modules & Duet Modules
- 57 AMX RPM Forum
- 228 MODPEDIA - The Public Repository of Modules for Everyone
- 943 AMX Specialty Forums
- 2.6K AMXForums Archive
- 2.6K AMXForums Archive Threads
- 1.5K AMX Hardware
- 432 AMX Applications and Solutions
- 249 Residential Forum
- 182 Tips and Tricks
- 146 AMX Website/Forums