def adsGetLocalAddressEx(port):<EOL>
get_local_address_ex = _adsDLL.AdsGetLocalAddressEx<EOL>ams_address_struct = SAmsAddr()<EOL>error_code = get_local_address_ex(port, ctypes.pointer(ams_address_struct))<EOL>if error_code:<EOL><INDENT>raise ADSError(error_code)<EOL><DEDENT>local_ams_address = AmsAddr()<EOL>local_ams_address._ams_addr = ams_address_struct<EOL>return local_ams_address<EOL>
Return the local AMS-address and the port number.

    :rtype: pyads.structs.AmsAddr
    :return: AMS-address