def add_default_field(pv_name, default_field):
    """
    Add a default field to a pv name if pv_name does not already have a field and the default field makes sense.

     This is useful for example to add a VAL field to pvs for the archive

    Args:
        pv_name: the pv name
        default_field: default field to add

    Returns: pvname with the default field added

    """
    if default_field is None or default_field == "":
        return pv_name
    if pv_name is None or pv_name == "" or "." in pv_name:
        return pv_name
    return "{0}.{1}".format(pv_name, default_field)