def adsPortOpenEx():<EOL>
port_open_ex = _adsDLL.AdsPortOpenEx<EOL>port_open_ex.restype = ctypes.c_long<EOL>port = port_open_ex()<EOL>if port == <NUM_LIT:0>:<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>return port<EOL>
Connect to the TwinCAT message router.

    :rtype: int
    :return: port number