Determine own IP address
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.
0
Comments
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: