def adsSyncReadByNameEx(port, address, data_name, data_type, return_ctypes=False):<EOL>
<EOL>handle = adsSyncReadWriteReqEx2(<EOL>port,<EOL>address,<EOL>ADSIGRP_SYM_HNDBYNAME,<EOL><NUM_LIT>,<EOL>PLCTYPE_UDINT,<EOL>data_name,<EOL>PLCTYPE_STRING,<EOL>)<EOL>value = adsSyncReadReqEx2(<EOL>port, address, ADSIGRP_SYM_VALBYHND, handle, data_type, return_ctypes<EOL>)<EOL>adsSyncWriteReqEx(port, address, ADSIGRP_SYM_RELEASEHND, <NUM_LIT:0>, handle, PLCTYPE_UDINT)<EOL>return value<EOL>
Read data synchronous from an ADS-device from data name.

    :param int port: local AMS port as returned by adsPortOpenEx()
    :param pyads.structs.AmsAddr address: local or remote AmsAddr
    :param string data_name: data name
    :param Type data_type: type of the data given to the PLC, according to
        PLCTYPE constants
    :param bool return_ctypes: return ctypes instead of python types if True
        (default: False)
    :rtype: data_type
    :return: value: **value**