def pv_units(pv, default=''):
    """get units for pv object, with optional default value

    Parameters
    ----------
       pv:       pv object (created by PV())
       default:  string value for default units

    Returns
    -------
       string with units

    """
    try:
        units = pv.units
    except:
        units = ''
    if units in (None, ''):
        units = default
    return units