def adsSyncWriteByNameEx(port, address, data_name, value, data_type):<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>adsSyncWriteReqEx(port, address, ADSIGRP_SYM_VALBYHND, handle, value, data_type)<EOL>adsSyncWriteReqEx(port, address, ADSIGRP_SYM_RELEASEHND, <NUM_LIT:0>, handle, PLCTYPE_UDINT)<EOL>
Send data synchronous to 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: PLC storage address
    :param value: value to write to the storage address of the PLC
    :param Type data_type: type of the data given to the PLC,
        according to PLCTYPE constants