def find_remotes(qs, link_name):
    return_value = {}
    query_list = []
    query_list = qs.add_match_relationship(query_list, relationship='SITE', label=redis_site['site'])
    query_list = qs.add_match_relationship(query_list, relationship='PLC_SERVER', label=plc_server_name)
    query_list = qs.add_match_relationship(query_list, relationship='IO_LINK', label=link_name)
    query_list = qs.add_match_terminal(query_list, relationship='REMOTE_UNIT')
    (remote_sets, remote_sources) = qs.match_list(query_list)
    for i in remote_sources:
        return_value[i['modbus_address']] = i['parameters']
    return return_value
def find_remotes(qs, link_name):
    return_value = {}
    query_list = []
    query_list = qs.add_match_relationship(query_list, relationship='SITE', label=redis_site['site'])
    query_list = qs.add_match_relationship(query_list, relationship='PLC_SERVER', label=plc_server_name)
    query_list = qs.add_match_relationship(query_list, relationship='IO_LINK', label=link_name)
    query_list = qs.add_match_terminal(query_list, relationship='REMOTE_UNIT')
    (remote_sets, remote_sources) = qs.match_list(query_list)
    for i in remote_sources:
        return_value[i['modbus_address']] = i['parameters']
    return return_value